explaingit

waditu/tushare

Analysis updated 2026-06-24

14,878PythonAudience · dataComplexity · 2/5Setup · easy

TLDR

TuShare is a Python toolkit that pulls Chinese stock, futures, and fund market data into pandas DataFrames for quantitative analysis.

Mindmap

mindmap
  root((tushare))
    Inputs
      Stock codes
      Date ranges
      API tokens
    Outputs
      Daily bars
      Tick trades
      Realtime quotes
      Pandas DataFrames
    Use Cases
      Backtest strategies
      Build market dashboards
      Train ML models
    Tech Stack
      Python
      Pandas
      TuShare Pro
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

Download daily OHLCV history for a list of A-share tickers and load it into pandas for backtesting.

USE CASE 2

Stream realtime quotes for a watchlist of Chinese stocks into a local Jupyter notebook.

USE CASE 3

Pull tick-level intraday trades for one stock to study microstructure or build a feature set.

USE CASE 4

Combine futures, fund, and stock bars through the TuShare Pro generic bar interface for a multi-asset model.

What is it built with?

PythonPandasPyPI

How does it compare?

waditu/tusharellmware-ai/llmwarepjialin/py12306
Stars14,87814,86014,896
LanguagePythonPythonPython
Last pushed2026-05-17
MaintenanceMaintained
Setup difficultyeasymoderatemoderate
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

pip install tushare and a working pandas install are enough, Pro features need a free token from tushare.pro.

In plain English

TuShare is a Python toolkit for collecting financial market data, focused on Chinese stocks and related instruments like futures. The README describes it as a tool that covers the full path from collecting the raw data, cleaning and processing it, and storing it locally. It is aimed at quantitative analysts and people learning data analysis who need a simple way to pull market data into Python. The library returns data as pandas DataFrames, which is the standard table-like structure used in Python for data work. The README shows short code samples: ts.get_hist_data('600848') returns the historical daily trading data for a single stock, including open, high, low, close, volume, percentage change, and several moving averages. There are also calls for adjusted historical data, all stocks for the most recent trading day, tick-level intraday trades, and real-time quotes for one or more stocks at once. There is a newer service called TuShare Pro hosted at tushare.pro, mentioned at the top of the README. Pro adds coverage for futures, weekly and monthly A-share data, and a generic bar interface that handles stocks, funds, futures, and digital currencies, including adjusted price series. Installation is by pip install tushare, by running setup.py install, or by downloading from PyPI. The only listed dependency is pandas. Python 2 and Python 3 are both noted as supported. The README also lists QQ chat groups and a WeChat public account where the maintainers post updates and documentation.

Copy-paste prompts

Prompt 1
Show me a TuShare script that pulls 5 years of daily bars for stock 600848 and plots the close with two moving averages.
Prompt 2
Set up TuShare Pro with my token and pull weekly A-share data plus CFFEX index futures into a single DataFrame.
Prompt 3
Cache TuShare get_hist_data results to a local SQLite file so repeated backtests do not re-download data.
Prompt 4
Build a script that loops over all stocks returned by get_today_all and stores their tick data to parquet.
Prompt 5
Wire TuShare realtime quotes into a small Flask dashboard that refreshes prices every 5 seconds.

Frequently asked questions

What is tushare?

TuShare is a Python toolkit that pulls Chinese stock, futures, and fund market data into pandas DataFrames for quantitative analysis.

What language is tushare written in?

Mainly Python. The stack also includes Python, Pandas, PyPI.

How hard is tushare to set up?

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

Who is tushare for?

Mainly data.

Open on GitHub → Explain another repo

This repo across BitVibe Labs

Verify against the repo before relying on details.