Skip to content

Commit 3464330

Browse files
committed
剥离vnpy_mysql
1 parent 3f29fae commit 3464330

File tree

7 files changed

+531
-5
lines changed

7 files changed

+531
-5
lines changed

.flake8

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
[flake8]
2+
exclude = venv,build,__pycache__,__init__.py,ib,talib,uic
3+
ignore =
4+
E501 line too long, fixed by black
5+
W503 line break before binary operator

LICENSE

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
MIT License
1+
The MIT License (MIT)
22

3-
Copyright (c) 2021 vn.py
3+
Copyright (c) 2015-present, Xiaoyou Chen
44

55
Permission is hereby granted, free of charge, to any person obtaining a copy
66
of this software and associated documentation files (the "Software"), to deal
@@ -18,4 +18,4 @@ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
1818
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
1919
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
2020
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21-
SOFTWARE.
21+
SOFTWARE.

README.md

Lines changed: 41 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,41 @@
1-
# vnpy_mysql
2-
vn.py框架的MySQL数据库接口
1+
# vn.py框架的MySQL数据库接口
2+
3+
<p align="center">
4+
<img src ="https://vnpy.oss-cn-shanghai.aliyuncs.com/vnpy-logo.png"/>
5+
</p>
6+
7+
<p align="center">
8+
<img src ="https://img.shields.io/badge/version-1.0.0-blueviolet.svg"/>
9+
<img src ="https://img.shields.io/badge/platform-windows|linux|macos-yellow.svg"/>
10+
<img src ="https://img.shields.io/badge/python-3.7-blue.svg" />
11+
</p>
12+
13+
## 说明
14+
15+
基于peewee开发的Mysql数据库接口。
16+
17+
由于peewee对mysql的限制,目前存在以下问题时。如不影响使用可以忽略,当影响使用时,可按照以下方式手动修改mysql数据库表来解决。
18+
19+
- 保存tick数据时,保存数据的时间精确度只能精确到秒
20+
21+
```
22+
# 首先进入mysql数据库
23+
# 选择vnpy数据库
24+
use vnpy;
25+
# 修改dbtickdata表datetime列的数据格式
26+
ALTER TABLE `dbtickdata` MODIFY COLUMN `datetime` DATETIME(3);
27+
```
28+
29+
- 部分系统对大小写不明敏感
30+
31+
```
32+
# 首先进入mysql数据库
33+
# 选择vnpy数据库
34+
use vnpy;
35+
# 修改三张表symbol字段BINARY属性
36+
ALTER TABLE `dbbaroverview` MODIFY COLUMN `symbol` VARCHAR(45) BINARY;
37+
38+
ALTER TABLE `dbbardata` MODIFY COLUMN `symbol` VARCHAR(45) BINARY;
39+
40+
ALTER TABLE `dbtickdata` MODIFY COLUMN `symbol` VARCHAR(45) BINARY;
41+
```

setup.cfg

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
[metadata]
2+
name = vnpy_mysql
3+
version = 1.0.0
4+
url = https://www.vnpy.com
5+
license = MIT
6+
author = Xiaoyou Chen
7+
author_email = [email protected]
8+
description = Mysql database manager for vn.py quant trading framework.
9+
long_description = file: README.md
10+
long_description_content_type = text/markdown
11+
keywords =
12+
quant
13+
quantitative
14+
investment
15+
trading
16+
algotrading
17+
classifiers =
18+
Development Status :: 5 - Production/Stable
19+
Operating System :: OS Independent
20+
Programming Language :: Python :: 3
21+
Programming Language :: Python :: 3.7
22+
Programming Language :: Python :: 3.8
23+
Programming Language :: Python :: 3.9
24+
Programming Language :: Python :: 3.10
25+
Topic :: Office/Business :: Financial :: Investment
26+
Programming Language :: Python :: Implementation :: CPython
27+
License :: OSI Approved :: MIT License
28+
Natural Language :: Chinese (Simplified)
29+
30+
[options]
31+
packages = find:
32+
zip_safe = False
33+
install_requires =
34+
peewee

setup.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
from setuptools import setup
2+
3+
4+
setup()

vnpy_mysql/__init__.py

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
# The MIT License (MIT)
2+
#
3+
# Copyright (c) 2015-present, Xiaoyou Chen
4+
#
5+
# Permission is hereby granted, free of charge, to any person obtaining a copy
6+
# of this software and associated documentation files (the "Software"), to deal
7+
# in the Software without restriction, including without limitation the rights
8+
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9+
# copies of the Software, and to permit persons to whom the Software is
10+
# furnished to do so, subject to the following conditions:
11+
#
12+
# The above copyright notice and this permission notice shall be included in all
13+
# copies or substantial portions of the Software.
14+
#
15+
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16+
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17+
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18+
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19+
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20+
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21+
# SOFTWARE.
22+
23+
24+
import importlib_metadata
25+
26+
from .mysql_database import MysqlDatabase as Database
27+
28+
try:
29+
__version__ = importlib_metadata.version("vnpy_mysql")
30+
except importlib_metadata.PackageNotFoundError:
31+
__version__ = "dev"

0 commit comments

Comments
 (0)