sagax-data
SAGAX 数据平台 Python SDK。与 Data API 同构,返回 pandas DataFrame(Choice 手感)。
鉴权沿用 SAGAX 平台 API Key(HMAC-SHA256)。Key 由调用方传入,本包不含任何凭据。
安装
pip install sagax-data
国内镜像同步可能有延迟,可指定官方源:
pip install -i https://pypi.org/simple/ sagax-data
快速开始
显式 Client(推荐:多 key / 多环境可并存,线程安全):
from sagax_data import Client
cli = Client(api_key="sagax_ak_...", secret_key="sagax_sk_...")
df = cli.csd("600519.SH", "CLOSE_QFQ,FIN_ROE", start="20250101", end="20260826")
df = cli.table("quote_stock_daily", codes="600519.SH", start="20260101", end="20260826")
模块级快捷方式(单 key):
import sagax_data as sd
sd.init(api_key="sagax_ak_...", secret_key="sagax_sk_...")
df = sd.csd("600519.SH", "CLOSE_QFQ", start="20250101", end="20260826")
方法
| 方法 | 说明 |
|---|---|
csd(codes, indicators, start, end) |
序列。宽表:index=date,columns=(code, indicator) |
css(codes, indicators, date) |
截面。财务为 PIT 口径 |
ctr(report, start=None, end=None, codes=None) |
专题报表 |
edb(ids, start=None, end=None) |
宏观序列 |
info(codes=None, start=None, end=None, limit=100, full=False) |
资讯 |
table(name, codes=None, start=None, end=None, limit=10000) |
显式整表查询 |
indicators() |
指标字典 |
codes / indicators 接受逗号分隔字符串或 list。请求失败抛 sagax_data.SagaxDataError。
默认 base_url=https://api.sagax.cn/data/v1。完整文档:https://www.sagax.cn/data/v1/sdk_doc/
Metadata
Release files for sagax-data 1.1.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| sagax_data-1.1.0.tar.gz | 4.8 kB | Without provenance | Details for sagax_data-1.1.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| sagax_data-1.1.0-py3-none-any.whl | Python 3 | none | any | Details for sagax_data-1.1.0-py3-none-any.whl |
Total release size: 10.5 kB
Release files / sagax_data-1.1.0.tar.gz
| Download URL | sagax_data-1.1.0.tar.gz |
|---|---|
| Size | 4.8 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
1e07f098996ac574a1a4218dafc5727aa3381e1c16aac8ac98d34ec8954bb573
|
|
BLAKE2b-256 checksum How to use checksums |
2fed430ac64bd21416cc72ddf749715527083702096ad380615ffb44e1b3b94f
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.11.14
|
Release files / sagax_data-1.1.0-py3-none-any.whl
| Download URL | sagax_data-1.1.0-py3-none-any.whl |
|---|---|
| Size | 5.7 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
ae3de1fbd36f31efa4d8222c277a36aaa14f0429b6e355ee7a495b309bc7ed66
|
|
BLAKE2b-256 checksum How to use checksums |
472b9eb1963559e68e8b5d95c82c1cb1bfea7469a8837554d85e3ce4dfbd4b3b
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.11.14
|
Security for sagax-data 1.1.0
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.