Skip to main content

VeighNa框架的TuShare数据服务接口

说明

基于tushare模块的1.4.21版本开发,支持以下中国金融市场的K线数据:

  • 期货:
    • CFFEX:中国金融期货交易所
    • SHFE:上海期货交易所
    • DCE:大连商品交易所
    • CZCE:郑州商品交易所
    • INE:上海国际能源交易中心
  • 股票:
    • SSE:上海证券交易所
    • SZSE:深圳证券交易所
    • BSE:北京证券交易所

注意:需要使用相应的数据服务权限,可以通过该页面注册使用。

数据使用事项

tushare数据源期货数据中,第一条夜盘k线数据是集合竞价数据,用户可以根据自己需求进行过滤或者合并。

安装

安装环境推荐基于4.0.0版本以上的【VeighNa Studio】。

直接使用pip命令:

pip install vnpy_tushare

或者下载源代码后,解压后在cmd中运行:

pip install .

使用

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

名称 含义 必填 举例
datafeed.name 名称 tushare
datafeed.username 用户名 token
datafeed.password 密码 c3a110417f08f26d2c221edc0c50d4a8a5001502eea89cf5

单元测试

单元测试代码目录为./tests/test_*.py

# 指定文件执行单元测试
python -m unittest tests\test_your_file_name.py

# 全量执行
python -m unittest

Release files for vnpy_tushare 1.4.21.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for vnpy_tushare 1.4.21.0
File Size Uploaded
vnpy_tushare-1.4.21.0.tar.gz 6.9 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for vnpy_tushare 1.4.21.0
File Interpreter ABI Platform
vnpy_tushare-1.4.21.0-py3-none-any.whl Python 3 none any Details

Total release size: 13.7 kB

Release files / vnpy_tushare-1.4.21.0.tar.gz

Download URL vnpy_tushare-1.4.21.0.tar.gz
Size 6.9 kB
Tags Source
SHA-256 checksum
How to use checksums
d09b8c141777f0481bd069678db76ab8484ac8c892411e21f5146bee1513bf0d
BLAKE2b-256 checksum
How to use checksums
afdbd9e57ddf103595134a3e9751f31cfcf7cd10923c570a393702964317b6ed
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.6.11

Release files / vnpy_tushare-1.4.21.0-py3-none-any.whl

Download URL vnpy_tushare-1.4.21.0-py3-none-any.whl
Size 6.8 kB
Tags Python 3
SHA-256 checksum
How to use checksums
3e947e6a31a52ce5bcba9a311a83240f22b77ab729b4d2a7d015a7562d3f42f0
BLAKE2b-256 checksum
How to use checksums
b913d4700fe793c7cdf71d3c6d9960d97e9e210ea5e75c3f4e15dc28f0cbbb5c
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.6.11

Release history Release notifications | RSS feed

This release

1.4.21.0 This release

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page