skillfed

efinance

A finance tool to get stock,fund and futures data base on eastmoney

efinance v0.5.9 341.8K downloads/30d#7,400 on PyPI3,935
Permissive license MIT Active released

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 efinance

uv

uv add efinance

poetry

poetry add efinance

Installing 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

License :: OSI Approved :: MIT LicenseProgramming Language :: Python :: 3.10Programming Language :: Python :: 3.11Programming Language :: Python :: 3.12Programming Language :: Python :: 3.6Programming Language :: Python :: 3.7Programming Language :: Python :: 3.8Programming Language :: Python :: 3.9

Tags

chinese stock market datafund price history apifutures data fetcherstock quote historyfinancial market data retrieval
financial-datachinese-marketspandas-integration

More Information Analysis packages