-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
0 parents
commit de18599
Showing
20 changed files
with
616 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
[run] | ||
omit = zvt_coin/recorders/* |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,108 @@ | ||
# Byte-compiled / optimized / DLL files | ||
__pycache__/ | ||
*.py[cod] | ||
*$py.class | ||
|
||
# C extensions | ||
*.so | ||
|
||
#idea | ||
.idea | ||
.vscode | ||
# Distribution / packaging | ||
.Python | ||
env/ | ||
build/ | ||
develop-eggs/ | ||
dist/ | ||
downloads/ | ||
eggs/ | ||
.eggs/ | ||
lib/ | ||
lib64/ | ||
parts/ | ||
sdist/ | ||
var/ | ||
*.egg-info/ | ||
.installed.cfg | ||
*.egg | ||
|
||
# PyInstaller | ||
# Usually these files are written by a python script from a template | ||
# before PyInstaller builds the exe, so as to inject date/other infos into it. | ||
*.manifest | ||
*.spec | ||
|
||
# Installer logs | ||
pip-log.txt | ||
pip-delete-this-directory.txt | ||
|
||
# Unit test / coverage reports | ||
htmlcov/ | ||
.tox/ | ||
.coverage | ||
.coverage.* | ||
.cache | ||
nosetests.xml | ||
coverage.xml | ||
*,cover | ||
.hypothesis/ | ||
|
||
# Translations | ||
*.mo | ||
*.pot | ||
|
||
# Django stuff: | ||
*.log | ||
local_settings.py | ||
|
||
# Flask stuff: | ||
instance/ | ||
.webassets-cache | ||
|
||
# Scrapy stuff: | ||
.scrapy | ||
|
||
# Sphinx documentation | ||
docs/_build/ | ||
|
||
# PyBuilder | ||
target/ | ||
|
||
# IPython Notebook | ||
.ipynb_checkpoints | ||
|
||
# pyenv | ||
.python-version | ||
|
||
# celery beat schedule file | ||
celerybeat-schedule | ||
|
||
# dotenv | ||
.env | ||
|
||
# virtualenv | ||
venv/ | ||
ENV/ | ||
/ve/ | ||
|
||
# Spyder project settings | ||
.spyderproject | ||
|
||
# Rope project settings | ||
.ropeproject | ||
|
||
/zvt-home | ||
/zvt-test-home | ||
*.tar.gz | ||
|
||
.pytest_cache/ | ||
|
||
# LibreOffice locks | ||
.~lock.*# | ||
|
||
node_modules/ | ||
|
||
*running.ipynb | ||
|
||
.DS_Store |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
language: python | ||
cache: pip | ||
python: | ||
- '3.6' | ||
install: | ||
- git fetch --tags --depth=500 | ||
- pip install 'pytest>=3.6' --force-reinstall | ||
- pip install pytest-cov codecov | ||
- pip install -r ./requirements.txt | ||
script: | ||
- pytest ./tests --cov-config=.coveragerc --cov-report term --cov=./zvt_coin --ignore=tests/recorders/ | ||
after_success: | ||
- codecov | ||
deploy: | ||
provider: pypi | ||
user: foolcage | ||
password: | ||
secure: MvVCnUZUuTYxzs8R8kWTocOqZt2MGUX/W1hdKMxKJ9G9hFOYhzjEnbsF1Sc9yHB/0S1OY49068ScbN6iCuyKK2LZy/x3o7cKJgPnQt2LEjy6Yuu9MLxT6v8hJ0MTT3YCn0N8bNv4tOz7KkxxbZ8O/b5MgIKfdjBhVHEj92hhykYzyzlmG8mF+nxU/j0IGCAdxN9+IDioMIvCgnFqQhvkDwva4YbG6Uy+8YMVHFT3I+tSZRSmYxl/IwHJS+5tinI4TxX/ewrI5EznOe0HZvhF+eez+tGenS3pKF4hqF6t4RmKQX2kkdMuPFAvuveoMnPGiaSdoEMni1JPFnZL+3R4GVJPzk4F10v6AZPd10CARXqEwP23JCKAe0WvnbSBkV4iKpkvgxqPA59UwNQ90Jn4pDcTSao1WfRliAnBWCVj7S4x6xjEoNKPvOhXP3RPIYhgEFu4Ma4Cpihkof6VVtlg8VAJKH7j1vWmms3ShdddKXMeF2365sn5Owe671okYmMYMas/v47Y2Cz/0hwpVLuklNR5OYayXMXfUMIG2pH1pEFvg7y8v7ivy1EyCKGva+M/qEnoR1VGWNGSkypJHxG+w8dbtYwf3EYTA9fk/di3ygzepV7RrKJSDf8R+NwFrSfXeoEP07LonbtGN9iIz7Lp5PoB6rv99NHihlB47n1+PtM= | ||
on: | ||
tags: true | ||
notifications: | ||
email: | ||
recipients: | ||
- 5533061@qq.com |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
MIT License | ||
|
||
Copyright (c) 2021 zvtvz | ||
|
||
Permission is hereby granted, free of charge, to any person obtaining a copy | ||
of this software and associated documentation files (the "Software"), to deal | ||
in the Software without restriction, including without limitation the rights | ||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | ||
copies of the Software, and to permit persons to whom the Software is | ||
furnished to do so, subject to the following conditions: | ||
|
||
The above copyright notice and this permission notice shall be included in all | ||
copies or substantial portions of the Software. | ||
|
||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR | ||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, | ||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE | ||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER | ||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, | ||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE | ||
SOFTWARE. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
include *.md | ||
include *.txt | ||
include LICENSE | ||
recursive-include zvt_coin/* * |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
[![github](https://img.shields.io/github/stars/zvtvz/zvt_coin.svg)](https://github.com/zvtvz/zvt_coin) | ||
[![image](https://img.shields.io/pypi/v/zvt_coin.svg)](https://pypi.org/project/zvt_coin/) | ||
[![image](https://img.shields.io/pypi/l/zvt_coin.svg)](https://pypi.org/project/zvt_coin/) | ||
[![image](https://img.shields.io/pypi/pyversions/zvt_coin.svg)](https://pypi.org/project/zvt_coin/) | ||
[![Build Status](https://api.travis-ci.org/zvtvz/zvt_coin.svg?branch=master)](https://travis-ci.org/zvtvz/zvt_coin) | ||
[![HitCount](http://hits.dwyl.com/zvtvz/zvt_coin.svg)](http://hits.dwyl.com/zvtvz/zvt_coin) | ||
|
||
### introduction | ||
|
||
|
||
### feature | ||
|
||
### install | ||
``` | ||
pip install zvt_coin | ||
pip show zvt_coin | ||
``` | ||
|
||
upgrate to latest version | ||
``` | ||
pip install --upgrade zvt_coin | ||
``` | ||
|
||
### usage | ||
|
||
### contact | ||
|
||
wechat foolcage |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
[![github](https://img.shields.io/github/stars/zvtvz/zvt_coin.svg)](https://github.com/zvtvz/zvt_coin) | ||
[![image](https://img.shields.io/pypi/v/zvt_coin.svg)](https://pypi.org/project/zvt_coin/) | ||
[![image](https://img.shields.io/pypi/l/zvt_coin.svg)](https://pypi.org/project/zvt_coin/) | ||
[![image](https://img.shields.io/pypi/pyversions/zvt_coin.svg)](https://pypi.org/project/zvt_coin/) | ||
[![Build Status](https://api.travis-ci.org/zvtvz/zvt_coin.svg?branch=master)](https://travis-ci.org/zvtvz/zvt_coin) | ||
[![HitCount](http://hits.dwyl.com/zvtvz/zvt_coin.svg)](http://hits.dwyl.com/zvtvz/zvt_coin) | ||
|
||
### 说明 | ||
|
||
|
||
### 特性 | ||
|
||
### 安装 | ||
``` | ||
pip install zvt_coin | ||
pip show zvt_coin | ||
``` | ||
|
||
更新到最新版本 | ||
``` | ||
pip install --upgrade zvt_coin | ||
``` | ||
|
||
### 使用 | ||
|
||
### 联系 | ||
|
||
微信 foolcage |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
zvt |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,65 @@ | ||
#!/usr/bin/env python | ||
|
||
# To use a consistent encoding | ||
from codecs import open | ||
from os import path | ||
|
||
# Always prefer setuptools over distutils | ||
from setuptools import setup, find_packages | ||
|
||
try: | ||
# for pip >= 10 | ||
from pip._internal.req import parse_requirements | ||
except ImportError: | ||
# for pip <= 9.0.3 | ||
from pip.req import parse_requirements | ||
|
||
here = path.abspath(path.dirname(__file__)) | ||
|
||
# Get the long description from the README file | ||
with open(path.join(here, 'README.md'), encoding='utf-8') as f: | ||
long_description = f.read() | ||
|
||
# Arguments marked as "Required" below must be included for upload to PyPI. | ||
# Fields marked as "Optional" may be commented out. | ||
|
||
install_reqs = parse_requirements("requirements.txt", session=False) | ||
|
||
try: | ||
requirements = [str(ir.req) for ir in install_reqs] | ||
except: | ||
requirements = [str(ir.requirement) for ir in install_reqs] | ||
|
||
setup( | ||
name='zvt_coin', | ||
version='0.0.1', | ||
description='unified,modular quant framework for human beings ', | ||
long_description=long_description, | ||
url='https://github.com/zvtvz/zvt_coin', | ||
author='foolcage', | ||
author_email='5533061@qq.com', | ||
classifiers=[ # Optional | ||
'Development Status :: 5 - Production/Stable', | ||
'Intended Audience :: Developers', | ||
'Intended Audience :: Customer Service', | ||
'Intended Audience :: Education', | ||
'Intended Audience :: Financial and Insurance Industry', | ||
'Topic :: Software Development :: Build Tools', | ||
'Topic :: Office/Business :: Financial :: Investment', | ||
'License :: OSI Approved :: MIT License', | ||
'Programming Language :: Python :: 3.6', | ||
'Programming Language :: Python :: 3.7' | ||
], | ||
keywords='quant stock finance fintech big-data zvt ma-analysis trading-platform pandas fundamental-analysis', | ||
packages=find_packages(include=['zvt_coin.*', 'zvt_coin']), | ||
python_requires='>=3.5, <4', | ||
include_package_data=True, | ||
install_requires=requirements, | ||
project_urls={ | ||
'Bug Reports': 'https://github.com/zvtvz/zvt_coin/issues', | ||
'Funding': 'https://github.com/zvtvz/zvt_coin', | ||
'Say Thanks!': 'https://saythanks.io/to/foolcage', | ||
'Source': 'https://github.com/zvtvz/zvt_coin', | ||
}, | ||
long_description_content_type="text/markdown" | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
# -*- coding: utf-8 -*- | ||
|
||
def test_pass(): | ||
pass | ||
# the __all__ is generated | ||
__all__ = ['test_pass'] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
# -*- coding: utf-8 -*- | ||
import functools | ||
|
||
from zvt import init_config | ||
|
||
zvt_coin_config = {} | ||
|
||
int_zvt_coin_config = functools.partial(init_config, pkg_name='zvt_coin', current_config=zvt_coin_config) | ||
|
||
int_zvt_coin_config() | ||
|
||
__all__ = ['int_zvt_coin_config'] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
# -*- coding: utf-8 -*- | ||
|
||
import ccxt | ||
|
||
from zvt_coin import zvt_coin_config | ||
|
||
exchange_cache = {} | ||
|
||
exchange_config = {} | ||
|
||
|
||
def get_coin_exchange(exchange_str, refresh=False) -> ccxt.Exchange: | ||
if not refresh and exchange_cache.get(exchange_str): | ||
return exchange_cache[exchange_str] | ||
|
||
exchange = eval("ccxt.{}()".format(exchange_str)) | ||
if exchange_str in zvt_coin_config: | ||
# 'huobipro': { | ||
# 'proxy': '', | ||
# 'apiKey': '', | ||
# 'secret': '', | ||
# 'password': '', | ||
# 'uid': '' | ||
# } | ||
config = zvt_coin_config[exchange_str] | ||
exchange.apiKey = config.get('apiKey') | ||
exchange.secret = config.get('secret') | ||
exchange.proxies = config.get('proxies') | ||
exchange.uid = config.get('uid') | ||
|
||
exchange_cache[exchange_str] = exchange | ||
return exchange | ||
|
||
|
||
def get_exchange_config(exchange_str): | ||
return zvt_coin_config.get(exchange_str) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
{ | ||
"huobipro": { | ||
"proxies": { | ||
"http": "http://127.0.0.1:1087", | ||
"https": "http://127.0.0.1:1087" | ||
}, | ||
"tick_limit": 2000, | ||
"kdata_limit": 2000, | ||
"safe_sleeping_time": 40, | ||
"support_limit": true, | ||
"support_since": false, | ||
"apiKey": "", | ||
"secret": "", | ||
"password": "", | ||
"uid": "" | ||
}, | ||
"binance": { | ||
"tick_limit": 2000, | ||
"kdata_limit": 2000, | ||
"safe_sleeping_time": 40, | ||
"support_limit": true, | ||
"support_since": true, | ||
"proxies": { | ||
"http": "http://127.0.0.1:1087", | ||
"https": "http://127.0.0.1:1087" | ||
}, | ||
"apiKey": "", | ||
"secret": "", | ||
"password": "", | ||
"uid": "" | ||
} | ||
} |
Oops, something went wrong.