Skip to main content

通达信数据读取接口.

Project description

https://badge.fury.io/py/mootdx.svg https://img.shields.io/travis/bopo/mootdx.svg Documentation Status Updates

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

版本更新(倒序)

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

运行环境

  • 操作系统: Windows / MacOS / Linux 都可以运行.

  • Python: 3.5 以及以上版本, 不支持 python2.

  • 依赖库: PyTdx>=1.67

安装方法

# PIP 自动安装方法
pip install mootdx

# 手动下载源码安装
git clone --depth=1 https://github.com/mootdx/mootdx.git
cd mootdx
python setup.py install

使用说明

命令行工具

mootdx --help

Usage: mootdx [OPTIONS] COMMAND [ARGS]...

Options:
  -v, --verbose
  --help         Show this message and exit.

Commands:
  affair  财务文件下载&解析.
  bestip  测试行情服务器.
  quotes  读取股票在线行情数据.
  reader  读取股票本地行情数据.

使用最快的服务器

# -w 参数是写入配置文件
mootdx bestip -w -v

通达信离线数据读取

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')

加微信交流

docs/img/IMG_2851.JPG

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.8.9.tar.gz (32.2 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.8.9-py2.py3-none-any.whl (36.5 kB view details)

Uploaded Python 2Python 3

File details

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

File metadata

  • Download URL: mootdx-0.8.9.tar.gz
  • Upload date:
  • Size: 32.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.7.1 importlib_metadata/4.10.1 pkginfo/1.8.2 requests/2.27.1 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.8.12

File hashes

Hashes for mootdx-0.8.9.tar.gz
Algorithm Hash digest
SHA256 6302f68d410254d516b44cd8d2ccf47990351830ed5b5bdb2b4a6feeb5df3290
MD5 838a2e9abf8b6efbcb4fb65ea0d23ef3
BLAKE2b-256 0b6103b0aa400ebac2f1ae561245ff3474cb94bf8a75cc02c9660866ce2d0967

See more details on using hashes here.

File details

Details for the file mootdx-0.8.9-py2.py3-none-any.whl.

File metadata

  • Download URL: mootdx-0.8.9-py2.py3-none-any.whl
  • Upload date:
  • Size: 36.5 kB
  • Tags: Python 2, Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.7.1 importlib_metadata/4.10.1 pkginfo/1.8.2 requests/2.27.1 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.8.12

File hashes

Hashes for mootdx-0.8.9-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 6fd845d6b01de364e52972e87f5e19961a627f7345effbc655050367fd4a89bc
MD5 653727624de95b062a5823a40c44b322
BLAKE2b-256 7e699a776922565c31c0c8b10e0eaa6d31b2fc99579381e33d9ba4eaec348054

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