skillfed

tushare

A utility for crawling historical and Real-time Quotes data of China stocks

tushare v1.4.29 614.0K downloads/30d#5,750 on PyPI
Permissive license BSD Active released

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 tushare

uv

uv add tushare

poetry

poetry add tushare

Installing 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

Development Status :: 4 - BetaLicense :: OSI Approved :: BSD LicenseProgramming Language :: Python :: 3.10Programming Language :: Python :: 3.6Programming Language :: Python :: 3.7Programming Language :: Python :: 3.8Programming Language :: Python :: 3.9

Tags

china stock market datahistorical stock quotesreal-time market datafinancial data crawlerpandas stock datachinese securities datamarket tick data
financial-datachina-marketsweb-scraping

More Information Analysis packages