vnpy-mysql


Namevnpy-mysql JSON
Version 1.0.2 PyPI version JSON
download
home_pagehttps://www.vnpy.com
SummaryMySQL database adapter for VeighNa quant trading framework.
upload_time2022-08-06 07:08:10
maintainer
docs_urlNone
authorXiaoyou Chen
requires_python
licenseMIT
keywords quant quantitative investment trading algotrading
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # VeighNa框架的MySQL数据库接口

<p align="center">
  <img src ="https://vnpy.oss-cn-shanghai.aliyuncs.com/vnpy-logo.png"/>
</p>

<p align="center">
    <img src ="https://img.shields.io/badge/version-1.0.2-blueviolet.svg"/>
    <img src ="https://img.shields.io/badge/platform-windows|linux|macos-yellow.svg"/>
    <img src ="https://img.shields.io/badge/python-3.7|3.8|3.9|3.10-blue.svg" />
</p>

## 说明

基于peewee开发的MySQL数据库接口。

## 使用

### 全局配置

在VeighNa中使用MySQL时,需要在全局配置中填写以下字段信息:

|名称|含义|必填|举例|
|---------|----|---|---|
|database.name|名称|是|mysql|
|database.host|地址|是|localhost|
|database.port|端口|是|3306|
|database.database|实例|是|vnpy|
|database.user|用户名|是|root|
|database.password|密码|是|123456|

### 创建实例(Schema)

VeighNa不会主动为MySQL数据库创建实例,所以使用前请确保database.database字段中填写的的数据库实例已经创建了。

若实例尚未创建,可以使用【MySQL Workbench】客户端的【new_schema】进行操作。


### 字符串大小写敏感支持

由于peewee的建表功能限制,默认情况下在保存合约代码的【symbol】字段时,无法区分字符串大小写。如果影响使用,可按照以下方式手动修改MySQL数据表来解决:

```
# 用MySQL命令行工具连接数据库

# 选择数据实例
use vnpy;

# 修改四张表symbol字段的BINARY属性
ALTER TABLE `dbbaroverview` MODIFY COLUMN `symbol` VARCHAR(45) BINARY;

ALTER TABLE `dbtickoverview` MODIFY COLUMN `symbol` VARCHAR(45) BINARY;

ALTER TABLE `dbbardata` MODIFY COLUMN `symbol` VARCHAR(45) BINARY;

ALTER TABLE `dbtickdata` MODIFY COLUMN `symbol` VARCHAR(45) BINARY;
```



            

