AKLite

python Github stars

AKLite is a lite version of AKShare

AKLite will make the data fetch process more easy and fast. Now it focus on stock data, and will support more data in the future.

Key Features

  • A super-fast request engine built in HTTPX and accelerated with Asyncio.

  • The ability to fetch multiple stocks with ease.

  • Access to historical data from main stream data source.

With AKLite, you’ll have all the tools you need to fetch data. Start using AKLite today and take your working to the next level!

A Quick Example

Get a glimpse of what fetching with AKLite looks like with these code snippets:

Fetching Stock Data:

import aklite as ai

stock_zh_a_hist_obj = ai.stock_zh_a_hist(symbols=["000001", "000002"],
                                         period="daily",
                                         start_date="20220101",
                                         end_date="20230601",
                                         adjust="hfq",
                                         timeout=5,
                                         proxies={})
print(stock_zh_a_hist_obj.data)
print(stock_zh_a_hist_obj.columns)
print(stock_zh_a_hist_obj.url)
print(stock_zh_a_hist_obj.desc)
print(stock_zh_a_hist_obj.symbols)
print(stock_zh_a_hist_obj.start_date)
print(stock_zh_a_hist_obj.end_date)
print(stock_zh_a_hist_obj.adjust)

To learn how to use AKLite, see the notebooks under the User Guide:

Getting Started with Data Fetching

Welcome to AKlite! The best place to start is to learn about stock data fetch!

Import package

we should import aklite firstly, just like import akshare as ak, we will call ai short for aklite

[1]:
import aklite as ai

then, we can fetch stock data by our specific parameters: 1. we can set symbols, which is a list or str contains many stocks or just one; 2. we can set timeout and proxies for httpx timeout and proxies

[2]:
stock_zh_a_hist_obj = ai.stock_zh_a_hist(symbols=["000001", "000002"],
                                         period="daily",
                                         start_date="20220101",
                                         end_date="20230601",
                                         adjust="hfq",
                                         timeout=5,
                                         proxies={})

The notebooks above are also available on Github.