Metadata-Version: 2.4
Name: zsdtdx
Version: 0.1.0
Summary: Unified wrapper around pytdx-style market data APIs.
License-Expression: MIT
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Operating System :: OS Independent
Requires-Python: >=3.10
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: pandas
Requires-Dist: PyYAML
Requires-Dist: six
Requires-Dist: psutil
Dynamic: license-file

﻿# zsdtdx

`zsdtdx` 是一个面向 A 股/期货行情场景的 Python 封装库，基于 pytdx 体系做统一 API、连接池、重试与并行抓取增强，目标是提供更稳定的一致化数据接口。

## 安装

```bash
pip install zsdtdx
```

## 快速开始

```python
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`。
- 你可以按需传入自定义配置路径：

```python
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_client`
- `get_supported_markets`
- `get_stock_code_name`
- `get_all_future_list`
- `get_stock_kline`
- `get_future_kline`
- `get_company_info`
- `get_stock_latest_price`
- `get_future_latest_price`
- `get_runtime_failures`
- `get_runtime_metadata`

## 运行环境与依赖

- Python: `>=3.10`
- 依赖：`pandas`、`PyYAML`、`six`、`psutil`

## 开发文档

以下文档用于开发维护，不作为对外安装说明主文档：

- `HANDOFF.md`
- `PERFORMANCE_REPORT.md`
- `examples/`

## 许可证与来源

- 本项目以 MIT 许可证发布，见 `LICENSE`。
- 本项目基于 `pytdx` 生态进行改写与扩展，归属说明见 `THIRD_PARTY_NOTICES.md`。
