tushare
A utility for crawling historical and Real-time Quotes data of China stocks
What it is and what it does
TuShare is a Python library that crawls historical and real-time stock market data for Chinese securities. It wraps multiple financial data providers and returns results as pandas DataFrames, making it straightforward to load, analyze, and export market data to CSV, Excel, JSON, or databases like MySQL and MongoDB.
The package targets financial analysts, pandas learners, and researchers interested in Chinese market data. It depends on standard web-scraping and data-processing libraries (requests, lxml, bs4, websocket-client) and uses pandas as its primary output format, making it compatible with the broader Python data science ecosystem.
Use it for:
- Retrieve historical OHLC data for a Chinese stock ticker to build backtesting datasets
- Stream real-time tick snapshots from Tencent or other brokers for live trading systems
- Export daily market quotes to CSV or Excel for manual analysis in spreadsheet tools
- Load stock data directly into pandas for technical indicator calculation and charting
- Populate a local MySQL or MongoDB database with historical market snapshots for research
Worth the install?
AI-flagged interpretation of the facts on this page — verify before relying
Fetches historical and real-time Chinese stock market data and returns it as pandas DataFrames for analysis and export.
Yes, if you need Chinese stock market data. The package has low install friction, permissive licensing, no known vulnerabilities, and active maintenance. Caveat: verify that the underlying data sources remain accessible and that real-time functions meet your latency and reliability requirements, as web-scraping-based APIs can be fragile.
Install
tushare on PyPI
pip
pip install tushareuv
uv add tusharepoetry
poetry add tushareInstalling tushare
Before you install
Low install friction with a pure-Python wheel and seven common dependencies (pandas, requests, lxml, simplejson, bs4, websocket-client, tqdm). Marked active with a recent release 142 days ago.
License in practice
BSD permissive license allows use, modification, and distribution with minimal restrictions—suitable for commercial and private projects.
Quickstart
pip install tushare
import tushare as ts
ts.get_hist_data('600848')
Verify before relying
- Whether the package's data sources (Tencent, Huatai, Yinhe Securities) remain active and reliable
- Current API rate limits or authentication requirements not documented in the excerpt
- Whether real-time data functions still work after recent maintenance fixes
Package facts
| License | BSD (permissive) |
| Python support | not specified |
| Install friction | low — pure-Python wheel |
| Runtime dependencies | 7 — pandas, requests, lxml, simplejson, bs4, websocket-client, tqdm |
| Maintenance | actively maintained — 142 days since the last release |
| First released | |
| Downloads | 613,999/month — #5,750 on PyPI (30-day window, as of 2026-08-14) |
| Known vulnerabilities | none known (OSV.dev, checked 2026-08-14) |
Evidence: tushare-1.4.29-py3-none-any.whl
Keywords: Global, Financial, Data
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
akshareAKShare fetches financial market data (stocks,…
permissive · top 5,000 on PyPI
baostockBaoStock retrieves historical China stock…
permissive · top 15,000 on PyPI
alpha-vantageFetches real-time and historical stock,…
permissive · top 15,000 on PyPI
fear-and-greedFetches CNN's Fear & Greed Index from their…
permissive · top 15,000 on PyPI
finlabBacktest trading strategies on Taiwan stock…
copyleft · top 15,000 on PyPI
tickflowTickFlow is a Python client for accessing…
permissive · top 15,000 on PyPI
finance-datareaderFetches historical and current financial…
permissive · top 15,000 on PyPI
yahooqueryRetrieves financial data from Yahoo Finance…
permissive · top 15,000 on PyPI
stockstatsAdds technical analysis indicators and…
permissive · top 15,000 on PyPI
pykrxScrapes Korean stock and bond market data from…
permissive · top 15,000 on PyPI