Unified wrapper around pytdx-style market data APIs.
Project description
zsdtdx
zsdtdx 是一个面向 A 股/期货行情场景的 Python 封装库,基于 pytdx 体系做统一 API、连接池、重试与并行抓取增强,目标是提供更稳定的一致化数据接口。
安装
pip install zsdtdx
快速开始
import queue as py_queue
from zsdtdx import StockKlineTask, get_client, get_stock_kline, get_stock_latest_price
with get_client() as client:
prices = get_stock_latest_price(["600000", "000001"])
q = py_queue.Queue()
payloads = get_stock_kline(
task=[
StockKlineTask(code="600000", freq="d", start_time="2026-02-01", end_time="2026-02-14"),
{"code": "000001", "freq": "60", "start_time": "2026-02-01", "end_time": "2026-02-14"},
],
queue=q,
mode="sync",
)
print(prices)
print(len(payloads))
配置说明
- 默认情况下,
get_client()会读取包内置的config.yaml。 - 你可以按需传入自定义配置路径:
from zsdtdx import get_client
with get_client(config_path=r"D:\\configs\\zsdtdx.yaml") as client:
...
- 时间窗口按左闭右开
[start_time, end_time)解释。 get_stock_kline只接受task列表输入(StockKlineTask或dict)。
API 概览
get_clientget_supported_marketsget_stock_code_nameget_all_future_listget_stock_klineget_future_klineget_company_infoget_stock_latest_priceget_future_latest_priceget_runtime_failuresget_runtime_metadata
运行环境与依赖
- Python:
>=3.10 - 依赖:
pandas、PyYAML、six、psutil
开发文档
以下文档用于开发维护,不作为对外安装说明主文档:
HANDOFF.mdPERFORMANCE_REPORT.mdexamples/
许可证与来源
- 本项目以 MIT 许可证发布,见
LICENSE。 - 本项目基于
pytdx生态进行改写与扩展,归属说明见THIRD_PARTY_NOTICES.md。
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
zsdtdx-0.1.0.tar.gz
(77.2 kB
view details)
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
zsdtdx-0.1.0-py3-none-any.whl
(113.7 kB
view details)
File details
Details for the file zsdtdx-0.1.0.tar.gz.
File metadata
- Download URL: zsdtdx-0.1.0.tar.gz
- Upload date:
- Size: 77.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.10.0
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
d31ab9b7561350be578b5d7159e314c1f7a1eb231248886ea95ca3d1984d7929
|
|
| MD5 |
5f5c3f38ed0c7605537d826280a2de4c
|
|
| BLAKE2b-256 |
b2b86a9d5bd3b1cd0854c14e4666c9ee9ffed39a05d464ac89fbce467a1c6e3c
|
File details
Details for the file zsdtdx-0.1.0-py3-none-any.whl.
File metadata
- Download URL: zsdtdx-0.1.0-py3-none-any.whl
- Upload date:
- Size: 113.7 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.10.0
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
a68bcc8a931767866777434cf703e57a7f143a3f5c9b462c00bd9a0844017cb7
|
|
| MD5 |
c8bc04ac6389ed3a71c6b89741b2ed84
|
|
| BLAKE2b-256 |
60619f48f7f2cac5313d170586d7571104bd243e781ebac38d52bf224b9d1c50
|