by rootSunc
中国 A 股数据基础设施。52个日更数据集:行情、基本面、资金面、公告事件、指数行业、宏观与风险。行级溯源、PIT 语义、复权与历史成分内置,MCP 原生。自托管,零注册、零 API Token
# Add to your Claude Code skills
git clone https://github.com/rootSunc/CNEquityLast scanned: 8/16/2026
{
"issues": [],
"status": "PASSED",
"scannedAt": "2026-08-16T04:34:23.221Z",
"npmAuditRan": true,
"pipAuditRan": true,
"promptInjectionRan": true
}See how CNEquity compares with popular alternatives.
CNEquity is an open-source ai agents skill for AI coding assistants such as Claude Code, Codex CLI, and ChatGPT, built by rootSunc. 中国 A 股数据基础设施。52个日更数据集:行情、基本面、资金面、公告事件、指数行业、宏观与风险。行级溯源、PIT 语义、复权与历史成分内置,MCP 原生。自托管,零注册、零 API Token. It has 309 GitHub stars.
Yes. CNEquity passed SkillsLLM's automated security scan — a dependency vulnerability audit plus prompt-injection heuristics — with no high-severity issues. You can read the full report in the Security Report section on this page.
Clone the repository with "git clone https://github.com/rootSunc/CNEquity" and add it to your Claude Code skills directory (see the Installation section above).
CNEquity is primarily written in Python. It is open-source under rootSunc on GitHub, so you can review or fork the full source.
Yes. SkillsLLM lists many other AI Agents skills you can browse and compare side by side. Open the AI Agents category from the badge at the top of this page, or use the Related Skills and comparison links further down to weigh CNEquity against similar tools.
No comments yet. Be the first to share your thoughts!
⚠️ Third-Party Software Notice
This skill is third-party open-source software developed and hosted independently on GitHub. SkillsLLM is an informational directory and does not control or maintain the underlying repository.
Any security checks, ratings, or warnings displayed by SkillsLLM are automated and limited in scope. They do not constitute a security certification or guarantee that the software is safe, error-free, or free from malicious code, vulnerabilities, compromised dependencies, or prompt-injection risks.
Review the source code, permissions, dependencies, and configuration before installing or running any third-party skill. Use is at your own risk. To the maximum extent permitted by applicable law, SkillsLLM is not liable for losses arising from third-party software.
CNEquity 将股票行情、期货合约、财报、公司事件和资金面等多源数据整理为本地 Parquet 数据湖,提供增量采集、失败续跑、质量审计与统一查询。适合反复回测、积累历史数据。提供个人研究者和AI Agent一套完整的金融数据解决方案。
当前开发树注册 52 个数据集:47 个 curated + 5 个 derived,按用途分为 L0–L9。完整字段、主键、历史起点和来源集中在数据集目录与数据源说明。
| 层次 | 研究用途 | 代表数据集 |
|---|---|---|
| L0 | 基础参考 | 证券主数据、交易日历、交易状态 |
| L1 | 行情 | 日线、指数、复权因子、可选分钟线与分笔、退市事件 |
| L2 | 公司事件 | 公司行为、公告索引、业绩披露预约 |
| L3 | 基本面 | 财报、估值、股本、股东、一致预期 |
| L4 | 资金面 | 北向、融资融券、龙虎榜、大宗交易、资金流 |
| L5 | 结构行业 | 指数成分、行业与板块成分、行业指数 |
| L6 | 宏观 | 宏观指标、市场宽度 |
| L7 | 舆情与轮动 | 新闻、快讯、情绪、人气、板块行情与资金流 |
| L8 | 风险合规 | 解禁日程、监管事件 |
| L9 | 衍生品 | 期货与期权合约、逐合约行情、连续合约、Greeks、分钟线 |
分钟线、分笔和期货/期权默认关闭;按需启用后仍须检查来源的历史视野与实际覆盖。
| 数据集 | 层次 | 登记主源 | 登记备源 |
|---|---|---|---|
instruments |
L0 | tdx_protocol | baostock |
etf_profiles |
L0 | exchange | — |
trading_calendar |
L0 | tdx_protocol | exchange |
trading_status |
L0 | eastmoney | exchange |
adj_factors |
L1 | sina | baostock |
daily_bars |
L1 | tdx_protocol | eastmoney |
delisting_events |
L1 | derived | — |
index_bars |
L1 | tdx_protocol | eastmoney |
minute_bars |
L1 | tdx_protocol | — |
minute_bars_5m |
L1 | tdx_protocol | — |
trade_ticks |
L1 | tdx_protocol | — |
announcement_index |
L2 | cninfo | — |
corporate_actions |
L2 | eastmoney | tdx_protocol |
earnings_disclosure_schedule |
L2 | eastmoney | — |
analyst_consensus |
L3 | eastmoney | — |
financial_statement_items |
L3 | eastmoney | — |
share_structure |
L3 | eastmoney | — |
shareholder_counts |
L3 | eastmoney | — |
top_holders |
L3 | eastmoney | — |
valuation_metrics |
L3 | eastmoney | — |
block_trades |
L4 | eastmoney | exchange |
dragon_tiger |
L4 | eastmoney | exchange |
fund_flow |
L4 | eastmoney | — |
fund_flow_ths |
L4 | ths | — |
institutional_holdings |
L4 | eastmoney | — |
margin_trading |
L4 | exchange | — |
northbound_flows |
L4 | eastmoney | — |
northbound_holdings |
L4 | eastmoney | — |
index_constituents |
L5 | eastmoney | — |
industry_index |
L5 | derived | — |
industry_members |
L5 | eastmoney | — |
sector_members |
L5 | eastmoney | — |
macro_indicators |
L6 | eastmoney | pboc |
market_breadth |
L6 | derived | — |
economic_calendar |
L7 | eastmoney | — |
flash_news_wire |
L7 | eastmoney | — |
hot_rank |
L7 | eastmoney | — |
news_headlines |
L7 | eastmoney | — |
sector_bars |
L7 | ths | — |
sector_fund_flow |
L7 | eastmoney | — |
sector_fund_flow_ths |
L7 | ths | — |
sentiment_scores |
L7 | derived | eastmoney |
regulatory_events |
L8 | cninfo | — |
share_unlock_schedule |
L8 | eastmoney | — |
commodity_bars |
L9 | sina | eastmoney |
futures_bars |
L9 | futures_exchange | — |
futures_continuous |
L9 | derived | — |
futures_contracts |
L9 | futures_exchange | — |
futures_minute_bars |
L9 | sina | — |
option_bars |
L9 | futures_exchange | — |
option_contracts |
L9 | futures_exchange | — |
option_greeks |
L9 | derived | — |
登记主备源是数据集元数据;日更 tip、历史回填和显式修复可能走不同路径。请结合来源说明使用。
需要 Python 3.10+,支持 macOS、Linux 和 Windows。基础体验无需账号或token。
pip install cnequity
cne init --profile demo
默认抓取 5 只股票、最近约 30 个交易日的真实日线,写入独立的 data/cnequity-demo/,并生成 configs/cnequity.demo.toml。耗时取决于 TDX 行情主机的可达性。
接着在 Python 里读出结果:
from cnequity.query import load
bars = load("daily_bars", data_root="data/cnequity-demo")
print(bars.select("symbol", "trade_date", "close", "volume", "source").tail(10))
或者打开本地控制台:
cne serve --config configs/cnequity.demo.toml
# 浏览器访问 http://127.0.0.1:8787
cne doctor
cne init --profile sample --data-root data/cnequity-sample --config-out configs/cnequity.sample.toml
cne query --config configs/cnequity.sample.toml --sql "SELECT symbol, trade_date, close, source FROM daily_bars LIMIT 5"
sample 不访问数据源,合成行标记为 source=mock,只能验证链路,不能用于研究。这里单独指定目录和配置,方便与真实 demo 并存。更多问题见排障指南。
source、data_version、fetched_at 配合不可变数据版本与研究快照,支持复查和重现。同一等权买入持有策略、同一时间窗口,仅按今天仍在交易的股票回看过去,会漏掉后来退市的标的。下图用历史样本展示两种股票池得到的结果差异:
历史样本仅用于说明股票池口径;图中收益和标的数量不代表当前湖覆盖或未来投资表现。退市股按最后一根可用行情计价,因子及退市覆盖限制见股票池画像。
CNEquity 在数据层保留退市身份,并让复权、历史成分和 PIT 口径进入查询契约,避免下游研究在无意中丢掉这些标的。

