From 7e04b3782968095065f542288c612ebbb591d74d Mon Sep 17 00:00:00 2001 From: Albert King Date: Wed, 18 Oct 2023 20:40:51 +0800 Subject: [PATCH] Date (#4200) * add version * fix index_fear_greed_funddb * remove stock_fear_greed_funddb * add index_fear_greed_funddb --- akshare/__init__.py | 5 +- .../index_fear_greed_funddb.py} | 6 +-- docs/changelog.md | 6 +++ docs/data/index/index.md | 53 +++++++++++++++++++ docs/data/stock/stock.md | 53 ------------------- docs/tutorial.md | 2 +- 6 files changed, 66 insertions(+), 59 deletions(-) rename akshare/{stock/stock_fear_greed_funddb.py => index/index_fear_greed_funddb.py} (92%) diff --git a/akshare/__init__.py b/akshare/__init__.py index 11a720cdf38..3856c9925d7 100644 --- a/akshare/__init__.py +++ b/akshare/__init__.py @@ -2550,9 +2550,10 @@ 1.11.34 add: add stock_board_concept_graph_ths interface 1.11.35 fix: fix stock_board_concept_hist_ths interface 1.11.36 add: add stock_fear_greed_funddb interface +1.11.37 fix: fix index_fear_greed_funddb interface """ -__version__ = "1.11.36" +__version__ = "1.11.37" __author__ = "AKFamily" import sys @@ -2570,7 +2571,7 @@ """ funddb-工具-估值情绪-恐贪指数 """ -from akshare.stock.stock_fear_greed_funddb import stock_fear_greed_funddb +from akshare.index.index_fear_greed_funddb import index_fear_greed_funddb """ 东财财富-分时数据 diff --git a/akshare/stock/stock_fear_greed_funddb.py b/akshare/index/index_fear_greed_funddb.py similarity index 92% rename from akshare/stock/stock_fear_greed_funddb.py rename to akshare/index/index_fear_greed_funddb.py index a01f02562e4..1e43976fcf8 100644 --- a/akshare/stock/stock_fear_greed_funddb.py +++ b/akshare/index/index_fear_greed_funddb.py @@ -28,7 +28,7 @@ def _get_file_content_ths(file: str = "cninfo.js") -> str: return file_data -def stock_fear_greed_funddb(symbol: str = "上证指数") -> pd.DataFrame: +def index_fear_greed_funddb(symbol: str = "上证指数") -> pd.DataFrame: """ funddb-工具-估值情绪-恐惧贪婪指数 https://funddb.cn/tool/fear @@ -67,5 +67,5 @@ def stock_fear_greed_funddb(symbol: str = "上证指数") -> pd.DataFrame: if __name__ == "__main__": - stock_fear_greed_funddb_df = stock_fear_greed_funddb(symbol="上证指数") - print(stock_fear_greed_funddb_df) + index_fear_greed_funddb_df = index_fear_greed_funddb(symbol="上证指数") + print(index_fear_greed_funddb_df) diff --git a/docs/changelog.md b/docs/changelog.md index 4d28de6f7d1..850841016f4 100644 --- a/docs/changelog.md +++ b/docs/changelog.md @@ -63,6 +63,10 @@ ## 更新说明详情 +1.11.37 fix: fix index_fear_greed_funddb interface + + 1. 重命名 stock_fear_greed_funddb 为 index_fear_greed_funddb 接口 + 1.11.36 add: add stock_fear_greed_funddb interface 1. 新增 stock_fear_greed_funddb 接口 @@ -2976,6 +2980,8 @@ ## 版本更新说明 +1.11.37 fix: fix index_fear_greed_funddb interface + 1.11.36 add: add stock_fear_greed_funddb interface 1.11.35 fix: fix stock_board_concept_hist_ths interface diff --git a/docs/data/index/index.md b/docs/data/index/index.md index 4458f829386..db9a278e851 100644 --- a/docs/data/index/index.md +++ b/docs/data/index/index.md @@ -4291,6 +4291,59 @@ print(index_value_hist_funddb_df) [3274 rows x 7 columns] ``` +#### 估值情绪 + +##### 恐惧贪婪指数 + +接口: index_fear_greed_funddb + +目标地址: https://funddb.cn/tool/fear + +描述: funddb-工具-估值情绪-恐惧贪婪指数 + +限量: 单次返回所有数据 + +输入参数 + +| 名称 | 类型 | 描述 | +|--------|-----|--------------------------------------------| +| symbol | str | symbol="上证指数"; choice of {"上证指数", "沪深300"} | + +输出参数 + +| 名称 | 类型 | 描述 | +|-------|---------|---------| +| date | object | - | +| fear | float64 | - | +| index | float64 | float64 | + +接口示例 + +```python +import akshare as ak + +index_fear_greed_funddb_df = ak.index_fear_greed_funddb(symbol="上证指数") +print(index_fear_greed_funddb_df) +``` + +数据示例 + +``` + date fear index +0 2021-10-18 30.8896 3568.14 +1 2021-10-19 40.1977 3593.15 +2 2021-10-20 41.5157 3587.00 +3 2021-10-21 53.8715 3594.78 +4 2021-10-22 58.4843 3582.60 +.. ... ... ... +482 2023-10-12 39.8682 3107.90 +483 2023-10-13 46.0461 3088.10 +484 2023-10-16 40.3624 3073.81 +485 2023-10-17 31.8781 3083.50 +486 2023-10-18 30.0659 3058.71 +[487 rows x 3 columns] +``` + ### 申万宏源研究 #### 申万指数实时行情 diff --git a/docs/data/stock/stock.md b/docs/data/stock/stock.md index f8e3aab9793..f2156b41b07 100644 --- a/docs/data/stock/stock.md +++ b/docs/data/stock/stock.md @@ -21981,56 +21981,3 @@ print(stock_esg_hz_sina_df) 5163 2023-04-30 000038.SZ cn *ST大通 56.95 ... CC 65.05 CCC 49.79 C [5164 rows x 12 columns] ``` - -### 估值情绪 - -#### 恐惧贪婪指数 - -接口: stock_fear_greed_funddb - -目标地址: https://funddb.cn/tool/fear - -描述: funddb-工具-估值情绪-恐惧贪婪指数 - -限量: 单次返回所有数据 - -输入参数 - -| 名称 | 类型 | 描述 | -|--------|-----|--------------------------------------------| -| symbol | str | symbol="上证指数"; choice of {"上证指数", "沪深300"} | - -输出参数 - -| 名称 | 类型 | 描述 | -|-------|---------|---------| -| date | object | - | -| fear | float64 | - | -| index | float64 | float64 | - -接口示例 - -```python -import akshare as ak - -stock_fear_greed_funddb_df = ak.stock_fear_greed_funddb(symbol="上证指数") -print(stock_fear_greed_funddb_df) -``` - -数据示例 - -``` - date fear index -0 2021-10-18 30.8896 3568.14 -1 2021-10-19 40.1977 3593.15 -2 2021-10-20 41.5157 3587.00 -3 2021-10-21 53.8715 3594.78 -4 2021-10-22 58.4843 3582.60 -.. ... ... ... -482 2023-10-12 39.8682 3107.90 -483 2023-10-13 46.0461 3088.10 -484 2023-10-16 40.3624 3073.81 -485 2023-10-17 31.8781 3083.50 -486 2023-10-18 30.0659 3058.71 -[487 rows x 3 columns] -``` \ No newline at end of file diff --git a/docs/tutorial.md b/docs/tutorial.md index aaadad79062..bf5bb229beb 100644 --- a/docs/tutorial.md +++ b/docs/tutorial.md @@ -1219,7 +1219,7 @@ # 同花顺-板块-概念板块-概念图谱 "stock_board_concept_graph_ths" # 同花顺-板块-概念板块-概念图谱 # 恐惧贪婪指数 - "stock_fear_greed_funddb" # 恐惧贪婪指数 + "index_fear_greed_funddb" # 恐惧贪婪指数 ``` ## 案例演示