Metadata-Version: 2.4
Name: finclaw-data-sdk
Version: 0.2.1
Summary: A 股量化数据 HTTP 客户端（QuantClient），只依赖 pandas
Author-email: dekeky <dekeky@163.com>
Project-URL: Homepage, https://github.com/chocochato0713/finclaw-data
Project-URL: Repository, https://github.com/chocochato0713/finclaw-data
Keywords: finclaw,ashare,quant,kline,clickhouse
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
Classifier: Programming Language :: Python :: 3.14
Classifier: Operating System :: OS Independent
Classifier: Topic :: Office/Business :: Financial
Classifier: Intended Audience :: Developers
Classifier: Intended Audience :: Financial and Insurance Industry
Requires-Python: >=3.10
Description-Content-Type: text/markdown
Requires-Dist: pandas>=2.0

# finclaw-data-sdk

A 股量化数据 HTTP 客户端。安装后 `from finclaw_data_sdk import QuantClient`，只依赖 pandas，不含拉取与 ClickHouse 业务代码。

```bash
pip install finclaw-data-sdk
```

本地开发也可 `pip install -e sdk`。

```python
from finclaw_data_sdk import QuantClient, cols

c = QuantClient("http://127.0.0.1:8000")  # 若启用鉴权：username="root", password="..."
stocks = c.stocks(list_status="L", q="茅台")
bars = c.daily_bar(code="600519.SH", start="20240801", end="20240805")
factor = c.stock_factor_pro(code="600519.SH", start="20240801", end="20240805", fields=cols.stock_factor_pro.PE_TTM)
income = c.income(code="600519.SH", start="20230101", end="20231231")
bs = c.balancesheet(code="600519.SH", limit=8)
cf = c.cashflow(code="600519.SH", limit=8)
fina = c.fina_indicator(code="600519.SH", fields=cols.fina_indicator.ROE)
buyback = c.repurchase(code="600519.SH", start="20240101", end="20241231")
indexes = c.index_basic(market="CSI", q="沪深300")
univ = c.core_indexes()
hs300 = c.index_daily(code="000300.SH", start="20240801", end="20240805")  # 日线入库 000300.SH
members = c.constituent_indexes()
weights = c.index_weight(index_code="000300.SH")  # 最新月度成分；入库代码 399300.SZ
st = c.stock_st()  # 最新交易日 ST 名单
```

证券代码列是 `code`（`600519.SH`）。也可传 6 位数字或 `sh.600519`，服务端会展开。日期参数为 `YYYYMMDD` 或 `YYYY-MM-DD`，区间两端包含。

`kline()` 是 `daily_bar()` 的别名（未复权）。复权价和估值因子用 `stock_factor_pro()`（`close_qfq` / `pe_ttm` 等）。`fina()` 是 `fina_indicator()` 的别名。`indexes()` 是 `index_basic()` 的别名。`index_daily_indexes()` 是 `core_indexes()` 的别名。`index_constituents()` 是 `index_weight()` 的别名（月度快照；只传 `end` 为 as-of）。`stock_st()` 是 ST 日度快照（不传日期为最新一日）。

需先启动本仓库的 `python -m finclaw_data serve`。
