Repolode
1nchaos

1nchaos/adata

Python SDK for fetching Chinese A-share stock, fund, bond and sentiment market data from multiple public sources, aimed at personal quant trading.

Stars
5,293
Forks
706
Open issues
31
Last commit
2 days ago

What is it?

AData is a Python SDK that collects A-share market data from public sources such as Tonghuashun, Eastmoney, Baidu Stock Connect, Tencent and Sina. It covers stock codes, daily, weekly and monthly K-line data, intraday minute data, real-time quotes, capital flows, concept and index data, and northbound fund flows.

The library merges several data sources and supports setting a proxy globally, which the project uses to keep data retrieval available when a single source restricts access. Functions return pandas DataFrames, and the project publishes a data dictionary describing the fields, so the output can be stored in a database table.

The project is focused on trading data only. Financial statement data is limited to a core-indicator interface, and the three full financial statements are not provided. Fund and bond coverage is partial, with ETF and convertible bond interfaces listed.

Key features

  • 01Fetches A-share stock codes, K-line, minute and real-time quote data.
  • 02Merges multiple public data sources and switches between them.
  • 03Supports setting a global proxy for data requests.
  • 04Provides concept, index, capital flow and northbound fund flow interfaces.
  • 05Returns pandas DataFrames with a published data dictionary.

Use cases

  • Pulling historical daily K-line data for backtesting a quantitative strategy.
  • Building a local A-share market database from structured trading data.
  • Monitoring real-time quotes and capital flows for individual stocks or concepts.

Quick start

  1. 1

    Install the SDK from PyPI

    pip install adata
  2. 2

    Import the package and call a data function, e.g. adata.stock.info.all_code() to list A-share codes

Things to know

  • Only covers Chinese A-share stocks, funds, bonds and sentiment data.
  • It relies on public data interfaces that may be restricted, so the README offers proxy settings as a workaround.
  • The README and data dictionary are primarily in Simplified Chinese.

Topics

FAQ

What is adata?
Python SDK for fetching Chinese A-share stock, fund, bond and sentiment market data from multiple public sources, aimed at personal quant trading. AData is a Python SDK that collects A-share market data from public sources such as Tonghuashun, Eastmoney, Baidu Stock Connect, Tencent and Sina. It covers stock codes, daily, weekly and monthly K-line data, intraday minute data, real-time quotes, capital flows, concept and index data, and northbound fund flows.
Is adata free to use? What license does it have?
adata is open source under the Apache-2.0 license. Check the license terms before using it in commercial products.
Is adata still maintained?
Actively maintained. The last commit to adata was on Oct 18, 2026.
What can I use adata for?
Pulling historical daily K-line data for backtesting a quantitative strategy. Building a local A-share market database from structured trading data. Monitoring real-time quotes and capital flows for individual stocks or concepts.
How do I install adata?
Install the SDK from PyPI: pip install adata Import the package and call a data function, e.g. adata.stock.info.all_code() to list A-share codes
Where can I get adata?
The source code and installation instructions are on GitHub: https://github.com/1nchaos/adata

Summary generated by AI from the project's README. GitHub stats refresh daily.

Related projects