explaingit

micro-sheep/efinance

Analysis updated 2026-07-03

3,683PythonAudience · dataComplexity · 2/5Setup · easy

TLDR

A Python library for fetching Chinese and international stock, fund, bond, and futures market data as structured tables, intended for personal analysis and backtesting workflows.

Mindmap

mindmap
  root((efinance))
    What It Does
      Fetches market data
      Chinese and global stocks
      Funds bonds futures
    Tech Stack
      Python
      pip
      Docker
    Data Types
      Stock price history
      Mutual fund NAV
      Bond data
      Futures data
    Use Cases
      Personal analysis
      Backtesting
      Data pipelines
Click or tap to explore — scroll the page freely

Code map

Detail Auto

An interactive map of this repo's files and how they connect — its source is parsed live in your browser. Click Visualize to build it.

filefunction / class

What do people build with it?

USE CASE 1

Pull historical daily price data for Chinese A-shares or international stocks into a Python script using a stock code or name.

USE CASE 2

Retrieve mutual fund, bond, and futures data for personal analysis without manually scraping financial websites.

USE CASE 3

Build a backtesting workflow that ingests structured market data returned as tabular output.

USE CASE 4

Use the Docker setup to run efinance in a containerized environment without a local Python install.

What is it built with?

PythonpipDocker

How does it compare?

micro-sheep/efinancepaddlepaddle/fastdeployzappa/zappa
Stars3,6833,6833,683
LanguagePythonPythonPython
Setup difficultyeasyhardmoderate
Complexity2/54/53/5
Audiencedatadeveloperdeveloper

Figures from each repo's GitHub metadata at analysis time.

How do you get it running?

Difficulty · easy Time to first run · 5min

Users outside China may hit rate limits and should use the TickFlow fallback data source instead.

In plain English

efinance is a Python library for fetching financial market data, primarily focused on Chinese markets. It covers stocks, mutual funds, bonds, and futures, returning data as structured tables that can be used in analysis scripts or personal trading systems. The README notes explicitly that this project is for personal learning and exchange only, not for commercial purposes. The library can pull historical daily price data for stocks using either a stock code or a stock name. It supports Chinese A-shares listed on domestic exchanges as well as international stocks like Apple and Microsoft, which can be looked up by their ticker symbols or by their Chinese names. ETFs are also supported through the same stock data functions. The output tables include fields like opening price, closing price, daily high and low, trading volume, transaction value, price change amount, and turnover rate. Installation is straightforward: pip install efinance works for most users, with an upgrade path via the same command. A Docker-based setup is also provided for those who prefer containerized environments. Developers who want to modify the library can clone the repository and install it in editable mode. The README mentions a companion data source called TickFlow as a fallback if users encounter rate limiting or network errors when pulling data, particularly for those accessing from outside China. The project covers several data categories beyond stock price history. Sections of the README address mutual fund data, bond data, and futures data, each with their own retrieval functions and example outputs. The documentation is hosted separately on ReadTheDocs. This is a tool for individuals who want to build their own analysis or backtesting workflows using Python, pulling market data without having to scrape it manually. It is not a trading platform and does not execute orders. The full README is longer than what was shown.

Copy-paste prompts

Prompt 1
Help me use efinance to pull one year of daily OHLCV price history for a Chinese A-share by stock code and load it into a pandas DataFrame.
Prompt 2
Show me how to fetch Apple stock price history using efinance by its English ticker symbol and calculate a 20-day moving average.
Prompt 3
Help me write a Python script that uses efinance to retrieve daily closing prices for a list of Chinese stocks and export them to a CSV file.
Prompt 4
I'm hitting rate limits with efinance from outside China, help me configure the TickFlow fallback data source.
Prompt 5
Show me how to use efinance to fetch mutual fund net asset value history and plot it over time.

Frequently asked questions

What is efinance?

A Python library for fetching Chinese and international stock, fund, bond, and futures market data as structured tables, intended for personal analysis and backtesting workflows.

What language is efinance written in?

Mainly Python. The stack also includes Python, pip, Docker.

How hard is efinance to set up?

Setup difficulty is rated easy, with roughly 5min to a first successful run.

Who is efinance for?

Mainly data.

Open on GitHub → Explain another repo

This repo across BitVibe Labs

Scan in gitsafehub Deploy in gitdeployhub micro-sheep on gitmyhub

Verify against the repo before relying on details.