AKTools 是一款为 AKShare 打造的优雅、简单的 HTTP API 库,专为 AKShare 使用者而设计!
AKTools is a package of HTTP API for AKShare! It depends on AKShare, FastAPI and Typer.
AKTools 是一款用于快速搭建 AKShare HTTP API 的工具,通过 AKTools 可以利用一行命令来启动 HTTP 服务,从而让原本专属服务于 Python 用户的开源财经数据接口库 AKShare 的使用 突破编程语言的限制。无论您使用的是 C/C++、Java、Go、Rust、Ruby、PHP、JavaScript、R、Matlab、Stata 等编程语言或软件都可以快速、轻松获取财经数据,助力您更好地展开研究和开发工作。 AKTools 中文文档
pip install aktools
pip install aktools --upgrade -i https://pypi.org/simple # AKTools's version should great than 0.0.88
Please visit AKShare's Documentation
Please visit FastAPI's Documentation
Please visit Typer's Documentation
python -m aktoolshttp://127.0.0.1:8080/ in your Chrome and you can fetch your homepage and more informationhttp://127.0.0.1:8080/api/public/stock_zh_a_hist in your Chromehttp://127.0.0.1:8080/api/public/stock_zh_a_hist?symbol=600000AKTools set a simple homepage for user to provide simple reference information. When you set up your
environment and deploy your local application, then you can type http:127.0.0.1:8080 in your browser.
We are developing more functions now, please pay more attention!
R-Program
library(RCurl) # 需要先安装该包
library(jsonlite) # 需要先安装该包
options (warn = -1) # 该行有助于在无参数请求时去掉 warning 信息
temp_df <-
getForm(
uri = 'http://127.0.0.1:8080/api/public/stock_zh_a_hist', # 此处的 http://127.0.0.1:8080 需要替换为您定义的地址和端口
symbol = '000001',
period = 'daily',
start_date = '20211109',
end_date = '20211209',
adjust = 'hfq',
.encoding = "utf-8"
)
inner_df <- fromJSON(temp_df)
inner_df
R-Result
…
MATLAB-Program
api = 'http://127.0.0.1:8080/api/public/';
url = [api 'stock_zh_a_hist'];
options = weboptions('ContentType','json', 'CharacterEncoding', 'utf-8');
data = webread(url, options, symbol = '000001', period = 'daily', start_date = '20211109', end_date = '20211209', adjust = 'hfq');
data % 由于 MATLAB 无法显示中文字段名,请自行修改为英文字段,参考链接:https://iso2mesh.sourceforge.net/cgi-bin/index.cgi?jsonlab/Doc/Examples
MATLAB-Result
…
Rust-Program
…
Rust-Result
…