Metadata-Version: 2.4
Name: tickhub
Version: 0.1.0
Summary: A Python SDK for real-time stock and futures market data
Requires-Python: >=3.7
Description-Content-Type: text/markdown
Requires-Dist: pandas>=1.3.0
Requires-Dist: requests>=2.25.0
Provides-Extra: dev
Requires-Dist: pytest>=7.0.0; extra == "dev"
Requires-Dist: pytest-cov>=4.0.0; extra == "dev"
Requires-Dist: black>=22.0.0; extra == "dev"
Requires-Dist: ruff>=0.1.0; extra == "dev"
Requires-Dist: twine>=4.0.0; extra == "dev"
Requires-Dist: build>=0.8.0; extra == "dev"

# TickHub Python SDK

面向股票、期货等金融数据用户提供实时市场股票信息的 Python SDK


## 如何使用

```python
import tickhub

# 创建客户端（传入你的 API Token）
pro = tickhub.pro("your-tickhub-token")

# 获取日线数据
df = pro.get_daily(
    ts_code='000001.SZ',
    start_date='20240101',
    end_date='20240301'
)
print(df)

# 获取实时行情
df = pro.rt_k(ts_code='000001.SZ')
print(df)
```

## 开发

### 环境要求
- Python 3.7+

### 开发依赖

| 工具 | 用途 |
|------|------|
| pytest | 测试框架 |
| pytest-cov | 测试覆盖率 |
| black | 代码格式化 |
| ruff | 代码检查 |
| build | 构建包 |
| twine | 发布到 PyPI |

### 本地开发

```bash
# 克隆仓库
git clone <repository-url>
cd tickhub

# 安装开发依赖
pip install -e ".[dev]"
# 或者手动安装
pip install -e .
pip install pytest pytest-cov black ruff twine build

# 设置 API Token（复制 .env.example 为 .env 并填入真实 token）
cp .env.example .env
# 编辑 .env 文件，将 your-api-token 替换为你的真实 token

# 运行测试
pytest

# 运行示例（需要 token）
python main.py

# 格式化代码
black tickhub/ tests/

# 代码检查
ruff check tickhub/ tests/

# 构建发布
python -m build
```

## 文档

- [DESIGN.md](DESIGN.md) - 设计文档
- [CLAUDE.md](CLAUDE.md) - 开发指南

## License

MIT
