Metadata-Version: 2.4
Name: jcdata
Version: 0.1.5
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
Requires-Dist: pyarrow>=14
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("你的访问令牌")
```

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

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

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

服务地址默认为 `https://api.jicequant.com`（可在安装包内 `config.py` 的 `BASE_URL` 修改）。

## 使用

```python
import jcdata

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

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

## 主要接口

- **行情**：`get_market_data`
- **基础信息**：`get_instrument`、`get_adj_factor`
- **期货/转债**：`get_settlement`、`get_future_contract`（转债条款已并入 `get_instrument`）
- **股票因子**：`get_valuation`、`get_market_value`、`get_finance`
- **其它**：`get_trade_dates`、`get_all_sectors`、`get_stock_list_by_sector`、`get_option_bars`、`get_option_info`

代码格式为 **`代码.交易所`**，如 `600000.SH`。

## 使用限制

- **请求频率**：短时请求过密时，库会自动等待后重试。
- **每周数据量**：有用量上限；用尽时抛出 `CellQuotaExceededError`。
- **大批量代码**：一次传入大量代码时，客户端会自动分批请求并合并结果。
