Metadata-Version: 2.4
Name: alphakit-sdk
Version: 0.2.7
Summary: AlphaKit — 简洁的金融数据 API 工具包
Author: AlphaKit Team
License: MIT
Project-URL: Homepage, https://github.com/yourusername/alphakit
Keywords: finance,data,api,quant,alpha
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.8
Classifier: Programming Language :: Python :: 3.9
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: License :: OSI Approved :: MIT License
Classifier: Intended Audience :: Financial and Insurance Industry
Classifier: Topic :: Office/Business :: Financial
Requires-Python: >=3.8
Description-Content-Type: text/markdown
Requires-Dist: requests>=2.28.0
Requires-Dist: pandas>=1.3.0

# AlphaKit SDK

简洁的 A 股市场数据 API 工具包。仅供个人学习使用。

## 安装

```bash
pip install alphakit-sdk
```

## 快速开始

```python
import alphakit as ak

ak.set_token('your_token_here')
api = ak.AlphaKit()

# 默认获取最近一年日线
df = api.daily(ts_code='000001.SZ')
print(df)
```

## 客户端初始化

```python
import alphakit as ak

# 全局 token
ak.set_token('your_token_here')
api = ak.AlphaKit()

# 实例化时传入
api = ak.AlphaKit(token='your_token_here')
```

## API 接口

### 股票

```python
# 股票列表
api.stock_basic()
api.stock_basic(ts_code='000001.SZ')
```

### 同花顺板块（v0.2.6 新增）

```python
api.ths_index()                                         # 板块清单（~1700）
api.ths_daily(trade_date='20260618')                    # 板块日线
api.ths_member(ts_code='883300.TI')                     # 板块成分
```

更多接口见仓库文档。

## 错误码

| 错误码 | 含义 | 处理 |
|---|---|---|
| 1001 | Token 无效/过期 | 检查 token |
| 1002 | 等级无权访问 | 升级等级 |
| 1003 | IP 限制 | 检查 IP 绑定 |
| 1004 | 触发限频 | 降低请求频率 |
| 1005 | 当日配额用尽 | 等次日或提升配额 |
| 1006 | 参数错误 | 检查参数 |
| 1500 | 服务器错误 | 稍后重试 |
| 9999 | 网络失败 | 检查网络 |
