Skip to main content

通达信数据读取接口.

Project description

通达信数据读取接口

image image Documentation Status Updates

如果喜欢本项目可以在右上角给颗⭐!你的支持是我最大的动力😎!

郑重声明: 本项目只作学习交流, 不得用于任何商业目的.

版本更新(倒序)

版本更新日志: https://mootdx.readthedocs.io/zh_CN/latest/history/

运行环境

  • 操作系统: Windows / MacOS / Linux 都可以运行.
  • Python: 3.8 以及以上版本.

安装方法

新手建议使用 pip install -U 'mootdx[all]' 安装

PIP 安装方法

# 包含核心依赖安装
pip install 'mootdx'

# 包含命令行依赖安装, 如果使用命令行工具可以使用这种方式安装
pip install 'mootdx[cli]'

# 包含所有扩展依赖安装, 如果不清楚各种依赖关系就用这个命令
pip install 'mootdx[all]'

升级安装

pip install -U tdxpy mootdx

如果不清楚各种依赖关系就用这个命令 pip install -U 'mootdx[all]'

使用说明

以下只列举一些例子, 详细说明请查看在线文档: https://www.mootdx.com

通达信离线数据读取

from mootdx.reader import Reader

# market 参数 std 为标准市场(就是股票), ext 为扩展市场(期货,黄金等)
# tdxdir 是通达信的数据目录, 根据自己的情况修改

reader = Reader.factory(market='std', tdxdir='C:/new_tdx')

# 读取日线数据
reader.daily(symbol='600036')

# 读取分钟数据
reader.minute(symbol='600036')

# 读取时间线数据
reader.fzline(symbol='600036')

通达信线上行情读取

from mootdx.quotes import Quotes

# 标准市场
client = Quotes.factory(market='std', multithread=True, heartbeat=True)

# k 线数据
client.bars(symbol='600036', frequency=9, offset=10)

# 指数
client.index(symbol='000001', frequency=9)

# 分钟
client.minute(symbol='000001')

通达信财务数据读取

from mootdx.affair import Affair

# 远程文件列表
files = Affair.files()

# 下载单个
Affair.fetch(downdir='tmp', filename='gpcw19960630.zip')

# 下载全部
Affair.parse(downdir='tmp')

加微信交流

常见问题

M1 mac 系统PyMiniRacer不能使用,访问: https://github.com/sqreen/PyMiniRacer/issues/143

Stargazers over time

Stargazers over time

Project details


Release history Release notifications | RSS feed

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

mootdx-0.11.2.tar.gz (41.8 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

mootdx-0.11.2-py3-none-any.whl (50.0 kB view details)

Uploaded Python 3

File details

Details for the file mootdx-0.11.2.tar.gz.

File metadata

  • Download URL: mootdx-0.11.2.tar.gz
  • Upload date:
  • Size: 41.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.5.1 CPython/3.10.9 Darwin/23.1.0

File hashes

Hashes for mootdx-0.11.2.tar.gz
Algorithm Hash digest
SHA256 32a2d2ef7e279f92ef3e82e48acfd1444cad35254cc4fea29c6a83c0d23404af
MD5 ed4c07ba9cce2f8f62fe82073617b04b
BLAKE2b-256 aba8897e4b8c82da32c9650853f6dfff63537047cfdbdd2311547268ab455b11

See more details on using hashes here.

File details

Details for the file mootdx-0.11.2-py3-none-any.whl.

File metadata

  • Download URL: mootdx-0.11.2-py3-none-any.whl
  • Upload date:
  • Size: 50.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.5.1 CPython/3.10.9 Darwin/23.1.0

File hashes

Hashes for mootdx-0.11.2-py3-none-any.whl
Algorithm Hash digest
SHA256 2f4478aaefb0fbabf525a1f41e5bdbdbb42cf8e43aa1f440b900ecf0c0bd05e0
MD5 568742b6aa97c880d6831f6d28da8fb3
BLAKE2b-256 0b52aeb755f7b4610b2004b4461e2b2ce5fdfa8e8e781518b7e008d9aac29140

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page