Giter Site home page Giter Site logo

akfamily / aktools Goto Github PK

View Code? Open in Web Editor NEW
464.0 15.0 102.0 3.7 MB

AKTools is an elegant and simple HTTP API library for AKShare, built for AKSharers!

Home Page: https://aktools.akfamily.xyz/

License: MIT License

Python 87.52% Dockerfile 2.17% HTML 8.83% Mako 1.48%
data-science data akshare fastapi asyncio pydanti openapi

aktools's Introduction

《AKShare-初阶-使用教学》视频课程已经上线,本课程手把手讲解 AKShare 和 AKTools 的环境配置和安装使用,还包含了众多衍生知识,详情点击链接! Tips:加入 AKShare VIP 答疑群可以免费获取该视频课程。

PyPI - Python Version PyPI Downloads Documentation Status Ruff aktools Actions Status MIT Licence code style: prettier

AKTools

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 中文文档

Installation

pip install aktools

Upgrade

pip install aktools --upgrade -i https://pypi.org/simple  # AKTools's version should great than 0.0.70

AKShare

Please visit AKShare's Documentation

FastAPI

Please visit FastAPI's Documentation

Typer

Please visit Typer's Documentation

Fast Run

  1. just type the cmd/bash command: python -m aktools
  2. then type http://127.0.0.1:8080/ in your Chrome and you can fetch your homepage and more information
  3. if you just want to test data api, you can type http://127.0.0.1:8080/api/public/stock_zh_a_hist in your Chrome
  4. if you want to set parameter for API, then you just type like http://127.0.0.1:8080/api/public/stock_zh_a_hist?symbol=600000

Homepage

AKTools 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!

Demo

Test-Postman

Test-R

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

         日期    开盘    收盘    最高    最低      成交量     成交额    振幅  涨跌幅  涨跌额 换手率
1  2021-11-09 3009.83 3017.96 3037.46 2974.07 1240573 2163193120 2.11   0.60  17.88   0.64
2  2021-11-10 3006.58 2996.83 3008.20 2957.82 1220851 2109735152 1.67  -0.70 -21.13   0.63
3  2021-11-11 2988.70 3151.23 3164.23 2983.82 2084729 3752413856 6.02   5.15 154.40   1.07
4  2021-11-12 3144.73 3138.23 3196.74 3112.22  957546 1753072720 2.68  -0.41 -13.00   0.49
5  2021-11-15 3151.23 3164.23 3196.74 3126.85  655090 1203764096 2.23   0.83  26.00   0.34
6  2021-11-16 3152.85 3130.10 3182.11 3121.97  601110 1099113408 1.90  -1.08 -34.13   0.31
7  2021-11-17 3118.72 3112.22 3143.10 3091.09  664640 1203859184 1.66  -0.57 -17.88   0.34
8  2021-11-18 3108.97 3061.84 3113.85 3050.46  799844 1430058304 2.04  -1.62 -50.38   0.41
9  2021-11-19 3061.84 3118.72 3133.35 3045.58  786372 1414506384 2.87   1.86  56.88   0.41
10 2021-11-22 3099.22 3113.85 3134.97 3078.09  738618 1337768176 1.82  -0.16  -4.87   0.38
11 2021-11-23 3112.22 3074.84 3151.23 3042.33 1235978 2213817584 3.50  -1.25 -39.01   0.64
12 2021-11-24 3056.96 3073.21 3086.22 3039.08  741311 1316774400 1.53  -0.05  -1.63   0.38
13 2021-11-25 3052.09 3042.33 3060.21 3034.21  603533 1068221312 0.85  -1.00 -30.88   0.31
14 2021-11-26 3032.58 3026.08 3040.71 3016.33  694500 1219937312 0.80  -0.53 -16.25   0.36
15 2021-11-29 2998.45 3014.70 3024.46 2990.33  512595  895105984 1.13  -0.38 -11.38   0.26
16 2021-11-30 3019.58 3003.33 3042.33 2988.70  733616 1280384560 1.78  -0.38 -11.37   0.38
17 2021-12-01 3001.70 3035.83 3056.96 2991.95  706925 1243666848 2.16   1.08  32.50   0.36
18 2021-12-02 3032.58 3027.71 3063.46 2991.95  994798 1749164560 2.36  -0.27  -8.12   0.51
19 2021-12-03 3035.83 3037.46 3045.58 2998.45  707600 1242375056 1.56   0.32   9.75   0.36
20 2021-12-06 3069.96 3110.60 3185.36 3061.84 2145625 3896385168 4.07   2.41  73.14   1.11
21 2021-12-07 3143.10 3169.11 3203.24 3118.72 1616444 2979968976 2.72   1.88  58.51   0.83
22 2021-12-08 3167.48 3170.73 3183.73 3120.35  980281 1798691056 2.00   0.05   1.62   0.51
23 2021-12-09 3173.98 3208.11 3266.62 3154.48 1455887 2726663440 3.54   1.18  37.38   0.75

Test-MATLAB

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

'2021-11-09'	3009.83000000000	3017.96000000000	3037.46000000000	2974.07000000000	1240573	2163193120.00000	2.11000000000000	0.600000000000000	17.8800000000000	0.640000000000000
'2021-11-10'	3006.58000000000	2996.83000000000	3008.20000000000	2957.82000000000	1220851	2109735152.00000	1.67000000000000	-0.700000000000000	-21.1300000000000	0.630000000000000
'2021-11-11'	2988.70000000000	3151.23000000000	3164.23000000000	2983.82000000000	2084729	3752413856.00000	6.02000000000000	5.15000000000000	154.400000000000	1.07000000000000
'2021-11-12'	3144.73000000000	3138.23000000000	3196.74000000000	3112.22000000000	957546	1753072720.00000	2.68000000000000	-0.410000000000000	-13	0.490000000000000
'2021-11-15'	3151.23000000000	3164.23000000000	3196.74000000000	3126.85000000000	655090	1203764096.00000	2.23000000000000	0.830000000000000	26	0.340000000000000
'2021-11-16'	3152.85000000000	3130.10000000000	3182.11000000000	3121.97000000000	601110	1099113408.00000	1.90000000000000	-1.08000000000000	-34.1300000000000	0.310000000000000
'2021-11-17'	3118.72000000000	3112.22000000000	3143.10000000000	3091.09000000000	664640	1203859184.00000	1.66000000000000	-0.570000000000000	-17.8800000000000	0.340000000000000
'2021-11-18'	3108.97000000000	3061.84000000000	3113.85000000000	3050.46000000000	799844	1430058304.00000	2.04000000000000	-1.62000000000000	-50.3800000000000	0.410000000000000
'2021-11-19'	3061.84000000000	3118.72000000000	3133.35000000000	3045.58000000000	786372	1414506384.00000	2.87000000000000	1.86000000000000	56.8800000000000	0.410000000000000
'2021-11-22'	3099.22000000000	3113.85000000000	3134.97000000000	3078.09000000000	738618	1337768176.00000	1.82000000000000	-0.160000000000000	-4.87000000000000	0.380000000000000
'2021-11-23'	3112.22000000000	3074.84000000000	3151.23000000000	3042.33000000000	1235978	2213817584.00000	3.50000000000000	-1.25000000000000	-39.0100000000000	0.640000000000000
'2021-11-24'	3056.96000000000	3073.21000000000	3086.22000000000	3039.08000000000	741311	1316774400.00000	1.53000000000000	-0.0500000000000000	-1.63000000000000	0.380000000000000
'2021-11-25'	3052.09000000000	3042.33000000000	3060.21000000000	3034.21000000000	603533	1068221312.00000	0.850000000000000	-1	-30.8800000000000	0.310000000000000
'2021-11-26'	3032.58000000000	3026.08000000000	3040.71000000000	3016.33000000000	694500	1219937312.00000	0.800000000000000	-0.530000000000000	-16.2500000000000	0.360000000000000
'2021-11-29'	2998.45000000000	3014.70000000000	3024.46000000000	2990.33000000000	512595	895105984	1.13000000000000	-0.380000000000000	-11.3800000000000	0.260000000000000
'2021-11-30'	3019.58000000000	3003.33000000000	3042.33000000000	2988.70000000000	733616	1280384560.00000	1.78000000000000	-0.380000000000000	-11.3700000000000	0.380000000000000
'2021-12-01'	3001.70000000000	3035.83000000000	3056.96000000000	2991.95000000000	706925	1243666848.00000	2.16000000000000	1.08000000000000	32.5000000000000	0.360000000000000
'2021-12-02'	3032.58000000000	3027.71000000000	3063.46000000000	2991.95000000000	994798	1749164560.00000	2.36000000000000	-0.270000000000000	-8.12000000000000	0.510000000000000
'2021-12-03'	3035.83000000000	3037.46000000000	3045.58000000000	2998.45000000000	707600	1242375056.00000	1.56000000000000	0.320000000000000	9.75000000000000	0.360000000000000
'2021-12-06'	3069.96000000000	3110.60000000000	3185.36000000000	3061.84000000000	2145625	3896385168.00000	4.07000000000000	2.41000000000000	73.1400000000000	1.11000000000000
'2021-12-07'	3143.10000000000	3169.11000000000	3203.24000000000	3118.72000000000	1616444	2979968976.00000	2.72000000000000	1.88000000000000	58.5100000000000	0.830000000000000
'2021-12-08'	3167.48000000000	3170.73000000000	3183.73000000000	3120.35000000000	980281	1798691056.00000	2	0.0500000000000000	1.62000000000000	0.510000000000000
'2021-12-09'	3173.98000000000	3208.11000000000	3266.62000000000	3154.48000000000	1455887	2726663440.00000	3.54000000000000	1.18000000000000	37.3800000000000	0.750000000000000

