About this project

Ashare is the most simplified wrapper interface for real-time A-share market data in the Chinese stock market. Its core consists of just one Ashare.py file, requiring no installation or configuration, and can be freely trimmed. It is imported via `from Ashare import *`, and data retrieval, splitting, and integration are handled through a unified `get_price()` function. Data sources: It wraps two real-time market data kernels from Sina Finance and Tencent Stocks, with one primary and one backup, supporting automatic hot standby and failover. The README states it has been running stably for several years and can serve as a real-time market data source for quantitative live trading. Supported market data: Any historical daily, weekly, or monthly lines, as well as minute/hour lines such as 1m, 5m, 15m, 30m, and 60m. The count parameter specifies the number of records to fetch, and end_date specifies the end date for historical data. Results are uniformly cleaned into pandas DataFrames with fields including open, close, high, low, and volume, facilitating direct analysis and processing with pandas. Security codes support multiple formats, such as Tongdaxin, Tonghuashun, and JoinQuant notations: sh000001, 000001.XSHG, sz399006, 399006.XSHE, sh600519, 600519.XSHG, etc. README examples demonstrate fetching the Shanghai Composite Index's last 5 days of daily lines, historical daily and weekly lines with a specified end date, and 15-minute and 60-minute lines for Kweichow Moutai. The project also provides an example of integration with the same team's MyTT indicator library: after fetching 120 days of daily lines, it extracts closing, opening, high, and low price series, calculates MA5 and MA10 moving averages and BOLL Bollinger Bands, and plots them using matplotlib. Positioned as a simple, lightweight, portable, and open-source market data database, it is suitable for scenarios requiring market data, such as quantitative research, quantitative analysis, and programmatic automated trading systems for securities and stocks.