diff --git a/akshare/__init__.py b/akshare/__init__.py index 73306bf786c..0763fc202f4 100644 --- a/akshare/__init__.py +++ b/akshare/__init__.py @@ -2495,9 +2495,10 @@ 1.10.78 fix: fix get_cffex_rank_table interface 1.10.79 add: add stock_hold_management_detail_em interface 1.10.80 fix: fix macro_china_gyzjz interface +1.10.81 fix: fix stock_bid_ask_em interface """ -__version__ = "1.10.80" +__version__ = "1.10.81" __author__ = "AKFamily" import sys diff --git a/akshare/stock/stock_info_em.py b/akshare/stock/stock_info_em.py index d48a020389e..313c28ea5b0 100644 --- a/akshare/stock/stock_info_em.py +++ b/akshare/stock/stock_info_em.py @@ -1,7 +1,7 @@ # -*- coding:utf-8 -*- # !/usr/bin/env python """ -Date: 2022/4/19 20:21 +Date: 2023/8/11 11:44 Desc: 东方财富网-个股-股票信息 https://quote.eastmoney.com/concept/sh603777.html?from=classic """ @@ -11,12 +11,14 @@ from akshare.stock_feature.stock_hist_em import code_id_map_em -def stock_individual_info_em(symbol: str = "603777") -> pd.DataFrame: +def stock_individual_info_em(symbol: str = "603777", timeout: float = None) -> pd.DataFrame: """ 东方财富-个股-股票信息 https://quote.eastmoney.com/concept/sh603777.html?from=classic :param symbol: 股票代码 :type symbol: str + :param timeout: choice of None or a positive float number + :type timeout: float :return: 股票信息 :rtype: pandas.DataFrame """ @@ -30,7 +32,7 @@ def stock_individual_info_em(symbol: str = "603777") -> pd.DataFrame: "secid": f"{code_id_dict[symbol]}.{symbol}", "_": "1640157544804", } - r = requests.get(url, params=params) + r = requests.get(url, params=params, timeout=timeout) data_json = r.json() temp_df = pd.DataFrame(data_json) temp_df.reset_index(inplace=True) @@ -62,5 +64,5 @@ def stock_individual_info_em(symbol: str = "603777") -> pd.DataFrame: if __name__ == "__main__": - stock_individual_info_em_df = stock_individual_info_em(symbol="000001") + stock_individual_info_em_df = stock_individual_info_em(symbol="000001", timeout=None) print(stock_individual_info_em_df) diff --git a/docs/changelog.md b/docs/changelog.md index 51d98475d1b..564cb943509 100644 --- a/docs/changelog.md +++ b/docs/changelog.md @@ -63,6 +63,11 @@ ## 更新说明详情 +1.10.81 fix: fix stock_bid_ask_em interface + + 1. 修复 stock_bid_ask_em 接口 + 2. 移除 stock_us_zh_spot 接口 + 1.10.80 fix: fix macro_china_gyzjz interface 1. 修复 macro_china_gyzjz 接口 @@ -2745,6 +2750,8 @@ ## 版本更新说明 +1.10.81 fix: fix stock_bid_ask_em interface + 1.10.80 fix: fix macro_china_gyzjz interface 1.10.79 add: add stock_hold_management_detail_em interface diff --git a/docs/data/stock/stock.md b/docs/data/stock/stock.md index b1ec147062a..f0190d07362 100644 --- a/docs/data/stock/stock.md +++ b/docs/data/stock/stock.md @@ -356,11 +356,12 @@ print(stock_sse_deal_daily_df) 输入参数 -| 名称 | 类型 | 描述 | -|--------|-----|-----------------------| -| symbol | str | symbol="603777"; 股票代码 | +| 名称 | 类型 | 描述 | +|---------|-------|-------------------------| +| symbol | str | symbol="603777"; 股票代码 | +| timeout | float | timeout=None; 默认不设置超时参数 | -输出参数-实时行情数据 +输出参数 | 名称 | 类型 | 描述 | |-------|--------|-----|