Test-Rust

Rust-Program

use reqwest::blocking;
use serde_json::Value;
use std::collections::HashMap;

// 定义常量,用于存储API的URL。
const URL: &str = "http://127.0.0.1:8080/api/public";

/// 获取股票数据的函数。
///
/// # 参数
/// * `symbol` - 股票代码。
/// * `period` - 时间周期。
/// * `start_date` - 开始日期。
/// * `end_date` - 结束日期。
/// * `adjust` - 复权类型。
///
/// # 返回值
/// 返回一个Result,如果成功返回空的Ok,如果失败返回错误。
fn get_data(
    endpoint: &str,
    symbol: &str,
    period: &str,
    start_date: &str,
    end_date: &str,
    adjust: &str,
) -> Result<(), Box<dyn std::error::Error>> {
    // 初始化查询参数,使用提供的函数参数。
    let params = HashMap::from([
        ("symbol", symbol),
        ("period", period),
        ("start_date", start_date),
        ("end_date", end_date),
        ("adjust", adjust),
    ]);

    // 创建一个阻塞的HTTP客户端。
    let client = blocking::Client::new();
    // 构建HTTP GET请求,并将查询参数附加到请求上。
    let full_url = format!("{}/{}", URL, endpoint);
    let resp = client.get(full_url).query(&params).send()?;

    // 检查响应状态码是否表示成功。
    if resp.status().is_success() {
        // 解析响应体为JSON并打印。
        let stock_data_list: Value = resp.json()?;
        println!("{:#?}", stock_data_list);
    } else {
        // 如果响应不是成功的,则打印错误信息。
        eprintln!("请求失败,状态码为: {}", resp.status());
    }

    Ok(())
}

fn main() {
    // 调用`get_data`函数,并传递股票参数。
    // 如果出现错误,则打印错误信息。
    if let Err(e) = get_data("stock_zh_a_hist", "000001", "daily", "20240125", "20240127", "") {
        eprintln!("发生错误: {}", e);
    }
}

MATLAB-Result

Array [
    Object {
        "开盘": Number(9.33),
        "成交量": Number(2162514),
        "成交额": Number(2037648413.07),
        "振幅": Number(2.89),
        "换手率": Number(1.11),
        "收盘": Number(9.5),
        "日期": String("2024-01-25T00:00:00.000"),
        "最低": Number(9.27),
        "最高": Number(9.54),
        "涨跌幅": Number(1.82),
        "涨跌额": Number(0.17),
    },
    Object {
        "开盘": Number(9.47),
        "成交量": Number(2272287),
        "成交额": Number(2172799799.01),
        "振幅": Number(2.42),
        "换手率": Number(1.17),
        "收盘": Number(9.62),
        "日期": String("2024-01-26T00:00:00.000"),
        "最低": Number(9.44),
        "最高": Number(9.67),
        "涨跌幅": Number(1.26),
        "涨跌额": Number(0.12),
    },
]

aktools's People

Contributors

albertandking avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

aktools's Issues

返回服务器详细错误代码

接口:stock_gdfx_free_top_10_em
读取sz000420 (吉林化纤)2022-3-31的十大流通股东,返回错误:
image

在cmd窗口里显示的错误为:
image

希望返回Http错误时,能返回这行:ValueError: Length mismatch: Expected axis has 1 elements, new values have 12 elements。
以便可以根据具体的原因选择代码执行路径。

Can't use aktools-0.0.83 with python 3.8.10 on mac 64 ( akshare-1.9.97)

P_D-MB0:Desktop xan$ python3 -m aktools
请访问:http://127.0.0.1:8080/version 来获取最新的库版本信息,确保使用最新版本的 AKShare 和 AKTools
当前的 AKTools 版本为:0.0.83,AKShare 版本为:1.9.97
点击打开 HTTP API 主页:http://127.0.0.1:8080/
点击打开接口导览:http://127.0.0.1:8080/docs
/usr/bin/python: No module named uvicorn
P_D-MB0:Desktop xan$ lsof -i:8080
P_D-MB0:Desktop xan:Desktop xianxian$

open http://127.0.0.1:8080/version, show:
无法访问此网站127.0.0.1 拒绝了我们的连接请求。
请试试以下办法:

检查网络连接
检查代理服务器和防火墙
ERR_CONNECTION_REFUSED

AttributeError: module 'click.utils' has no attribute ._expand_args. i was able to set up server using 'python -m aktools'. but i cant now.

i updated my aktools to latest version. and run these code to set up server.

python -m aktools

error messages

