efinance
A finance tool to get stock,fund and futures data base on eastmoney
What it is and what it does
efinance is a Python library that retrieves historical and intraday price data for Chinese stocks, ETFs, funds, and futures from eastmoney, a major Chinese financial data provider. It wraps HTTP requests to eastmoney's endpoints and parses the responses into pandas DataFrames, making it straightforward to pull candlestick data at various frequencies (daily, 5-minute, etc.) for use in backtesting, analysis, or live trading systems.
The package supports lookups by stock code (e.g., '600519' for a Shanghai stock) or by name, and also handles international tickers like AAPL and MSFT. Its eight runtime dependencies—requests, pandas, beautifulsoup4, tqdm, retry, multitasking, jsonpath, and rich—handle HTTP transport, data parsing, progress display, and retry logic. The library is actively maintained and carries no known security vulnerabilities, though it explicitly disclaims commercial use in its documentation.
Use it for:
- Backtest trading strategies on Chinese A-shares by pulling years of daily OHLCV data for a given stock code.
- Monitor intraday price movements at 5-minute intervals for live trading or real-time dashboards.
- Fetch ETF historical data to analyze sector or thematic fund performance over time.
- Build a data pipeline that refreshes fund and futures quotes for a personal investment tracking system.
- Compare historical prices across multiple stocks or ETFs in a single pandas DataFrame for correlation analysis.
Worth the install?
AI-flagged interpretation of the facts on this page — verify before relying
Fetches historical and real-time stock, fund, and futures price data from Chinese financial markets, returning structured data as pandas DataFrames for analysis and trading system integration.
Yes, if you need Chinese market data and accept the learning-only disclaimer. The package is actively maintained, has no security issues, installs easily, and integrates well with pandas workflows. If you require commercial-grade data reliability or non-Chinese markets as a primary use case, verify eastmoney's stability and coverage first, or consider a dedicated financial data API.
Install
efinance on PyPI
pip
pip install efinanceuv
uv add efinancepoetry
poetry add efinanceInstalling efinance
Before you install
Low friction install with a pure-Python wheel. Active maintenance—last commit 2026-07-17, 28 days since release. Eight runtime dependencies (requests, pandas, beautifulsoup4, etc.) are all widely used and stable. No known vulnerabilities as of 2026-08-14.
License in practice
MIT license permits commercial use, modification, and redistribution with attribution. However, the package itself carries a disclaimer stating it is for learning and exchange only, not for commercial purposes—users should review this restriction against their intended use.
Quickstart
import efinance as ef
stock_code = '600519'
df = ef.stock.get_quote_history(stock_code)
print(df.head())
Requires network access to fetch data from eastmoney; rate limiting or connection timeouts may occur during heavy use.
Verify before relying
- Whether the eastmoney data source is stable and whether rate-limiting is enforced or documented.
- Whether non-Chinese market data (e.g., AAPL, MSFT) shown in examples is consistently available or a special case.
- Whether the package actively maintains its data source connection or if it has experienced outages.
Package facts
| License | MIT (permissive) |
| Python support | not specified |
| Install friction | low — pure-Python wheel |
| Runtime dependencies | 8 — requests, tqdm, pandas, retry, multitasking, jsonpath, rich, beautifulsoup4 |
| Maintenance | actively maintained — 28 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 341,759/month — #7,400 on PyPI (30-day window, as of 2026-08-14) |
| Known vulnerabilities | none known (OSV.dev, checked 2026-08-14) |
Evidence: efinance-0.5.9-py3-none-any.whl
Keywords: finance, quant, stock, fund, futures
Tags
More Information Analysis packages
A drop-in replacement for Python's standard…
permissive · top 100 on PyPI
pyarrowpyarrow provides Python bindings to Apache…
permissive · top 100 on PyPI
networkxNetworkX provides data structures and…
permissive · top 1,000 on PyPI
snowflake-connector-pythonConnects Python applications to Snowflake data…
permissive · top 1,000 on PyPI
contourpyContourPy calculates contours of 2D…
permissive · top 1,000 on PyPI
snowflake-snowpark-pythonSnowpark Python provides APIs to query and…
permissive · top 1,000 on PyPI
finance-datareaderFetches historical and current financial…
permissive · top 15,000 on PyPI
akshareAKShare fetches financial market data (stocks,…
permissive · top 5,000 on PyPI
yahooqueryRetrieves financial data from Yahoo Finance…
permissive · top 15,000 on PyPI
baostockBaoStock retrieves historical China stock…
permissive · top 15,000 on PyPI
sec-edgar-downloaderDownloads SEC EDGAR company filings by ticker…
permissive · top 15,000 on PyPI
tdxpyTdxPy provides a pure-Python interface to read…
permissive · top 15,000 on PyPI
finlabBacktest trading strategies on Taiwan stock…
copyleft · top 15,000 on PyPI
alpha-vantageFetches real-time and historical stock,…
permissive · top 15,000 on PyPI
tickflowTickFlow is a Python client for accessing…
permissive · top 15,000 on PyPI
pandas_market_calendarsProvides market and exchange trading calendars…
permissive · top 5,000 on PyPI