CNEquity is an open-source local data lake for China A-shares, used to organize Shanghai, Shenzhen, and Beijing stock market quotes, corporate events, financials, and futures and options data, aimed at quantitative research, quantitative trading, and backtesting. The project emphasizes no registration, no token, and self-hosting, with built-in price adjustment and PIT (point-in-time data), retention of delisted stocks, row-level provenance support, and native MCP support.
Main capabilities:
- Datasets: supports 86 datasets (78 collected datasets and 8 derived datasets), categorized by purpose into L0–L9, covering Shanghai and Shenzhen stock quotes, A-share stock data and financial data, financial statements, futures data, capital flows, announcements, indices and sectors, and macro data, among others. Minute bars, tick data, futures/options, as well as best-effort and optional datasets such as capital flows, news, and popularity rankings, are disabled by default and can be enabled in the configuration when needed.
- Storage and publishing: atomically published to local Parquet via the DuckLake lake catalog, with support for incremental resumption based on a coverage ledger.
- Historical stock universe: during backtesting, a versioned stock universe profile (such as cn_a_sh_sz_research_v1) can be used in load() to filter by research date, avoiding dropping stocks that were listed at the time and later delisted.
- MCP access: the lake can be exposed read-only to MCP-capable clients such as Claude, ChatGPT, Codex, Gemini CLI, Cursor, and VS Code; ChatGPT only connects to public URLs, so it can be accessed via cne mcp --http --token plus a tunnel.
- Export: use cne storage export when external tools need to read Parquet files directly.
Usage (based on the materials):
- Environment requirements: Python 3.11+, depends on DuckDB 2.0+, supports macOS / Linux / Windows; basic collection requires no account or token. Machines with small memory or small disks should first check the resource configuration recommendations.
- One-minute trial: fetch the last 30 trading days for 5 stocks from real data sources, built in a separate directory; in offline environments, cne init --profile sample can be used to generate a synthetic sample lake.
- Building a formal lake: the full Shanghai, Shenzhen, and Beijing markets, for the last 3 years; afterward, run cne run daily once a day to keep it updated. For longer history, use cne init --profile full.
- Upgrade: pip install -U cnequity, then run cne upgrade (preview first; after confirmation, add cne upgrade --apply to complete the lake directory migration in one step; for fully expanded old configurations, run cne config upgrade). Starting from 0.25.0, the lake directory becomes the only storage method, and 0.25.x is the last version series that can upgrade 0.24.0 and earlier lakes; before upgrading, back up the data directory and read Upgrading to 0.25.0.
- Daily maintenance: scheduling, the operations page, disk usage (cne storage usage), and follow-up after failures are covered in Daily Updates.
Use cases: suitable for self-hosted quantitative research, backtesting, and AI agent queries of A-share data that continuously accumulate history and require repeated queries.
Limitations: the project is in 0.x and does not include a backtesting engine or order placement functionality; the code uses Apache-2.0, data is additionally subject to upstream licenses, and the repository does not include a data lake.