Awesome Open Source
Awesome Open Source

AKShare-- AKShare AKTools ! Tips AKShare VIP !

**AKShare- AKShare **

** AKTools AKShare HTTP API Python AKTools awesome-data **

PyPI - Python Version PyPI Downloads Documentation Status Code style: black akshare Actions Status MIT Licence code style: prettier

Overview

AKShare requires Python(64 bit) 3.7 or greater, aims to make fetch financial data as convenient as possible.

Write less, get more!

  • Documentation:

Installation

General

pip install akshare --upgrade

China

pip install akshare -i http://mirrors.aliyun.com/pypi/simple/ --trusted-host=mirrors.aliyun.com  --upgrade

PR

Please check out documentation if you want to contribute to AKShare

Docker

Pull images

docker pull registry.cn-hangzhou.aliyuncs.com/akshare/akdocker

Run AKDocker

docker run -it registry.cn-hangzhou.aliyuncs.com/akshare/akdocker python

Test AKDocker

import akshare as ak

print(ak.__version__)

Usage

Data

Code

import akshare as ak

stock_zh_a_hist_df = ak.stock_zh_a_hist(symbol="000001", period="daily", start_date="20170301", end_date='20210907', adjust="")
print(stock_zh_a_hist_df)

Output

                         ...       
0     2017-03-01   9.49   9.49   9.55  ...  0.84  0.11  0.01  0.21
1     2017-03-02   9.51   9.43   9.54  ...  1.26 -0.63 -0.06  0.24
2     2017-03-03   9.41   9.40   9.43  ...  0.74 -0.32 -0.03  0.20
3     2017-03-06   9.40   9.45   9.46  ...  0.74  0.53  0.05  0.24
4     2017-03-07   9.44   9.45   9.46  ...  0.63  0.00  0.00  0.17
          ...    ...    ...    ...  ...   ...   ...   ...   ...
1100  2021-09-01  17.48  17.88  17.92  ...  5.11  0.45  0.08  1.19
1101  2021-09-02  18.00  18.40  18.78  ...  5.48  2.91  0.52  1.25
1102  2021-09-03  18.50  18.04  18.50  ...  4.35 -1.96 -0.36  0.72
1103  2021-09-06  17.93  18.45  18.60  ...  4.55  2.27  0.41  0.78
1104  2021-09-07  18.60  19.24  19.56  ...  6.56  4.28  0.79  0.84
[1105 rows x 11 columns]

Plot

Code

import akshare as ak
import mplfinance as mpf  # Please install mplfinance as follows: pip install mplfinance

stock_us_daily_df = ak.stock_us_daily(symbol="AAPL", adjust="qfq")
stock_us_daily_df = stock_us_daily_df[["open", "high", "low", "close", "volume"]]
stock_us_daily_df.columns = ["Open", "High", "Low", "Close", "Volume"]
stock_us_daily_df.index.name = "Date"
stock_us_daily_df = stock_us_daily_df["2020-04-01": "2020-04-29"]
mpf.plot(stock_us_daily_df, type='candle', mav=(3, 6, 9), volume=True, show_nontrading=False)

Output

Communication

Pay attention to **** Official Accounts to get more information about Quant, ML, DS and so on, please visit for more information:

data science

Pay attention to **** WeChat Official Accounts to get the AKShare updated info:

ds

Application to add AKShare-VIP QQ group and talk about AKShare issues, please contact AKShare- QQ: 1254836886

Features

  • Easy of use: Just one line code to fetch the data;
  • Extensible: Easy to customize your own code with other application;
  • Powerful: Python ecosystem.

Tutorials

  1. Overview
  2. Installation
  3. Tutorial
  4. Data Dict
  5. Subjects

Contribution

AKShare is still under developing, feel free to open issues and pull requests:

  • Report or fix bugs
  • Require or publish interface
  • Write or fix documentation
  • Add test cases

Notice: We use Black to format the code

Statement

  1. All data provided by AKShare is just for academic research purpose;
  2. The data provided by AKShare is for reference only and does not constitute any investment proposal;
  3. Any investor based on AKShare research should pay more attention to data risk;
  4. AKShare will insist on providing open-source financial data;
  5. Based on some uncontrollable factors, some data interfaces in AKShare may be removed;
  6. Please follow the relevant open-source protocol used by AKShare;
  7. Provide HTTP API for the person who uses other program language: AKTools.

Show your style

Use the badge in your project's README.md:

[![Data: akshare](https://img.shields.io/badge/Data%20Science-AKShare-green)](https://github.com/akfamily/akshare)

Using the badge in README.rst:

.. image:: https://img.shields.io/badge/Data%20Science-AKShare-green
    :target: https://github.com/akfamily/akshare

Looks like this:

Data: akshare

Citation

Please use this bibtex if you want to cite this repository in your publications:

@misc{akshare,
    author = {Albert King},
    title = {AKShare},
    year = {2019},
    publisher = {GitHub},
    journal = {GitHub repository},
    howpublished = {\url{https://github.com/akfamily/akshare}},
}

Acknowledgement

Special thanks FuShare for the opportunity of learning from the project;

Special thanks TuShare for the opportunity of learning from the project;

Thanks for the data provided by ;

Thanks for the data provided by ;

Thanks for the data provided by ;

Thanks for the data provided by 99;

Thanks for the data provided by ;

Thanks for the data provided by ;

Thanks for the data provided by ;

Thanks for the data provided by ;

Thanks for the data provided by ;

Thanks for the data provided by Oxford-Man Institute ;

Thanks for the data provided by DACHENG-XIU ;

Thanks for the data provided by ;

Thanks for the data provided by ;

Thanks for the data provided by ;

Thanks for the data provided by ;

Thanks for the data provided by ;

Thanks for the data provided by ;

Thanks for the data provided by ;

Thanks for the data provided by ;

Thanks for the data provided by Timeanddate ;

Thanks for the data provided by ;

Thanks for the data provided by ;

Thanks for the data provided by Economic Policy Uncertainty ;

Thanks for the data provided by ;

Thanks for the data provided by ;

Thanks for the data provided by ;

Thanks for the data provided by ;

Thanks for the data provided by ;

Thanks for the data provided by ;

Thanks for the data provided by ;

Thanks for the data provided by Expatistan ;

Thanks for the data provided by ;

Thanks for the data provided by ;

Thanks for the data provided by IT;

Thanks for the data provided by ;

Thanks for the data provided by ;

Thanks for the data provided by ;

Thanks for the data provided by 163;

Thanks for the data provided by ;

Thanks for the data provided by ;

Thanks for the data provided by ;

Thanks for the data provided by -;

Thanks for the data provided by -;

Thanks for the data provided by ;

Thanks for the data provided by ;

Thanks for the data provided by ;

Thanks for the data provided by Currencyscoop ;

Thanks for the data provided by ;

Thanks for the tutorials provided by : Python.

Backer and Sponsor

jetbrains
Alternatives To Akshare
Select To Compare


Alternative Project Comparisons
Related Awesome Lists
Top Programming Languages

Get A Weekly Email With Trending Projects For These Topics
No Spam. Unsubscribe easily at any time.
Python (863,999
Dataset (33,171
Data Science (11,063
Stock (9,210
Finance (7,098
Currency (5,999
Data Analysis (5,187
Futures (3,389
Academic (2,397
Economics (900
Quant (540
Financial Data (475
Fundamentals (135
Tushare (123
Bond (54
Economic Data (46
Finance Api (32
Asset Pricing (16
Akshare (5