Raw data

            {
    "_id": null,
    "home_page": "https://www.vnpy.com",
    "name": "vnpy-mysql",
    "maintainer": "",
    "docs_url": null,
    "requires_python": "",
    "maintainer_email": "",
    "keywords": "quant,quantitative,investment,trading,algotrading",
    "author": "Xiaoyou Chen",
    "author_email": "xiaoyou.chen@mail.vnpy.com",
    "download_url": "https://files.pythonhosted.org/packages/b9/2c/c36553f7fd83c78212e0d444c613a73c2da8b8961a4d2713f7c37cb50e98/vnpy_mysql-1.0.2.tar.gz",
    "platform": null,
    "description": "# VeighNa\u6846\u67b6\u7684MySQL\u6570\u636e\u5e93\u63a5\u53e3\n\n<p align=\"center\">\n  <img src =\"https://vnpy.oss-cn-shanghai.aliyuncs.com/vnpy-logo.png\"/>\n</p>\n\n<p align=\"center\">\n    <img src =\"https://img.shields.io/badge/version-1.0.2-blueviolet.svg\"/>\n    <img src =\"https://img.shields.io/badge/platform-windows|linux|macos-yellow.svg\"/>\n    <img src =\"https://img.shields.io/badge/python-3.7|3.8|3.9|3.10-blue.svg\" />\n</p>\n\n## \u8bf4\u660e\n\n\u57fa\u4e8epeewee\u5f00\u53d1\u7684MySQL\u6570\u636e\u5e93\u63a5\u53e3\u3002\n\n## \u4f7f\u7528\n\n### \u5168\u5c40\u914d\u7f6e\n\n\u5728VeighNa\u4e2d\u4f7f\u7528MySQL\u65f6\uff0c\u9700\u8981\u5728\u5168\u5c40\u914d\u7f6e\u4e2d\u586b\u5199\u4ee5\u4e0b\u5b57\u6bb5\u4fe1\u606f\uff1a\n\n|\u540d\u79f0|\u542b\u4e49|\u5fc5\u586b|\u4e3e\u4f8b|\n|---------|----|---|---|\n|database.name|\u540d\u79f0|\u662f|mysql|\n|database.host|\u5730\u5740|\u662f|localhost|\n|database.port|\u7aef\u53e3|\u662f|3306|\n|database.database|\u5b9e\u4f8b|\u662f|vnpy|\n|database.user|\u7528\u6237\u540d|\u662f|root|\n|database.password|\u5bc6\u7801|\u662f|123456|\n\n### \u521b\u5efa\u5b9e\u4f8b\uff08Schema)\n\nVeighNa\u4e0d\u4f1a\u4e3b\u52a8\u4e3aMySQL\u6570\u636e\u5e93\u521b\u5efa\u5b9e\u4f8b\uff0c\u6240\u4ee5\u4f7f\u7528\u524d\u8bf7\u786e\u4fdddatabase.database\u5b57\u6bb5\u4e2d\u586b\u5199\u7684\u7684\u6570\u636e\u5e93\u5b9e\u4f8b\u5df2\u7ecf\u521b\u5efa\u4e86\u3002\n\n\u82e5\u5b9e\u4f8b\u5c1a\u672a\u521b\u5efa\uff0c\u53ef\u4ee5\u4f7f\u7528\u3010MySQL Workbench\u3011\u5ba2\u6237\u7aef\u7684\u3010new_schema\u3011\u8fdb\u884c\u64cd\u4f5c\u3002\n\n\n### \u5b57\u7b26\u4e32\u5927\u5c0f\u5199\u654f\u611f\u652f\u6301\n\n\u7531\u4e8epeewee\u7684\u5efa\u8868\u529f\u80fd\u9650\u5236\uff0c\u9ed8\u8ba4\u60c5\u51b5\u4e0b\u5728\u4fdd\u5b58\u5408\u7ea6\u4ee3\u7801\u7684\u3010symbol\u3011\u5b57\u6bb5\u65f6\uff0c\u65e0\u6cd5\u533a\u5206\u5b57\u7b26\u4e32\u5927\u5c0f\u5199\u3002\u5982\u679c\u5f71\u54cd\u4f7f\u7528\uff0c\u53ef\u6309\u7167\u4ee5\u4e0b\u65b9\u5f0f\u624b\u52a8\u4fee\u6539MySQL\u6570\u636e\u8868\u6765\u89e3\u51b3\uff1a\n\n```\n# \u7528MySQL\u547d\u4ee4\u884c\u5de5\u5177\u8fde\u63a5\u6570\u636e\u5e93\n\n# \u9009\u62e9\u6570\u636e\u5b9e\u4f8b\nuse vnpy;\n\n# \u4fee\u6539\u56db\u5f20\u8868symbol\u5b57\u6bb5\u7684BINARY\u5c5e\u6027\nALTER TABLE `dbbaroverview` MODIFY COLUMN `symbol` VARCHAR(45) BINARY;\n\nALTER TABLE `dbtickoverview` MODIFY COLUMN `symbol` VARCHAR(45) BINARY;\n\nALTER TABLE `dbbardata` MODIFY COLUMN `symbol` VARCHAR(45) BINARY;\n\nALTER TABLE `dbtickdata` MODIFY COLUMN `symbol` VARCHAR(45) BINARY;\n```\n\n\n",
    "bugtrack_url": null,
    "license": "MIT",
    "summary": "MySQL database adapter for VeighNa quant trading framework.",
    "version": "1.0.2",
    "split_keywords": [
        "quant",
        "quantitative",
        "investment",
        "trading",
        "algotrading"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "md5": "7a2c4fcc1cdfa15d2f81f4c02989bced",
                "sha256": "15e5d05d9212f328094c65cb5de8f9ec58c752c061c04535f86414c622365fb3"
            },
            "downloads": -1,
            "filename": "vnpy_mysql-1.0.2-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "7a2c4fcc1cdfa15d2f81f4c02989bced",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": null,
            "size": 7241,
            "upload_time": "2022-08-06T07:08:08",
            "upload_time_iso_8601": "2022-08-06T07:08:08.390134Z",
            "url": "https://files.pythonhosted.org/packages/b0/c2/d76e8fc355c80c5b477ee97c8c6d27fdcccf6912857f44e1d2c3bd179d2d/vnpy_mysql-1.0.2-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "md5": "2363482a5ba52cacf00559e44485bd91",
                "sha256": "61b3597537e66777371bc2bd4f75c1428dff0f1a55a1fdab09751c17f12a21ce"
            },
            "downloads": -1,
            "filename": "vnpy_mysql-1.0.2.tar.gz",
            "has_sig": false,
            "md5_digest": "2363482a5ba52cacf00559e44485bd91",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": null,
            "size": 7462,
            "upload_time": "2022-08-06T07:08:10",
            "upload_time_iso_8601": "2022-08-06T07:08:10.452923Z",
            "url": "https://files.pythonhosted.org/packages/b9/2c/c36553f7fd83c78212e0d444c613a73c2da8b8961a4d2713f7c37cb50e98/vnpy_mysql-1.0.2.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2022-08-06 07:08:10",
    "github": false,
    "gitlab": false,
    "bitbucket": false,
    "lcname": "vnpy-mysql"
}
        
Elapsed time: 0.47496s