--- id: tushare version: "1.4.29" license: BSD license_treatment: permissive maintenance: active --- # tushare — A utility for crawling historical and Real-time Quotes data of China stocks License: permissive · Maintenance: active · Downloads: 614.0K/mo ## 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 above — 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 pip install tushare uv add tushare 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: unspecified - Install friction: low - Maintenance: active - Downloads: 614.0K/month (top 15,000 on PyPI) - Known vulnerabilities: none known ## Tags china stock market data, historical stock quotes, real-time market data, financial data crawler, pandas stock data, chinese securities data, market tick data, financial-data, china-markets, web-scraping [View on SkillFed](https://skillfed.io/packages/tushare) · [View on PyPI](https://pypi.org/project/tushare/)