控制台示意截图(标有 ILLUSTRATIVE DEMO);图中的 42/42、行数和容量均为虚构展示值,不是当前注册数量或实际覆盖。
如果这正是你一直在重复搭建的数据底座,欢迎给 CNEquity 一个 ⭐ Star,方便找回,也帮助更多研究者发现它。
| 你的问题 | 数据与入口 | 需要确认的口径 |
|---|---|---|
| 跨分红、送转后的历史收益 | daily_bars + adj_factors · 复权示例 |
adjust="hfq",研究时开启 strict_adj=True |
| 某个调仓日已经知道哪些财报信息 | financial_statement_items · PIT 示例 |
显式 as_of + pit_mode="strict";新回填不等于当时可见 |
| 历史股票池、退市前行情 | instruments、trading_status、delisting_events · 股票池画像 |
历史 ST、退市和行情覆盖需另行核验 |
| 估值、资金流、行业轮动 | valuation_metrics、资金面与结构数据 · 查询指南 |
分清可回补历史与启用后积累的快照 |
| 期货期限结构、期权链与 Greeks | 逐合约行情和派生数据 · 衍生品指南 | 默认关闭,按交易所、合约生命周期与覆盖证据验收 |

数据经适配器与批次编排进入 staging,校验后发布为 curated 或 derived 数据;质量审计、Python/SQL 查询、控制台和 MCP 围绕已发布数据工作。图示用于说明职责边界,具体来源协议与启用状态以数据流说明和数据集目录为准。
在准备长期使用的工作目录执行:
cne config create
cne config validate
cne init
# 之后:交易日行情与其他已启用的日更组
cne run daily --all-groups
# 公告、监管事件和资讯:独立运行,周末也更新
cne run events
cne status --datasets
config create 生成正式配置,默认正式湖与 demo 分开。init 默认覆盖沪深京全市场最近 3 年的初始化主干;它不是所有数据集的全历史下载,也没有固定完成时长。
| 你想要 | 使用方式 |
|---|---|
| 先验证真实采集 | cne init --profile demo |
| 全市场近期主干 | cne init(默认 quick) |
| 更深的初始化主干 | cne init --profile full,其中日线默认从 2016-01-01 起 |
| 某个数据集更早的历史 | cne backfill DATASET --start YYYY-MM-DD --end YYYY-MM-DD --plan,审阅后去掉 --plan |
| 补历史 ST 扫描 | cne backfill trading_status;覆盖能力仍受市场与来源约束 |
三个容易误解的默认值:
cne run daily 不带选项时只执行核心 waves;--all-groups 才遍历日更组,不包含 run events。已建立含复权因子的正式湖后:
from cnequity.query import load
bars = load(
"daily_bars",
symbols=["600519.SH"],
start="2024-01-01",
end="2024-12-31",
adjust="hfq",
strict_adj=True,
)
print(bars.select("trade_date", "close", "adj_close", "adj_is_exact"))
cne query --sql "SELECT symbol, max(trade_date) AS last_date FROM daily_bars GROUP BY symbol LIMIT 10"
cne mcp --config /abs/path/to/cnequity.toml
load() 提供复权、PIT 和股票池语义;scan() 提供原始 LazyFrame。MCP 默认只读本地湖,提供描述、代码解析、行情、财报、通用数据集和 SQL 六类工具。客户端配置见 MCP 指南,查询边界见 Python API。
适合持续积累历史、反复查询、检查研究口径和自托管数据的工作。若只需偶尔取一个最新报价,直接调用取数接口通常更轻;已有研究或交易平台也可以把 CNEquity 放在数据层,见选型说明。
cne --version 和更新日志。fresh 表示新鲜度,不能单独证明历史完整或研究有效。严格 PIT 可能返回空结果,历史股票池可能因证据不足拒绝读取。| 想做什么 | 从这里开始 |
|---|---|
| 安装、跑通首个查询 | 安装 · 快速开始 |
| 找数据、确认口径 | 目录 · 字段 · 研究示例 |
| 查命令、参数和副作用 | CLI · 参数默认值 · 联网与写入清单 |
| 配调度、处理失败 | 运行手册 · 取数与源保护 · 排障 |
| 理解产品方向与反馈问题 | 产品设计 · 升级与反馈 |
欢迎提交带最小复现的 Issue、文档修正或数据适配 PR。研究引用见 CITATION.cff;安全问题请按安全策略私下报告。
觉得有用?点一个 Star,或把项目分享给同样在维护 A 股数据的人。