╭─────────────────────────────── Traceback (most recent call last) ────────────────────────────────╮
│ C:\Users\tyehuo\scoop\apps\pyenv\current\pyenv-win\versions\3.9.7\Lib\runpy.py:197 in            │
│ _run_module_as_main                                                                              │
│                                                                                                  │
│   194 │   main_globals = sys.modules["__main__"].__dict__                                        │
│   195 │   if alter_argv:                                                                         │
│   196 │   │   sys.argv[0] = mod_spec.origin                                                      │
│ ❱ 197 │   return _run_code(code, main_globals, None,                                             │
│   198 │   │   │   │   │    "__main__", mod_spec)                                                 │
│   199                                                                                            │
│   200 def run_module(mod_name, init_globals=None,                                                │
│                                                                                                  │
│ ╭─────────────────────────────────────────── locals ───────────────────────────────────────────╮ │
│ │   alter_argv = True                                                                          │ │
│ │         code = <code object <module> at 0x000002972A1E5C90, file                             │ │
│ │                "C:\Users\tyehuo\scoop\apps\pyenv\current\pyenv-win\versions\3.9.7\lib\site-… │ │
│ │                line 3>                                                                       │ │
│ │ main_globals = {                                                                             │ │
│ │                │   '__name__': '__main__',                                                   │ │
│ │                │   '__doc__': '\nDate: 2022/9/27 19:05\nDesc: CLI 执行入口文件\n运行 `pytho… │ │
│ │                -m aktools` 相当于运行 `python -m '+21,                                       │ │
│ │                │   '__package__': 'aktools',                                                 │ │
│ │                │   '__loader__': <_frozen_importlib_external.SourceFileLoader object at      │ │
│ │                0x0000029729AAD160>,                                                          │ │
│ │                │   '__spec__': ModuleSpec(name='aktools.__main__',                           │ │
│ │                loader=<_frozen_importlib_external.SourceFileLoader object at                 │ │
│ │                0x0000029729AAD160>,                                                          │ │
│ │                origin='C:\\Users\\tyehuo\\scoop\\apps\\pyenv\\current\\pyenv-win\\versions\… │ │
│ │                │   '__annotations__': {},                                                    │ │
│ │                │   '__builtins__': <module 'builtins' (built-in)>,                           │ │
│ │                │   '__file__':                                                               │ │
│ │                'C:\\Users\\tyehuo\\scoop\\apps\\pyenv\\current\\pyenv-win\\versions\\3.9.7\… │ │
│ │                │   '__cached__':                                                             │ │
│ │                'C:\\Users\\tyehuo\\scoop\\apps\\pyenv\\current\\pyenv-win\\versions\\3.9.7\… │ │
│ │                │   'cli': <module 'aktools.cli' from                                         │ │
│ │                'C:\\Users\\tyehuo\\scoop\\apps\\pyenv\\current\\pyenv-win\\versions\\3.9.7\… │ │
│ │                │   ... +2                                                                    │ │
│ │                }                                                                             │ │
│ │     mod_name = 'aktools.__main__'                                                            │ │
│ │     mod_spec = ModuleSpec(name='aktools.__main__',                                           │ │
│ │                loader=<_frozen_importlib_external.SourceFileLoader object at                 │ │
│ │                0x0000029729AAD160>,                                                          │ │
│ │                origin='C:\\Users\\tyehuo\\scoop\\apps\\pyenv\\current\\pyenv-win\\versions\… │ │
│ ╰──────────────────────────────────────────────────────────────────────────────────────────────╯ │
│                                                                                                  │
│ C:\Users\tyehuo\scoop\apps\pyenv\current\pyenv-win\versions\3.9.7\Lib\runpy.py:87 in _run_code   │
│                                                                                                  │
│    84 │   │   │   │   │      __loader__ = loader,                                                │
│    85 │   │   │   │   │      __package__ = pkg_name,                                             │
│    86 │   │   │   │   │      __spec__ = mod_spec)                                                │
│ ❱  87 │   exec(code, run_globals)                                                                │
│    88 │   return run_globals                                                                     │
│    89                                                                                            │
│    90 def _run_module_code(code, init_globals=None,                                              │
│                                                                                                  │
│ ╭─────────────────────────────────────────── locals ───────────────────────────────────────────╮ │
│ │       cached = 'C:\\Users\\tyehuo\\scoop\\apps\\pyenv\\current\\pyenv-win\\versions\\3.9.7\… │ │
│ │         code = <code object <module> at 0x000002972A1E5C90, file                             │ │
│ │                "C:\Users\tyehuo\scoop\apps\pyenv\current\pyenv-win\versions\3.9.7\lib\site-… │ │
│ │                line 3>                                                                       │ │
│ │        fname = 'C:\\Users\\tyehuo\\scoop\\apps\\pyenv\\current\\pyenv-win\\versions\\3.9.7\… │ │
│ │ init_globals = None                                                                          │ │
│ │       loader = <_frozen_importlib_external.SourceFileLoader object at 0x0000029729AAD160>    │ │
│ │     mod_name = '__main__'                                                                    │ │
│ │     mod_spec = ModuleSpec(name='aktools.__main__',                                           │ │
│ │                loader=<_frozen_importlib_external.SourceFileLoader object at                 │ │
│ │                0x0000029729AAD160>,                                                          │ │
│ │                origin='C:\\Users\\tyehuo\\scoop\\apps\\pyenv\\current\\pyenv-win\\versions\… │ │
│ │     pkg_name = 'aktools'                                                                     │ │
│ │  run_globals = {                                                                             │ │
│ │                │   '__name__': '__main__',                                                   │ │
│ │                │   '__doc__': '\nDate: 2022/9/27 19:05\nDesc: CLI 执行入口文件\n运行 `pytho… │ │
│ │                -m aktools` 相当于运行 `python -m '+21,                                       │ │
│ │                │   '__package__': 'aktools',                                                 │ │
│ │                │   '__loader__': <_frozen_importlib_external.SourceFileLoader object at      │ │
│ │                0x0000029729AAD160>,                                                          │ │
│ │                │   '__spec__': ModuleSpec(name='aktools.__main__',                           │ │
│ │                loader=<_frozen_importlib_external.SourceFileLoader object at                 │ │
│ │                0x0000029729AAD160>,                                                          │ │
│ │                origin='C:\\Users\\tyehuo\\scoop\\apps\\pyenv\\current\\pyenv-win\\versions\… │ │
│ │                │   '__annotations__': {},                                                    │ │
│ │                │   '__builtins__': <module 'builtins' (built-in)>,                           │ │
│ │                │   '__file__':                                                               │ │
│ │                'C:\\Users\\tyehuo\\scoop\\apps\\pyenv\\current\\pyenv-win\\versions\\3.9.7\… │ │
│ │                │   '__cached__':                                                             │ │
│ │                'C:\\Users\\tyehuo\\scoop\\apps\\pyenv\\current\\pyenv-win\\versions\\3.9.7\… │ │
│ │                │   'cli': <module 'aktools.cli' from                                         │ │
│ │                'C:\\Users\\tyehuo\\scoop\\apps\\pyenv\\current\\pyenv-win\\versions\\3.9.7\… │ │
│ │                │   ... +2                                                                    │ │
│ │                }                                                                             │ │
│ │  script_name = None                                                                          │ │
│ ╰──────────────────────────────────────────────────────────────────────────────────────────────╯ │
│                                                                                                  │
│ C:\Users\tyehuo\scoop\apps\pyenv\current\pyenv-win\versions\3.9.7\lib\site-packages\aktools\__ma │
│ in__.py:16 in <module>                                                                           │
│                                                                                                  │
│   13                                                                                             │
│   14                                                                                             │
│   15 if __name__ == "__main__":                                                                  │
│ ❱ 16 │   main()                                                                                  │
│   17                                                                                             │
│                                                                                                  │
│ ╭─────────────────────────────────────────── locals ───────────────────────────────────────────╮ │
│ │ __annotations__ = {}                                                                         │ │
│ │    __builtins__ = <module 'builtins' (built-in)>                                             │ │
│ │      __cached__ = 'C:\\Users\\tyehuo\\scoop\\apps\\pyenv\\current\\pyenv-win\\versions\\3.9… │ │
│ │         __doc__ = '\nDate: 2022/9/27 19:05\nDesc: CLI 执行入口文件\n运行 `python -m aktools… │ │
│ │                   相当于运行 `python -m '+21                                                 │ │
│ │        __file__ = 'C:\\Users\\tyehuo\\scoop\\apps\\pyenv\\current\\pyenv-win\\versions\\3.9… │ │
│ │      __loader__ = <_frozen_importlib_external.SourceFileLoader object at 0x0000029729AAD160> │ │
│ │        __name__ = '__main__'                                                                 │ │
│ │     __package__ = 'aktools'                                                                  │ │
│ │        __spec__ = ModuleSpec(name='aktools.__main__',                                        │ │
│ │                   loader=<_frozen_importlib_external.SourceFileLoader object at              │ │
│ │                   0x0000029729AAD160>,                                                       │ │
│ │                   origin='C:\\Users\\tyehuo\\scoop\\apps\\pyenv\\current\\pyenv-win\\versio… │ │
│ │       __title__ = 'AKTools'                                                                  │ │
│ │             cli = <module 'aktools.cli' from                                                 │ │
│ │                   'C:\\Users\\tyehuo\\scoop\\apps\\pyenv\\current\\pyenv-win\\versions\\3.9… │ │
│ │            main = <function main at 0x0000029729A6FF70>                                      │ │
│ ╰──────────────────────────────────────────────────────────────────────────────────────────────╯ │
│                                                                                                  │
│ C:\Users\tyehuo\scoop\apps\pyenv\current\pyenv-win\versions\3.9.7\lib\site-packages\aktools\__ma │
│ in__.py:12 in main                                                                               │
│                                                                                                  │
│    9                                                                                             │
│   10                                                                                             │
│   11 def main():                                                                                 │
│ ❱ 12 │   cli.app(prog_name=__title__)                                                            │
│   13                                                                                             │
│   14                                                                                             │
│   15 if __name__ == "__main__":                                                                  │
│                                                                                                  │
│ C:\Users\tyehuo\scoop\apps\pyenv\current\pyenv-win\versions\3.9.7\lib\site-packages\typer\main.p │
│ y:328 in __call__                                                                                │
│                                                                                                  │
│ C:\Users\tyehuo\scoop\apps\pyenv\current\pyenv-win\versions\3.9.7\lib\site-packages\typer\main.p │
│ y:311 in __call__                                                                                │
│                                                                                                  │
│ C:\Users\tyehuo\scoop\apps\pyenv\current\pyenv-win\versions\3.9.7\lib\site-packages\click\core.p │
│ y:829 in __call__                                                                                │
│                                                                                                  │
│ C:\Users\tyehuo\scoop\apps\pyenv\current\pyenv-win\versions\3.9.7\lib\site-packages\typer\core.p │
│ y:716 in main                                                                                    │
│                                                                                                  │
│ C:\Users\tyehuo\scoop\apps\pyenv\current\pyenv-win\versions\3.9.7\lib\site-packages\typer\core.p │
│ y:190 in _main                                                                                   │
╰──────────────────────────────────────────────────────────────────────────────────────────────────╯
AttributeError: module 'click.utils' has no attribute '_expand_args'

docker pull提示denied: requested access to the resource is denied

docker pull提示denied: requested access to the resource is denied

>docker pull registry.cn-beijing.aliyuncs.com/ms-jupyter/ak_tools:v1.0.5
Error response from daemon: pull access denied for registry.cn-beijing.aliyuncs.com/ms-jupyter/ak_tools, repository does not exist or may require 'docker login': denied: requested access to the resource is denied
`

有人有公共的HTTP供调用嘛?

观察了下AKTools的接口基本都是爬虫型接口,不涉及CPU密集型,有哪位大大有空闲的服务器装下docker,我们也好直接调用啊.......不胜感激

stock_news_em调用报错

stock_news_em函数在akshare的python环境下调用正常,在docker部署后,以http访问:

http://192.168.1.61:8280/api/public/stock_news_em?symbol=002771

报错如下:

{
error: "请输入正确的参数错误 'cmsArticleWebOld',请升级 AKShare 到最新版本并在文档中确认该接口的使用方式:https://www.akshare.xyz"
}

docker 中的 akshare 已经升级到最新版本,错误依旧。

如何部署在云主机

感谢作者修复,最新的版本终于可以运行了。另外一个问题,我再我的腾讯云上运行这个服务,本地电脑用服务器ip无法访问,这个权限哪里可以开启?

LPR数据没有返回日期字段

aktools安装和运行指令:
docker run -di -p 8080:8080 registry.cn-shanghai.aliyuncs.com/akfamily/aktools:1.3.93 python -m aktools
docker run -p 8080:8080 registry.cn-shanghai.aliyuncs.com/akfamily/aktools:1.3.93 python -m aktools --host 0.0.0.0 --port 8080
访问LPR返回数据:
image
文档是有日期字段:
image
文档地址:https://www.akshare.xyz/data/macro/macro.html?highlight=lpr#lpr
是版本不对还是啥情况?
理论上按照文档意思我安装的应该是最新的吧
image

使用淘股吧股票热度接口时候报错

我在测试淘股吧的股票热度的时候,应用接口报错,请问这是什么情况呀?
我看用户手册里面也没说要输入参数?

以下是使用的报错情况

股票热度-淘股吧
接口: stock_hot_tgb

目标地址: https://www.taoguba.com.cn/stock/moreHotStock

描述: 淘股吧-热门股票

限量: 单次返回排名前 20 股票

输入参数

名称 类型 描述


输出参数

名称 类型 描述
个股代码 object -
个股名称 object -
接口示例

import akshare as ak

stock_hot_tgb_df = ak.stock_hot_tgb()
print(stock_hot_tgb_df)

---------------------------------------------------------------------------
IndexError                                Traceback (most recent call last)
[c:\Users\Frank\Synology\0Programing\AutoDailyReport.ipynb](file:///C:/Users/Frank/Synology/0Programing/AutoDailyReport.ipynb) 单元格 15 line 2
      [1](vscode-notebook-cell:/c%3A/Users/Frank/Synology/0Programing/AutoDailyReport.ipynb#X24sZmlsZQ%3D%3D?line=0) # 股票热度-淘股吧
      [2](vscode-notebook-cell:/c%3A/Users/Frank/Synology/0Programing/AutoDailyReport.ipynb#X24sZmlsZQ%3D%3D?line=1) # 接口: stock_hot_tgb
      [3](vscode-notebook-cell:/c%3A/Users/Frank/Synology/0Programing/AutoDailyReport.ipynb#X24sZmlsZQ%3D%3D?line=2) 
   (...)
     [20](vscode-notebook-cell:/c%3A/Users/Frank/Synology/0Programing/AutoDailyReport.ipynb#X24sZmlsZQ%3D%3D?line=19) 
     [21](vscode-notebook-cell:/c%3A/Users/Frank/Synology/0Programing/AutoDailyReport.ipynb#X24sZmlsZQ%3D%3D?line=20) # import akshare as ak
---> [23](vscode-notebook-cell:/c%3A/Users/Frank/Synology/0Programing/AutoDailyReport.ipynb#X24sZmlsZQ%3D%3D?line=22) stock_hot_tgb_df = ak.stock_hot_tgb()
     [24](vscode-notebook-cell:/c%3A/Users/Frank/Synology/0Programing/AutoDailyReport.ipynb#X24sZmlsZQ%3D%3D?line=23) print(stock_hot_tgb_df)
     [25](vscode-notebook-cell:/c%3A/Users/Frank/Synology/0Programing/AutoDailyReport.ipynb#X24sZmlsZQ%3D%3D?line=24) # 数据示例
     [26](vscode-notebook-cell:/c%3A/Users/Frank/Synology/0Programing/AutoDailyReport.ipynb#X24sZmlsZQ%3D%3D?line=25) 
     [27](vscode-notebook-cell:/c%3A/Users/Frank/Synology/0Programing/AutoDailyReport.ipynb#X24sZmlsZQ%3D%3D?line=26) #         个股代码  个股名称
   (...)
     [46](vscode-notebook-cell:/c%3A/Users/Frank/Synology/0Programing/AutoDailyReport.ipynb#X24sZmlsZQ%3D%3D?line=45) # 18  sz002264   新华都
     [47](vscode-notebook-cell:/c%3A/Users/Frank/Synology/0Programing/AutoDailyReport.ipynb#X24sZmlsZQ%3D%3D?line=46) # 19  sz301088  戎美股份

File [c:\Users\Frank\AppData\Local\Programs\Python\Python311\Lib\site-packages\akshare\stock_feature\stock_hot_tgb.py:21](file:///C:/Users/Frank/AppData/Local/Programs/Python/Python311/Lib/site-packages/akshare/stock_feature/stock_hot_tgb.py:21), in stock_hot_tgb()
     [19](file:///C:/Users/Frank/AppData/Local/Programs/Python/Python311/Lib/site-packages/akshare/stock_feature/stock_hot_tgb.py:19) url = "https://www.taoguba.com.cn/stock/moreHotStock"
     [20](file:///C:/Users/Frank/AppData/Local/Programs/Python/Python311/Lib/site-packages/akshare/stock_feature/stock_hot_tgb.py:20) r = requests.get(url)
---> [21](file:///C:/Users/Frank/AppData/Local/Programs/Python/Python311/Lib/site-packages/akshare/stock_feature/stock_hot_tgb.py:21) temp_df = pd.concat([pd.read_html(r.text, header=0)[0], pd.read_html(r.text, header=0)[1]])
     [22](file:///C:/Users/Frank/AppData/Local/Programs/Python/Python311/Lib/site-packages/akshare/stock_feature/stock_hot_tgb.py:22) temp_df = temp_df[[
     [23](file:///C:/Users/Frank/AppData/Local/Programs/Python/Python311/Lib/site-packages/akshare/stock_feature/stock_hot_tgb.py:23)     "个股代码",
     [24](file:///C:/Users/Frank/AppData/Local/Programs/Python/Python311/Lib/site-packages/akshare/stock_feature/stock_hot_tgb.py:24)     "个股名称",
     [25](file:///C:/Users/Frank/AppData/Local/Programs/Python/Python311/Lib/site-packages/akshare/stock_feature/stock_hot_tgb.py:25) ]]
     [26](file:///C:/Users/Frank/AppData/Local/Programs/Python/Python311/Lib/site-packages/akshare/stock_feature/stock_hot_tgb.py:26) temp_df.reset_index(inplace=True, drop=True)

IndexError: list index out of range



bond_cb_jsl传参集思录cookie,因cookie中包含等号(=)和分号(;)报非法字符错误

集思录的cookie中包含多个等号,使用akshare.bond_cb_jsl(cookie='集思录cookie')可以正常返回结果。
但在使用aktools的时候,就报非法字符错误。具体问题如下:

当使用get方式访问bond_cb_jsl时,传入下面的cookie:
kbzw__Session=h3l4slhht553flu9cm74qn9du4;kbz_newcookie=1;Hm_lvt_164fe01b1433a19b507595a43bf58262=1658471335;kbzw__user_login=7Obd08_P1ebax9aXXBInRw8mXCP5Vur_mrCW6c3q1e3Q6dvR1YzUmKTe2KGrz9qS3JTZ2qutlKfDpdrbmtqkqcWvx6naqZmcndbd3dPGpJ2nmK-ZrauUs47FotLWoLbo5uDO4sKmrKGogZi43efZ2PDfl7DKgainoaickLjd56udtIzvmKqKl7jj6M3VuNnbwNLtm6yVrY-qrZOgrLi1wcWhieXV4seWqNza3ueKkKTc6-TW3puokqmPp6WjppGQtNXf1tvim6yVrY-qrQ..;Hm_lpvt_164fe01b1433a19b507595a43bf58262=1660542006

报错信息截图:
image

报错信息文本:

ak.bond_cb_jsl(cookie="kbzw__Session="h3l4slhht553flu9cm74qn9du4", kbz_newcookie="1", Hm_lvt_164fe01b1433a19b507595a43bf58262="1658471335", kbzw__user_login="7Obd08_P1ebax9aXXBInRw8mXCP5Vur_mrCW6c3q1e3Q6dvR1YzUmKTe2KGrz9qS3JTZ2qutlKfDpdrbmtqkqcWvx6naqZmcndbd3dPGpJ2nmK-ZrauUs47FotLWoLbo5uDO4sKmrKGogZi43efZ2PDfl7DKgainoaickLjd56udtIzvmKqKl7jj6M3VuNnbwNLtm6yVrY-qrZOgrLi1wcWhieXV4seWqNza3ueKkKTc6-TW3puokqmPp6WjppGQtNXf1tvim6yVrY-qrQ..", Hm_lpvt_164fe01b1433a19b507595a43bf58262="1660542006")
                                                               ^

SyntaxError: invalid syntax

可以看到,get方式调用后,ak.bond_cb_jsl(cookie=....) 应该拼接成ak.bond_cb_jsl(cookie='集思录cookie')的格式,实际却成了上面报错信息里的格式。拜读了您api.py中的代码,发现代码一遇到等号(=)就会在等号后面加上引号,这个逻辑在只有一个等号,例如https://172.0.0.1:8080?/api/public/bond_cb_jsl?cookie=abcdefg
的时候可以正常运行,但是在传入的参数字符串值内有等号(如上文给出的cookie)的时候,就会报错。

希望兄台抽空修复此bug,谢谢。

=========================================================

另外我将上文报错信息中aktools生成的akshare的语句:
ak.bond_cb_jsl(cookie="kbzw__Session="h3l4slhht553flu9cm74qn9du4", kbz_newcookie="1", Hm_lvt_164fe01b1433a19b507595a43bf58262="1658471335", kbzw__user_login="7Obd08_P1ebax9aXXBInRw8mXCP5Vur_mrCW6c3q1e3Q6dvR1YzUmKTe2KGrz9qS3JTZ2qutlKfDpdrbmtqkqcWvx6naqZmcndbd3dPGpJ2nmK-ZrauUs47FotLWoLbo5uDO4sKmrKGogZi43efZ2PDfl7DKgainoaickLjd56udtIzvmKqKl7jj6M3VuNnbwNLtm6yVrY-qrZOgrLi1wcWhieXV4seWqNza3ueKkKTc6-TW3puokqmPp6WjppGQtNXf1tvim6yVrY-qrQ..", Hm_lpvt_164fe01b1433a19b507595a43bf58262="1660542006")

中额外的引号(")去掉,在python中执行,也无法取到全部结果,经查原cookie中的分号(;)在api,py中先被替换成了(&)连接符进而又被replace成了逗号(,)手动将逗号(,)替换回原cookie中的分号(;)得到:
ak.bond_cb_jsl(cookie="kbzw__Session=h3l4slhht553flu9cm74qn9du4;kbz_newcookie=1;Hm_lvt_164fe01b1433a19b507595a43bf58262=1658471335;kbzw__user_login=7Obd08_P1ebax9aXXBInRw8mXCP5Vur_mrCW6c3q1e3Q6dvR1YzUmKTe2KGrz9qS3JTZ2qutlKfDpdrbmtqkqcWvx6naqZmcndbd3dPGpJ2nmK-ZrauUs47FotLWoLbo5uDO4sKmrKGogZi43efZ2PDfl7DKgainoaickLjd56udtIzvmKqKl7jj6M3VuNnbwNLtm6yVrY-qrZOgrLi1wcWhieXV4seWqNza3ueKkKTc6-TW3puokqmPp6WjppGQtNXf1tvim6yVrY-qrQ..;Hm_lpvt_164fe01b1433a19b507595a43bf58262=1660542006")

这样在python中执行可以返回正常的全部结果。
image

烦请查看此处。谢谢。

404错误

使用docker模式在云服务器上运行后,无论是在云服务器上请求127.0.0.1或者0.0.0.0+对应端口还是向云服务器发请求,利用docker进行路由转发,都报404错误,如图所示
image

hurun_rank()接口报错,请帮忙修复

akshare最新版本,hurun_rank()接口报错:
hurun_rank_df = hurun_rank(indicator="胡润百富榜", year="2022")
r = requests.get(name_url_map[indicator])
KeyError: '胡润百富榜'

http接口调用全球指数数据报内部服务错误

阿里云香港的云服务器ESC
docker部署的aktools。

版本号:

当前的 AKTools 版本为:0.0.81,AKShare 版本为:1.8.40

接口:(尝试过其他国家和指数数据,全是提示:内部服务错误)
http://127.0.0.1:8001/api/public/index_investing_global?area=土耳其&symbol=土耳其ISE National-100&period=每日&start_date=20221220&end_date=20221228

响应:
Internal Server Error

数据源链接:
https://cn.investing.com/indices/ise-100

docker日志:

请访问:http://0.0.0.0:8001/version 来获取最新的库版本信息,确保使用最新版本的 AKShare 和 AKTools
当前的 AKTools 版本为:0.0.81,AKShare 版本为:1.8.40
点击打开 HTTP API 主页:http://0.0.0.0:8001/
点击打开接口导览:http://0.0.0.0:8001/docs
INFO:     Started server process [9]
INFO:     Waiting for application startup.
INFO:     Application startup complete.
INFO:     Uvicorn running on http://0.0.0.0:8001 (Press CTRL+C to quit)
INFO:     103.177.248.233:32896 - "GET /api/public/index_investing_global?area=%E5%9C%9F%E8%80%B3%E5%85%B6&symbol=%E5%9C%9F%E8%80%B3%E5%85%B6ISE%20National-100&start_date=20221220&end_date=20221227&period=%E6%AF%8F%E6%97%A5 HTTP/1.1" 500 Internal Server Error
ERROR:    Exception in ASGI application
Traceback (most recent call last):
  File "/usr/local/lib/python3.11/site-packages/uvicorn/protocols/http/h11_impl.py", line 407, in run_asgi
    result = await app(  # type: ignore[func-returns-value]
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/uvicorn/middleware/proxy_headers.py", line 78, in __call__
    return await self.app(scope, receive, send)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/fastapi/applications.py", line 270, in __call__
    await super().__call__(scope, receive, send)
  File "/usr/local/lib/python3.11/site-packages/starlette/applications.py", line 124, in __call__
    await self.middleware_stack(scope, receive, send)
  File "/usr/local/lib/python3.11/site-packages/starlette/middleware/errors.py", line 184, in __call__
    raise exc
  File "/usr/local/lib/python3.11/site-packages/starlette/middleware/errors.py", line 162, in __call__
    await self.app(scope, receive, _send)
  File "/usr/local/lib/python3.11/site-packages/starlette/middleware/cors.py", line 84, in __call__
    await self.app(scope, receive, send)
  File "/usr/local/lib/python3.11/site-packages/starlette/middleware/exceptions.py", line 79, in __call__
    raise exc
  File "/usr/local/lib/python3.11/site-packages/starlette/middleware/exceptions.py", line 68, in __call__
    await self.app(scope, receive, sender)
  File "/usr/local/lib/python3.11/site-packages/fastapi/middleware/asyncexitstack.py", line 21, in __call__
    raise e
  File "/usr/local/lib/python3.11/site-packages/fastapi/middleware/asyncexitstack.py", line 18, in __call__
    await self.app(scope, receive, send)
  File "/usr/local/lib/python3.11/site-packages/starlette/routing.py", line 706, in __call__
    await route.handle(scope, receive, send)
  File "/usr/local/lib/python3.11/site-packages/starlette/routing.py", line 276, in handle
    await self.app(scope, receive, send)
  File "/usr/local/lib/python3.11/site-packages/starlette/routing.py", line 66, in app
    response = await func(request)
               ^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/fastapi/routing.py", line 235, in app
    raw_response = await run_endpoint_function(
                   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/fastapi/routing.py", line 163, in run_endpoint_function
    return await run_in_threadpool(dependant.call, **values)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/starlette/concurrency.py", line 41, in run_in_threadpool
    return await anyio.to_thread.run_sync(func, *args)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/anyio/to_thread.py", line 31, in run_sync
    return await get_asynclib().run_sync_in_worker_thread(
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/anyio/_backends/_asyncio.py", line 937, in run_sync_in_worker_thread
    return await future
           ^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/anyio/_backends/_asyncio.py", line 867, in run
    result = context.run(func, *args)
             ^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/aktools/core/api.py", line 140, in root
    received_df = eval("ak." + item_id + f"({eval_str})")
                  ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "", line 1, in 
  File "/usr/local/lib/python3.11/site-packages/akshare/index/index_investing.py", line 162, in index_investing_global
    name_code_dict = index_investing_global_area_index_name_code(area)
                     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/akshare/index/index_investing.py", line 89, in index_investing_global_area_index_name_code
    name_url_dict = _get_global_country_name_url()
                    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/akshare/index/index_investing.py", line 68, in _get_global_country_name_url
    ).find_all("option")[
      ^^^^^^^^
AttributeError: 'NoneType' object has no attribute 'find_all'

期待回复,谢谢

centos7 安装报错

sudo pip3 install aktools

报错信息如下:

  Traceback (most recent call last):
      File "/tmp/pip-build-57ny3y4m/pillow/setup.py", line 1024, in <module>
        zip_safe=not (debug_build() or PLATFORM_MINGW),
      File "/usr/lib/python3.6/site-packages/setuptools/__init__.py", line 129, in setup
        return distutils.core.setup(**attrs)
      File "/usr/lib64/python3.6/distutils/core.py", line 148, in setup
        dist.run_commands()
      File "/usr/lib64/python3.6/distutils/dist.py", line 955, in run_commands
        self.run_command(cmd)
      File "/usr/lib64/python3.6/distutils/dist.py", line 974, in run_command
        cmd_obj.run()
      File "/usr/lib/python3.6/site-packages/setuptools/command/install.py", line 61, in run
        return orig.install.run(self)
      File "/usr/lib64/python3.6/distutils/command/install.py", line 556, in run
        self.run_command('build')
      File "/usr/lib64/python3.6/distutils/cmd.py", line 313, in run_command
        self.distribution.run_command(command)
      File "/usr/lib64/python3.6/distutils/dist.py", line 974, in run_command
        cmd_obj.run()
      File "/usr/lib64/python3.6/distutils/command/build.py", line 135, in run
        self.run_command(cmd_name)
      File "/usr/lib64/python3.6/distutils/cmd.py", line 313, in run_command
        self.distribution.run_command(command)
      File "/usr/lib64/python3.6/distutils/dist.py", line 974, in run_command
        cmd_obj.run()
      File "/usr/lib/python3.6/site-packages/setuptools/command/build_ext.py", line 78, in run
        _build_ext.run(self)
      File "/usr/lib64/python3.6/distutils/command/build_ext.py", line 339, in run
        self.build_extensions()
      File "/tmp/pip-build-57ny3y4m/pillow/setup.py", line 790, in build_extensions
        raise RequiredDependencyException(f)
    __main__.RequiredDependencyException: zlib
    
    During handling of the above exception, another exception occurred:
    
    Traceback (most recent call last):
      File "<string>", line 1, in <module>
      File "/tmp/pip-build-57ny3y4m/pillow/setup.py", line 1037, in <module>
        raise RequiredDependencyException(msg)
    __main__.RequiredDependencyException:
    
    The headers or library files could not be found for zlib,
    a required dependency when compiling Pillow from source.
    
    Please see the install instructions at:
       https://pillow.readthedocs.io/en/latest/installation.html
    
    
    
    ----------------------------------------
Command "/usr/bin/python3 -u -c "import setuptools, tokenize;__file__='/tmp/pip-build-57ny3y4m/pillow/setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))" install --record /tmp/pip-cv0r2ps_-record/install-record.txt --single-version-externally-managed --compile" failed with error code 1 in /tmp/pip-build-57ny3y4m/pillow/

使用个股新闻接口出错

个股新闻
接口: stock_news_em

目标地址: http://so.eastmoney.com/news/s

描述: 东方财富指定个股的新闻资讯数据

限量: 当日最近 100 条新闻资讯数据

输入参数

名称 类型 描述
symbol str symbol="300059"; 股票代码或其他关键词
输出参数

名称 类型 描述
关键词 object -
新闻标题 object -
新闻内容 object -
发布时间 object -
文章来源 object -
新闻链接 object -
接口示例


import akshare as ak

stock_news_em_df = ak.stock_news_em(symbol="600000")
stock_news_em_df



KeyError Traceback (most recent call last)
c:\Users\Frank\Synology\0Programing\AutoDailyReport.ipynb 单元格 21 line 2
1 # 个股新闻
2 # 接口: stock_news_em
3
(...)
24
25 # import akshare as ak
---> 27 stock_news_em_df = ak.stock_news_em(symbol="600000")
28 stock_news_em_df
29 # 数据示例
30
31 # 关键词 ... 新闻链接
(...)
41 # 98 300059 ... http://finance.eastmoney.com/a/202207192454107...
42 # 99 300059 ... http://finance.eastmoney.com/a/202206212419852...

File c:\Users\Frank\AppData\Local\Programs\Python\Python311\Lib\site-packages\akshare\news\news_stock.py:36, in stock_news_em(symbol)
32 data_text = r.text
33 data_json = json.loads(
34 data_text.strip("jQuery3510875346244069884_1668256937995(")[:-1]
35 )
---> 36 temp_df = pd.DataFrame(data_json["result"]["cmsArticleWebOld"])
37 temp_df.rename(
38 columns={
39 "date": "发布时间",
(...)
47 inplace=True,
48 )
49 temp_df["关键词"] = symbol

KeyError: 'cmsArticleWebOld'

部署在服务器,访问次数多了,就会报如下多错误

系统 cenos 7

报错如下

ERROR:    Exception in ASGI application
Traceback (most recent call last):
  File "/root/miniconda3/lib/python3.9/site-packages/urllib3/connection.py", line 174, in _new_conn
    conn = connection.create_connection(
  File "/root/miniconda3/lib/python3.9/site-packages/urllib3/util/connection.py", line 95, in create_connection
    raise err
  File "/root/miniconda3/lib/python3.9/site-packages/urllib3/util/connection.py", line 85, in create_connection
    sock.connect(sa)
TimeoutError: [Errno 110] Connection timed out

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/root/miniconda3/lib/python3.9/site-packages/urllib3/connectionpool.py", line 703, in urlopen
    httplib_response = self._make_request(
  File "/root/miniconda3/lib/python3.9/site-packages/urllib3/connectionpool.py", line 398, in _make_request
    conn.request(method, url, **httplib_request_kw)
  File "/root/miniconda3/lib/python3.9/site-packages/urllib3/connection.py", line 239, in request
    super(HTTPConnection, self).request(method, url, body=body, headers=headers)
  File "/root/miniconda3/lib/python3.9/http/client.py", line 1253, in request
    self._send_request(method, url, body, headers, encode_chunked)
  File "/root/miniconda3/lib/python3.9/http/client.py", line 1299, in _send_request
    self.endheaders(body, encode_chunked=encode_chunked)
  File "/root/miniconda3/lib/python3.9/http/client.py", line 1248, in endheaders
    self._send_output(message_body, encode_chunked=encode_chunked)
  File "/root/miniconda3/lib/python3.9/http/client.py", line 1008, in _send_output
    self.send(msg)
  File "/root/miniconda3/lib/python3.9/http/client.py", line 948, in send
    self.connect()
  File "/root/miniconda3/lib/python3.9/site-packages/urllib3/connection.py", line 205, in connect
    conn = self._new_conn()
  File "/root/miniconda3/lib/python3.9/site-packages/urllib3/connection.py", line 186, in _new_conn
    raise NewConnectionError(
urllib3.exceptions.NewConnectionError: <urllib3.connection.HTTPConnection object at 0x7f12a4250be0>: Failed to establish a new connection: [Errno 110] Connection timed out

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/root/miniconda3/lib/python3.9/site-packages/requests/adapters.py", line 440, in send
    resp = conn.urlopen(
  File "/root/miniconda3/lib/python3.9/site-packages/urllib3/connectionpool.py", line 785, in urlopen
    retries = retries.increment(
  File "/root/miniconda3/lib/python3.9/site-packages/urllib3/util/retry.py", line 592, in increment
    raise MaxRetryError(_pool, url, error or ResponseError(cause))
urllib3.exceptions.MaxRetryError: HTTPConnectionPool(host='80.push2.eastmoney.com', port=80): Max retries exceeded with url: /api/qt/clist/get?pn=1&pz=5000&po=1&np=1&ut=bd1d9ddb04089700cf9c27f6f7426281&fltt=2&invt=2&fid=f3&fs=m%3A0+t%3A6%2Cm%3A0+t%3A80&fields=f12&_=1623833739532 (Caused by NewConnectionError('<urllib3.connection.HTTPConnection object at 0x7f12a4250be0>: Failed to establish a new connection: [Errno 110] Connection timed out'))

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/root/miniconda3/lib/python3.9/site-packages/uvicorn/protocols/http/h11_impl.py", line 364, in run_asgi
    result = await app(self.scope, self.receive, self.send)
  File "/root/miniconda3/lib/python3.9/site-packages/uvicorn/middleware/proxy_headers.py", line 75, in __call__
    return await self.app(scope, receive, send)
  File "/root/miniconda3/lib/python3.9/site-packages/fastapi/applications.py", line 212, in __call__
    await super().__call__(scope, receive, send)
  File "/root/miniconda3/lib/python3.9/site-packages/starlette/applications.py", line 112, in __call__
    await self.middleware_stack(scope, receive, send)
  File "/root/miniconda3/lib/python3.9/site-packages/starlette/middleware/errors.py", line 181, in __call__
    raise exc
  File "/root/miniconda3/lib/python3.9/site-packages/starlette/middleware/errors.py", line 159, in __call__
    await self.app(scope, receive, _send)
  File "/root/miniconda3/lib/python3.9/site-packages/starlette/exceptions.py", line 82, in __call__
    raise exc
  File "/root/miniconda3/lib/python3.9/site-packages/starlette/exceptions.py", line 71, in __call__
    await self.app(scope, receive, sender)
  File "/root/miniconda3/lib/python3.9/site-packages/starlette/routing.py", line 656, in __call__
    await route.handle(scope, receive, send)
  File "/root/miniconda3/lib/python3.9/site-packages/starlette/routing.py", line 259, in handle
    await self.app(scope, receive, send)
  File "/root/miniconda3/lib/python3.9/site-packages/starlette/routing.py", line 61, in app
    response = await func(request)
  File "/root/miniconda3/lib/python3.9/site-packages/fastapi/routing.py", line 226, in app
    raw_response = await run_endpoint_function(
  File "/root/miniconda3/lib/python3.9/site-packages/fastapi/routing.py", line 161, in run_endpoint_function
    return await run_in_threadpool(dependant.call, **values)
  File "/root/miniconda3/lib/python3.9/site-packages/starlette/concurrency.py", line 39, in run_in_threadpool
    return await anyio.to_thread.run_sync(func, *args)
  File "/root/miniconda3/lib/python3.9/site-packages/anyio/to_thread.py", line 28, in run_sync
    return await get_asynclib().run_sync_in_worker_thread(func, *args, cancellable=cancellable,
  File "/root/miniconda3/lib/python3.9/site-packages/anyio/_backends/_asyncio.py", line 818, in run_sync_in_worker_thread
    return await future
  File "/root/miniconda3/lib/python3.9/site-packages/anyio/_backends/_asyncio.py", line 754, in run
    result = context.run(func, *args)
  File "/root/miniconda3/lib/python3.9/site-packages/aktools/core/api.py", line 128, in root
    received_df = eval("ak." + item_id + f"({eval_str})")
  File "<string>", line 1, in <module>
  File "/root/miniconda3/lib/python3.9/site-packages/akshare/stock/stock_info_em.py", line 23, in stock_individual_info_em
    code_id_dict = code_id_map_em()
  File "/root/miniconda3/lib/python3.9/site-packages/akshare/stock_feature/stock_hist_em.py", line 253, in code_id_map_em
    r = requests.get(url, params=params)
  File "/root/miniconda3/lib/python3.9/site-packages/requests/api.py", line 75, in get
    return request('get', url, params=params, **kwargs)
  File "/root/miniconda3/lib/python3.9/site-packages/requests/api.py", line 61, in request
    return session.request(method=method, url=url, **kwargs)
  File "/root/miniconda3/lib/python3.9/site-packages/requests/sessions.py", line 529, in request
    resp = self.send(prep, **send_kwargs)
  File "/root/miniconda3/lib/python3.9/site-packages/requests/sessions.py", line 645, in send
    r = adapter.send(request, **kwargs)
  File "/root/miniconda3/lib/python3.9/site-packages/requests/adapters.py", line 519, in send
    raise ConnectionError(e, request=request)
requests.exceptions.ConnectionError: HTTPConnectionPool(host='80.push2.eastmoney.com', port=80): Max retries exceeded with url: /api/qt/clist/get?pn=1&pz=5000&po=1&np=1&ut=bd1d9ddb04089700cf9c27f6f7426281&fltt=2&invt=2&fid=f3&fs=m%3A0+t%3A6%2Cm%3A0+t%3A80&fields=f12&_=1623833739532 (Caused by NewConnectionError('<urllib3.connection.HTTPConnection object at 0x7f12a4250be0>: Failed to establish a new connection: [Errno 110] Connection timed out'))`

可以发布二进制包吗?

如题。就是说既然不用 akshare 那必然不是 python 环境,感觉有二进制包用起来更方便一些。

PermissionError: [Errno 13] Permission denied 问题

作者您好。我用的anaconda环境,添加了系统变量直接在cmd或powershell里按操作执行。
运行错误,如下,这是什么原因呢?
C:\Users\Administrator>python -m aktools
点击打开接口导览:http://127.0.0.1:8080/docs
Traceback (most recent call last):
File "C:\Users\Administrator\anaconda3\lib\runpy.py", line 197, in _run_module
_as_main
return _run_code(code, main_globals, None,
File "C:\Users\Administrator\anaconda3\lib\runpy.py", line 87, in run_code
exec(code, run_globals)
File "C:\Users\Administrator\anaconda3\Scripts\uvicorn.exe_main
.py", line
7, in
sys.exit(main())
File "C:\Users\Administrator\anaconda3\lib\site-packages\click\core.py", line
1128, in call
return self.main(*args, **kwargs)
File "C:\Users\Administrator\anaconda3\lib\site-packages\click\core.py", line
1053, in main
rv = self.invoke(ctx)
File "C:\Users\Administrator\anaconda3\lib\site-packages\click\core.py", line
1395, in invoke
return ctx.invoke(self.callback, **ctx.params)
File "C:\Users\Administrator\anaconda3\lib\site-packages\click\core.py", line
754, in invoke
return _callback(*args, **kwargs)
File "C:\Users\Administrator\anaconda3\lib\site-packages\uvicorn\main.py", lin
e 407, in main
run(
File "C:\Users\Administrator\anaconda3\lib\site-packages\uvicorn\main.py", lin
e 575, in run
server.run()
File "C:\Users\Administrator\anaconda3\lib\site-packages\uvicorn\server.py", l
ine 60, in run
return asyncio.run(self.serve(sockets=sockets))
File "C:\Users\Administrator\anaconda3\lib\asyncio\runners.py", line 44, in ru
n
return loop.run_until_complete(main)
File "C:\Users\Administrator\anaconda3\lib\asyncio\base_events.py", line 647,
in run_until_complete
return future.result()
File "C:\Users\Administrator\anaconda3\lib\site-packages\uvicorn\server.py", l
ine 67, in serve
config.load()
File "C:\Users\Administrator\anaconda3\lib\site-packages\uvicorn\config.py", l
ine 479, in load
self.loaded_app = import_from_string(self.app)
File "C:\Users\Administrator\anaconda3\lib\site-packages\uvicorn\importer.py",
line 21, in import_from_string
module = importlib.import_module(module_str)
File "C:\Users\Administrator\anaconda3\lib\importlib_init
.py", line 127, i
n import_module
return _bootstrap._gcd_import(name[level:], package, level)
File "", line 1030, in _gcd_import
File "", line 1007, in _find_and_load
File "", line 986, in _find_and_load_unlocked
File "", line 680, in _load_unlocked
File "", line 850, in exec_module
File "", line 228, in call_with_frames_removed
File "C:\Users\Administrator\anaconda3\lib\site-packages\aktools\run.py", line
12, in
from core import app_core
File "C:\Users\Administrator\anaconda3\lib\site-packages\aktools\core_init

.py", line 3, in
from .api import app_core
File "C:\Users\Administrator\anaconda3\lib\site-packages\aktools\core\api.py",
line 155, in
short_path = get_template_path()
File "C:\Users\Administrator\anaconda3\lib\site-packages\aktools\datasets.py",
line 20, in get_template_path
with resources.path("aktools.assets", "html") as f:
File "C:\Users\Administrator\anaconda3\lib\contextlib.py", line 119, in ente
r

return next(self.gen)
File "C:\Users\Administrator\anaconda3\lib\importlib\resources.py", line 175,
in _path_from_reader
opener_reader = reader.open_resource(norm_resource)
File "", line 1055, in open_resource
PermissionError: [Errno 13] Permission denied: 'C:\Users\Administrator\anacon
da3\lib\site-packages\aktools\assets\html'

window系统python3.11运行失败

window11系统64位,python3.11版本

cmd>python -m aktools --host 0.0.0.0 --port 8888
请访问:http://0.0.0.0:8888/version 来获取最新的库版本信息,确保使用最新版本的 AKShare 和 AKTools
当前的 AKTools 版本为:0.0.81,AKShare 版本为:1.7.97
点击打开 HTTP API 主页:http://0.0.0.0:8888/
点击打开接口导览:http://0.0.0.0:8888/docs
Usage: python -m uvicorn [OPTIONS] APP
Try 'python -m uvicorn --help' for help.

Error: Got unexpected extra argument (Files\Python\Python311\Lib\site-packages\aktools)

无法使用latest标签或akshare的最新版本号1.9.43启动docker容器

我根据文档写了一份docker-compose.yml文件,想用最新版本的镜像,但启动失败。根据文档描述,镜像的版本号是akshare的版本号,我接着用1.9.43,不行,然后用低一版本1.9.42,可以了。
以下是我的docker-compose.yml:

version: '3.7'

services:
  datasource:
    container_name: aktools
    image: registry.cn-shanghai.aliyuncs.com/akfamily/aktools:1.9.42
    restart: always
    environment:
      TZ: Asia/Shanghai
    ports:
      - 8080:8080

访问同花顺成分时个别概念返回服务器错误

访问接口:stock_board_concept_cons_ths
symbol = WiFi 6

报以下错误, 用python 直接访问正常。

(base) PS C:\Users\cuiqs> python -m aktools
点击打开接口导览:http://127.0.0.1:8080/docs
�[32mINFO�[0m: Started server process [�[36m18232�[0m]
�[32mINFO�[0m: Waiting for application startup.
�[32mINFO�[0m: Application startup complete.
�[32mINFO�[0m: Uvicorn running on �[1mhttp://127.0.0.1:8080�[0m (Press CTRL+C to quit)
�[32mINFO�[0m: 127.0.0.1:62872 - "�[1mGET /api/public/stock_board_concept_cons_ths?symbol=WiFi%206 HTTP/1.1�[0m" �[91m500 Internal Server Error�[0m
�[31mERROR�[0m: Exception in ASGI application
Traceback (most recent call last):
File "d:\Users\cuiqs\anaconda3\lib\site-packages\uvicorn\protocols\http\h11_impl.py", line 366, in run_asgi
result = await app(self.scope, self.receive, self.send)
File "d:\Users\cuiqs\anaconda3\lib\site-packages\uvicorn\middleware\proxy_headers.py", line 75, in call
return await self.app(scope, receive, send)
File "d:\Users\cuiqs\anaconda3\lib\site-packages\fastapi\applications.py", line 261, in call
await super().call(scope, receive, send)
File "d:\Users\cuiqs\anaconda3\lib\site-packages\starlette\applications.py", line 119, in call
await self.middleware_stack(scope, receive, send)
File "d:\Users\cuiqs\anaconda3\lib\site-packages\starlette\middleware\errors.py", line 181, in call
raise exc
File "d:\Users\cuiqs\anaconda3\lib\site-packages\starlette\middleware\errors.py", line 159, in call
await self.app(scope, receive, _send)
File "d:\Users\cuiqs\anaconda3\lib\site-packages\starlette\middleware\cors.py", line 84, in call
await self.app(scope, receive, send)
File "d:\Users\cuiqs\anaconda3\lib\site-packages\starlette\exceptions.py", line 87, in call
raise exc
File "d:\Users\cuiqs\anaconda3\lib\site-packages\starlette\exceptions.py", line 76, in call
await self.app(scope, receive, sender)
File "d:\Users\cuiqs\anaconda3\lib\site-packages\fastapi\middleware\asyncexitstack.py", line 21, in call
raise e
File "d:\Users\cuiqs\anaconda3\lib\site-packages\fastapi\middleware\asyncexitstack.py", line 18, in call
await self.app(scope, receive, send)
File "d:\Users\cuiqs\anaconda3\lib\site-packages\starlette\routing.py", line 659, in call
await route.handle(scope, receive, send)
File "d:\Users\cuiqs\anaconda3\lib\site-packages\starlette\routing.py", line 259, in handle
await self.app(scope, receive, send)
File "d:\Users\cuiqs\anaconda3\lib\site-packages\starlette\routing.py", line 61, in app
response = await func(request)
File "d:\Users\cuiqs\anaconda3\lib\site-packages\fastapi\routing.py", line 227, in app
raw_response = await run_endpoint_function(
File "d:\Users\cuiqs\anaconda3\lib\site-packages\fastapi\routing.py", line 162, in run_endpoint_function
return await run_in_threadpool(dependant.call, **values)
File "d:\Users\cuiqs\anaconda3\lib\site-packages\starlette\concurrency.py", line 45, in run_in_threadpool
return await anyio.to_thread.run_sync(func, *args)
File "d:\Users\cuiqs\anaconda3\lib\site-packages\anyio\to_thread.py", line 28, in run_sync
return await get_asynclib().run_sync_in_worker_thread(func, *args, cancellable=cancellable,
File "d:\Users\cuiqs\anaconda3\lib\site-packages\anyio_backends_asyncio.py", line 818, in run_sync_in_worker_thread
return await future
File "d:\Users\cuiqs\anaconda3\lib\site-packages\anyio_backends_asyncio.py", line 754, in run
result = context.run(func, *args)
File "d:\Users\cuiqs\anaconda3\lib\site-packages\aktools\core\api.py", line 128, in root
received_df = eval("ak." + item_id + f"({eval_str})")
File "", line 1, in
File "d:\Users\cuiqs\anaconda3\lib\site-packages\akshare\stock_feature\stock_board_concept_ths.py", line 143, in stock_board_concept_cons_ths
stock_board_ths_map_df[stock_board_ths_map_df["概念名称"] == symbol]["网址"]
IndexError: index 0 is out of bounds for axis 0 with size 0

为什么不能使用ip:端口的方式访问

我只能通过127.0.0.1:8080或者Localhost:8080的方式访问,如果我用ip:端口的方式访问就不成功,因为我需要远程或虚拟机访问过来,为什么ip:端口方式访问不行呢,能否改一下

Native library not available at /usr/local/lib/python3.10/site-packages/py_mini_racer/libmini_racer.glibc.so

aktools: 0.0.83
akshare: 1.10.19
py_mini-racer: 0.6

python: 3.10.10
OS: centos7-aarch64

RuntimeError: Native library not available at /usr/local/lib/python3.10/site-packages/py_mini_racer/libmini_racer.glibc.so
Exception ignored in: <function MiniRacer.del at 0x743dd9da20>
Traceback (most recent call last):
File "/usr/local/lib/python3.10/site-packages/py_mini_racer/py_mini_racer.py", line 315, in del
self.ext.mr_free_context(getattr(self, "ctx", None))
AttributeError: 'NoneType' object has no attribute 'mr_free_context'

windows7 系统启动失败

先感谢提供免费的库。

windows 7
python 3.8.6

安装最新版本 0.0.60

执行

python -m aktools

报以下错误

Usage: uvicorn [OPTIONS] APP
Try 'uvicorn --help' for help.
Error: Got unexpected extra argument (Files\python\lib\site-packages\aktools)

无法调用match_main_contract

无法调用python版本可以调用的期货主力合约接口match_main_contract,
http://127.0.0.1:8080/api/public/match_main_contract?symbol=shfe
返回Internal Server Error

版本 0.0.62 访问接口会报缺少 favicon.ico 错误

错误内容如下

INFO:     Started server process [24762]
INFO:     Waiting for application startup.
INFO:     Application startup complete.
INFO:     Uvicorn running on http://127.0.0.1:8085 (Press CTRL+C to quit)
INFO:     127.0.0.1:47882 - "GET /api/public/stock_sh_a_spot_em HTTP/1.0" 200 OK
INFO:     127.0.0.1:47886 - "GET /favicon.ico HTTP/1.0" 500 Internal Server Error
ERROR:    Exception in ASGI application
Traceback (most recent call last):
  File "/root/anaconda3/lib/python3.7/site-packages/starlette/responses.py", line 318, in __call__
    stat_result = await anyio.to_thread.run_sync(os.stat, self.path)
  File "/root/anaconda3/lib/python3.7/site-packages/anyio/to_thread.py", line 32, in run_sync
    func, *args, cancellable=cancellable, limiter=limiter
  File "/root/anaconda3/lib/python3.7/site-packages/anyio/_backends/_asyncio.py", line 937, in run_sync_in_worker_thread
    return await future
  File "/root/anaconda3/lib/python3.7/site-packages/anyio/_backends/_asyncio.py", line 867, in run
    result = context.run(func, *args)
FileNotFoundError: [Errno 2] No such file or directory: '../favicon.ico'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/root/anaconda3/lib/python3.7/site-packages/uvicorn/protocols/http/h11_impl.py", line 366, in run_asgi
    result = await app(self.scope, self.receive, self.send)
  File "/root/anaconda3/lib/python3.7/site-packages/uvicorn/middleware/proxy_headers.py", line 75, in __call__
    return await self.app(scope, receive, send)
  File "/root/anaconda3/lib/python3.7/site-packages/fastapi/applications.py", line 269, in __call__
    await super().__call__(scope, receive, send)
  File "/root/anaconda3/lib/python3.7/site-packages/starlette/applications.py", line 124, in __call__
    await self.middleware_stack(scope, receive, send)
  File "/root/anaconda3/lib/python3.7/site-packages/starlette/middleware/errors.py", line 184, in __call__
    raise exc
  File "/root/anaconda3/lib/python3.7/site-packages/starlette/middleware/errors.py", line 162, in __call__
    await self.app(scope, receive, _send)
  File "/root/anaconda3/lib/python3.7/site-packages/starlette/middleware/cors.py", line 84, in __call__
    await self.app(scope, receive, send)
  File "/root/anaconda3/lib/python3.7/site-packages/starlette/exceptions.py", line 93, in __call__
    raise exc
  File "/root/anaconda3/lib/python3.7/site-packages/starlette/exceptions.py", line 82, in __call__
    await self.app(scope, receive, sender)
  File "/root/anaconda3/lib/python3.7/site-packages/fastapi/middleware/asyncexitstack.py", line 21, in __call__
    raise e
  File "/root/anaconda3/lib/python3.7/site-packages/fastapi/middleware/asyncexitstack.py", line 18, in __call__
    await self.app(scope, receive, send)
  File "/root/anaconda3/lib/python3.7/site-packages/starlette/routing.py", line 670, in __call__
    await route.handle(scope, receive, send)
  File "/root/anaconda3/lib/python3.7/site-packages/starlette/routing.py", line 266, in handle
    await self.app(scope, receive, send)
  File "/root/anaconda3/lib/python3.7/site-packages/starlette/routing.py", line 68, in app
    await response(scope, receive, send)
  File "/root/anaconda3/lib/python3.7/site-packages/starlette/responses.py", line 321, in __call__
    raise RuntimeError(f"File at path {self.path} does not exist.")
RuntimeError: File at path ../favicon.ico does not exist.

docker部署后,解析域名访问报错

No supported WebSocket library detected. Please use 'pip install uvicorn[standard]', or install 'websockets' or 'wsproto' manually.

用ip:端口可以正常使用
这是为啥呢
ps:我解析了一个https来访问的

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.