Metadata-Version: 2.4
Name: jcdata
Version: 0.1.2
Summary: Python client for JCDATA market data and factor APIs
Author: JiceQuant
License-Expression: LicenseRef-Proprietary
Project-URL: Homepage, https://jicequant.com/
Project-URL: Documentation, https://jicequant.com/
Project-URL: Repository, https://pypi.org/project/jcdata/
Keywords: finance,quant,market-data,china,a-share
Classifier: Development Status :: 4 - Beta
Classifier: Intended Audience :: Financial and Insurance Industry
Classifier: Intended Audience :: Developers
Classifier: Operating System :: OS Independent
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: Topic :: Office/Business :: Financial :: Investment
Classifier: Typing :: Typed
Requires-Python: >=3.8
Description-Content-Type: text/markdown
Requires-Dist: httpx>=0.24
Requires-Dist: pandas>=1.3
Provides-Extra: dev
Requires-Dist: pytest>=7; extra == "dev"

# jcdata

连接 JCDATA 数据服务，详情可查看官网：[https://jicequant.com/](https://jicequant.com/)

用户注册后即可在个人中心使用一定额度的数据服务

## 安装

```bash
pip install jcdata
```

## 配置

访问令牌任选一种方式提供：

```python
import jcdata

jcdata.login(token="你的访问令牌")
```

或设置环境变量后直接 `jcdata.login()`：

```bash
# Linux / macOS
export JCDATA_TOKEN="你的访问令牌"

# Windows PowerShell
$env:JCDATA_TOKEN="你的访问令牌"
```

也可通过 `JCDATA_BASE_URL` 覆盖默认服务地址（默认为 `https://api.jicequant.com`）。

## 使用

```python
import jcdata

jcdata.login(token="你的访问令牌")
print(jcdata.whoami())

df = jcdata.get_market_data("600000.SH", "2025-01-01", "2025-01-31")
```

## 主要接口

- **行情**：`get_market_data`
- **基础信息**：`get_instrument`、`get_price_limits`、`get_adj_factor`、`get_turn_rate`、`get_trading_status`
- **期货/转债**：`get_settlement`、`get_conv_bond_terms`、`get_future_contract`
- **股票因子**：`get_valuation`、`get_market_value`、`get_finance`
- **其它**：`get_trade_dates`、`get_index_constituents`、`get_option_bars`、`get_option_info`、`get_sectors`（板块成分快照）

代码格式为 Wind 风格，如 `600000.SH`。

## 使用限制

- **请求频率**：短时请求过密时，库会自动等待后重试，单次调用可能略慢。
- **每周数据量**：按返回的非空单元格累计，每周一 0:00（北京时间）重置；用尽时抛出 `CellQuotaExceededError`。
