Skip to content

Commit

Permalink
Date (#4523)
Browse files Browse the repository at this point in the history
* add version 1.12.66

* fix stock_board_industry_hist_em

* fix stock_hot_rank_wc
  • Loading branch information
albertandking authored Feb 22, 2024
1 parent fa8fc68 commit aa27655
Show file tree
Hide file tree
Showing 5 changed files with 89 additions and 81 deletions.
3 changes: 2 additions & 1 deletion akshare/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -2678,9 +2678,10 @@
1.12.63 add: add akqmt interface
1.12.64 fix: fix stock_board_industry_index_ths interface
1.12.65 fix: fix futures_foreign_commodity_realtime interface
1.12.66 fix: fix stock_board_industry_hist_em interface
"""

__version__ = "1.12.65"
__version__ = "1.12.66"
__author__ = "AKFamily"

import sys
Expand Down
23 changes: 12 additions & 11 deletions akshare/stock/stock_board_industry_em.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,9 @@
https://quote.eastmoney.com/center/boardlist.html#industry_board
"""
import re
import requests

import pandas as pd
import requests


def stock_board_industry_name_em() -> pd.DataFrame:
Expand Down Expand Up @@ -160,11 +161,11 @@ def stock_board_industry_spot_em(symbol: str = "小金属") -> pd.DataFrame:


def stock_board_industry_hist_em(
symbol: str = "小金属",
start_date: str = "20211201",
end_date: str = "20220401",
period: str = "日k",
adjust: str = "",
symbol: str = "小金属",
start_date: str = "20211201",
end_date: str = "20220401",
period: str = "日k",
adjust: str = "",
) -> pd.DataFrame:
"""
东方财富网-沪深板块-行业板块-历史行情
Expand All @@ -190,7 +191,7 @@ def stock_board_industry_hist_em(
stock_board_concept_em_map = stock_board_industry_name_em()
stock_board_code = stock_board_concept_em_map[
stock_board_concept_em_map["板块名称"] == symbol
]["板块代码"].values[0]
]["板块代码"].values[0]
adjust_map = {"": "0", "qfq": "1", "hfq": "2"}
url = "http://7.push2his.eastmoney.com/api/qt/stock/kline/get"
params = {
Expand Down Expand Up @@ -253,7 +254,7 @@ def stock_board_industry_hist_em(


def stock_board_industry_hist_min_em(
symbol: str = "小金属", period: str = "5"
symbol: str = "小金属", period: str = "5"
) -> pd.DataFrame:
"""
东方财富网-沪深板块-行业板块-分时历史行情
Expand All @@ -268,7 +269,7 @@ def stock_board_industry_hist_min_em(
stock_board_concept_em_map = stock_board_industry_name_em()
stock_board_code = stock_board_concept_em_map[
stock_board_concept_em_map["板块名称"] == symbol
]["板块代码"].values[0]
]["板块代码"].values[0]
if period == "1":
url = "https://push2his.eastmoney.com/api/qt/stock/trends2/get"
params = {
Expand Down Expand Up @@ -377,7 +378,7 @@ def stock_board_industry_cons_em(symbol: str = "小金属") -> pd.DataFrame:
stock_board_concept_em_map = stock_board_industry_name_em()
stock_board_code = stock_board_concept_em_map[
stock_board_concept_em_map["板块名称"] == symbol
]["板块代码"].values[0]
]["板块代码"].values[0]
url = "http://29.push2.eastmoney.com/api/qt/clist/get"
params = {
"pn": "1",
Expand Down Expand Up @@ -476,7 +477,7 @@ def stock_board_industry_cons_em(symbol: str = "小金属") -> pd.DataFrame:
print(stock_board_industry_spot_em_df)

stock_board_industry_hist_em_df = stock_board_industry_hist_em(
symbol="小金属", start_date="20211201", end_date="20221110", period="月k", adjust=""
symbol="小金属", start_date="20211201", end_date="20240222", period="日k", adjust=""
)
print(stock_board_industry_hist_em_df)

Expand Down
2 changes: 1 addition & 1 deletion akshare/stock_feature/stock_wencai.py
Original file line number Diff line number Diff line change
Expand Up @@ -98,5 +98,5 @@ def stock_hot_rank_wc(date: str = "20230815") -> pd.DataFrame:


if __name__ == "__main__":
stock_hot_rank_wc_df = stock_hot_rank_wc(date="20230816")
stock_hot_rank_wc_df = stock_hot_rank_wc(date="20240222")
print(stock_hot_rank_wc_df)
6 changes: 6 additions & 0 deletions docs/changelog.md
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,10 @@

## 更新说明详情

1.12.66 fix: fix stock_board_industry_hist_em interface

1. 修复 stock_board_industry_hist_em 接口

1.12.65 fix: fix futures_foreign_commodity_realtime interface

1. 修复 futures_foreign_commodity_realtime 接口
Expand Down Expand Up @@ -3572,6 +3576,8 @@

## 版本更新说明

1.12.66 fix: fix stock_board_industry_hist_em interface

1.12.65 fix: fix futures_foreign_commodity_realtime interface

1.12.64 fix: fix stock_board_industry_index_ths interface
Expand Down
136 changes: 68 additions & 68 deletions docs/data/stock/stock.md
Original file line number Diff line number Diff line change
Expand Up @@ -19877,7 +19877,7 @@ print(stock_board_industry_index_ths_df)

接口: stock_board_industry_name_em

目标地址: http://quote.eastmoney.com/center/boardlist.html#industry_board
目标地址: https://quote.eastmoney.com/center/boardlist.html#industry_board

描述: 东方财富-沪深京板块-行业板块

Expand Down Expand Up @@ -19918,18 +19918,19 @@ print(stock_board_industry_name_em_df)
数据示例

```
排名 板块名称 板块代码 最新价 涨跌额 ... 换手率 上涨家数 下跌家数 领涨股票 领涨股票-涨跌幅
0 1 小金属 BK1027 1928.58 59.34 ... 3.02 33 7 英洛华 9.98
1 2 能源金属 BK1015 1135.19 32.39 ... 3.66 6 1 盛新锂能 8.50
2 3 电池 BK1033 1862.93 48.74 ... 2.07 35 4 璞泰来 10.00
3 4 环保行业 BK0728 475.91 9.00 ... 1.95 80 18 倍杰特 20.01
4 5 化肥行业 BK0731 1350.50 23.05 ... 2.25 21 5 芭田股份 8.17
.. .. ... ... ... ... ... ... ... ... ... ...
79 80 电信运营 BK0736 839.54 -10.51 ... 0.36 0 6 中国电信 -0.23
80 81 旅游酒店 BK0485 11173.08 -145.74 ... 0.69 3 35 金马游乐 7.19
81 82 电机 BK1030 1635.07 -24.86 ... 3.57 4 16 江特电机 3.25
82 83 煤炭行业 BK0437 8014.74 -126.25 ... 0.80 1 35 ST大洲 1.95
83 84 半导体 BK1036 1628.37 -36.14 ... 2.23 8 72 阿石创 3.84
排名 板块名称 板块代码 最新价 涨跌额 ... 换手率 上涨家数 下跌家数 领涨股票 领涨股票-涨跌幅
0 1 煤炭行业 BK0437 11332.18 518.57 ... 1.34 35 0 云煤能源 10.12
1 2 互联网服务 BK0447 16332.38 673.12 ... 3.38 144 3 信雅达 9.97
2 3 计算机设备 BK0735 867.59 34.86 ... 3.00 50 1 中威电子 20.08
3 4 通信服务 BK0736 793.26 28.90 ... 1.56 40 1 二六三 9.95
4 5 软件开发 BK0737 691.48 24.85 ... 3.02 179 8 国投智能 20.00
.. .. ... ... ... ... ... ... ... ... ... ...
81 82 航空机场 BK0420 4109.35 11.15 ... 0.43 9 5 南方航空 1.67
82 83 航运港口 BK0450 8431.11 22.32 ... 0.45 19 8 唐山港 2.33
83 84 能源金属 BK1015 399.07 0.36 ... 1.19 6 5 寒锐钴业 1.03
84 85 银行 BK0475 3050.18 -0.42 ... 0.23 16 16 成都银行 1.80
85 86 珠宝首饰 BK0734 351.08 -0.05 ... 1.56 8 9 曼卡龙 3.36
[86 rows x 12 columns]
```

#### 东方财富-成份股
Expand Down Expand Up @@ -19981,54 +19982,52 @@ print(stock_board_industry_cons_em_df)
数据示例

```
序号 代码 名称 最新价 涨跌幅 ... 今开 昨收 换手率 市盈率-动态 市净率
0 1 688190 N云路 123.05 163.89 ... 120.00 46.63 57.34 124.09 8.20
1 2 300127 银河磁体 31.40 19.35 ... 26.06 26.31 17.18 50.84 7.63
2 3 600259 广晟有色 56.40 10.01 ... 50.95 51.27 3.90 101.36 9.38
3 4 000795 英洛华 8.82 9.98 ... 8.20 8.02 7.67 52.16 4.03
4 5 600392 盛和资源 23.12 8.90 ... 21.12 21.23 8.03 36.60 4.97
5 6 002182 云海金属 22.92 7.71 ... 21.22 21.28 7.95 42.14 4.91
6 7 300811 铂科新材 106.23 7.43 ... 99.28 98.88 2.49 97.92 11.72
7 8 300835 龙磁科技 80.83 7.06 ... 75.50 75.50 11.04 41.31 6.17
8 9 002057 中钢天源 9.31 5.68 ... 8.75 8.81 6.62 33.76 2.43
9 10 000970 中科三环 15.10 5.45 ... 14.34 14.32 6.10 58.71 3.36
10 11 002378 章源钨业 9.98 5.27 ... 9.40 9.48 3.40 74.12 5.15
11 12 300748 金力永磁 53.02 4.53 ... 50.81 50.72 4.71 80.45 13.68
12 13 600111 北方稀土 56.47 4.28 ... 53.42 54.15 3.42 48.86 15.29
13 14 600980 北矿科技 19.32 4.09 ... 18.46 18.56 6.92 45.35 3.70
14 15 603399 吉翔股份 7.83 3.98 ... 7.61 7.53 3.27 69.61 2.06
15 16 000657 中钨高新 18.82 3.29 ... 17.87 18.22 4.32 38.12 4.21
16 17 601958 金钼股份 7.62 3.25 ... 7.45 7.38 0.82 43.80 2.06
17 18 002056 横店东磁 19.21 3.17 ... 18.59 18.62 4.44 26.47 4.82
18 19 600366 宁波韵升 15.02 2.95 ... 14.75 14.59 8.08 29.78 3.16
19 20 002167 东方锆业 8.83 2.67 ... 8.52 8.60 3.79 41.53 5.54
20 21 300328 宜安科技 8.54 2.28 ... 8.34 8.35 1.74 3281.86 4.59
21 22 002149 西部材料 20.35 2.06 ... 20.06 19.94 2.62 72.11 3.83
22 23 002842 翔鹭钨业 10.02 2.04 ... 9.78 9.82 3.48 51.94 2.83
23 24 000831 五矿稀土 46.16 2.03 ... 44.50 45.24 5.10 171.60 17.33
24 25 000633 合金投资 7.08 2.02 ... 6.90 6.94 0.70 1025.38 16.34
25 26 002428 云南锗业 12.33 1.99 ... 12.04 12.09 2.70 393.12 5.47
26 27 000962 东方钽业 11.86 1.98 ... 11.53 11.63 2.01 42.17 4.00
27 28 300224 正海磁材 22.00 1.85 ... 21.42 21.60 10.93 73.73 6.74
28 29 603993 洛阳钼业 5.95 1.19 ... 5.85 5.88 1.01 27.09 3.26
29 30 600549 厦门钨业 26.18 0.81 ... 25.92 25.97 3.25 27.98 4.23
30 31 301026 浩通科技 70.59 0.38 ... 70.20 70.32 2.69 27.58 6.40
31 32 600615 *ST丰华 7.93 0.38 ... 7.86 7.90 0.07 -588.83 2.36
32 33 002738 中矿资源 65.99 0.17 ... 65.05 65.88 3.17 52.91 5.74
33 34 605376 博迁新材 78.40 -0.23 ... 77.90 78.58 1.50 86.77 13.43
34 35 600459 贵研铂业 26.27 -0.49 ... 26.35 26.40 0.71 32.88 4.07
35 36 600206 有研新材 15.67 -0.76 ... 15.69 15.79 2.90 46.93 3.93
36 37 688077 大地熊 92.43 -2.09 ... 94.81 94.40 8.42 52.77 7.42
37 38 600456 宝钛股份 66.11 -2.35 ... 67.39 67.70 1.61 50.27 5.31
38 39 600281 华阳新材 6.35 -2.46 ... 6.22 6.51 5.01 -219.18 6.34
39 40 000960 锡业股份 18.71 -2.86 ... 18.60 19.26 2.21 13.04 2.11
序号 代码 名称 最新价 涨跌幅 ... 今开 昨收 换手率 市盈率-动态 市净率
0 1 300811 铂科新材 53.34 5.17 ... 52.18 50.72 2.93 42.12 5.82
1 2 002842 翔鹭钨业 5.36 3.68 ... 5.16 5.17 5.22 -27.42 1.77
2 3 000962 东方钽业 9.89 3.13 ... 9.58 9.59 1.94 25.59 2.15
3 4 600980 北矿科技 13.21 2.72 ... 12.76 12.86 2.96 26.17 1.95
4 5 300328 宜安科技 4.92 2.71 ... 4.77 4.79 1.37 495.38 3.10
5 6 002428 云南锗业 9.84 2.29 ... 9.63 9.62 2.53 -991.04 4.58
6 7 603993 洛阳钼业 6.13 2.17 ... 5.98 6.00 0.59 40.65 2.48
7 8 600281 华阳新材 2.95 2.08 ... 2.85 2.89 4.80 -9.12 4.74
8 9 688077 大地熊 15.40 2.05 ... 15.17 15.09 1.26 -38.03 1.58
9 10 300127 银河磁体 13.90 1.98 ... 13.56 13.63 2.18 23.07 3.17
10 11 000831 中国稀土 28.14 1.74 ... 26.90 27.66 3.43 178.41 5.76
11 12 000960 锡业股份 13.26 1.69 ... 13.00 13.04 0.82 14.94 1.25
12 13 605376 博迁新材 19.39 1.52 ... 18.99 19.10 0.73 296.20 3.12
13 14 301141 中科磁业 45.27 1.39 ... 43.90 44.65 19.94 78.91 3.19
14 15 600259 广晟有色 29.04 1.29 ... 28.50 28.67 1.07 44.03 2.71
15 16 002149 西部材料 12.68 1.20 ... 12.47 12.53 0.87 30.81 2.14
16 17 600206 有研新材 10.22 1.19 ... 10.11 10.10 0.94 46.45 2.34
17 18 603399 吉翔股份 6.96 1.16 ... 6.83 6.88 2.23 -13.83 1.80
18 19 300835 龙磁科技 23.70 1.11 ... 23.23 23.44 2.30 32.74 2.73
19 20 600111 北方稀土 18.59 1.03 ... 18.28 18.40 0.88 36.51 3.25
20 21 301026 浩通科技 21.66 1.03 ... 21.44 21.44 1.76 17.86 1.70
21 22 002167 东方锆业 4.94 1.02 ... 4.87 4.89 1.46 -380.23 2.53
22 23 600456 宝钛股份 26.40 0.92 ... 26.30 26.16 0.83 17.22 1.93
23 24 300224 正海磁材 10.32 0.58 ... 10.20 10.26 0.66 17.27 2.43
24 25 002378 章源钨业 4.73 0.42 ... 4.71 4.71 0.52 38.67 2.83
25 26 601958 金钼股份 9.86 0.41 ... 9.82 9.82 0.57 10.18 2.07
26 27 600366 宁波韵升 5.86 0.34 ... 5.85 5.84 0.78 -19.79 1.12
27 28 000970 中科三环 8.95 0.34 ... 8.89 8.92 1.04 36.51 1.67
28 29 600549 厦门钨业 16.19 0.31 ... 16.05 16.14 0.68 14.36 2.05
29 30 600392 盛和资源 8.93 0.22 ... 8.87 8.91 1.01 74.21 1.77
30 31 600459 贵研铂业 13.54 0.22 ... 13.50 13.51 0.44 19.26 1.63
31 32 600615 丰华股份 9.44 0.21 ... 9.35 9.42 2.03 -20739.46 2.80
32 33 000657 中钨高新 8.08 0.12 ... 8.02 8.07 0.89 26.84 1.97
33 34 300748 金力永磁 16.25 0.00 ... 16.10 16.25 1.02 33.16 3.09
34 35 000795 英洛华 5.04 0.00 ... 5.04 5.04 1.00 52.08 2.16
35 36 688190 云路股份 61.66 -0.48 ... 61.99 61.96 0.67 23.29 3.38
36 37 002738 中矿资源 32.29 -1.10 ... 32.10 32.65 2.25 8.54 1.96
[37 rows x 16 columns]
```

#### 东方财富-指数-日频

接口: stock_board_industry_hist_em

目标地址: http://quote.eastmoney.com/bk/90.BK1027.html
目标地址: https://quote.eastmoney.com/bk/90.BK1027.html

描述: 东方财富-沪深板块-行业板块-历史行情数据

Expand Down Expand Up @@ -20065,25 +20064,26 @@ print(stock_board_industry_cons_em_df)
```python
import akshare as ak

stock_board_industry_hist_em_df = ak.stock_board_industry_hist_em(symbol="小金属", start_date="20211201", end_date="20220401", period="日k", adjust="")
stock_board_industry_hist_em_df = ak.stock_board_industry_hist_em(symbol="小金属", start_date="20211201", end_date="20240222", period="日k", adjust="")
print(stock_board_industry_hist_em_df)
```

数据示例

```
日期 开盘 收盘 最高 ... 成交量 成交额 振幅 换手率
0 2021-12-01 1915.46 1915.23 1919.43 ... 17207231 3.134633e+10 1.77 3.60
1 2021-12-02 1909.70 1925.26 1947.38 ... 17723129 3.914958e+10 3.32 3.70
2 2021-12-03 1912.86 1923.48 1930.06 ... 14027893 3.125242e+10 2.52 2.93
3 2021-12-06 1924.43 1901.92 1940.57 ... 15612344 3.377371e+10 2.07 3.26
4 2021-12-07 1914.66 1851.77 1917.07 ... 14501660 3.131906e+10 4.61 3.03
.. ... ... ... ... ... ... ... ... ...
77 2022-03-28 1634.44 1615.75 1635.83 ... 6012528 1.089638e+10 2.35 1.26
78 2022-03-29 1620.56 1599.60 1628.25 ... 5281248 1.126460e+10 2.27 1.10
79 2022-03-30 1613.74 1639.11 1639.33 ... 6600491 1.247490e+10 1.93 1.38
80 2022-03-31 1639.40 1617.70 1639.40 ... 6728750 1.303090e+10 1.72 1.41
81 2022-04-01 1608.64 1613.60 1627.96 ... 5873748 1.135029e+10 1.78 1.23
日期 开盘 收盘 最高 ... 成交量 成交额 振幅 换手率
0 2021-12-01 1915.46 1915.23 1919.43 ... 17207231 3.134633e+10 1.77 3.68
1 2021-12-02 1909.70 1925.26 1947.38 ... 17723129 3.914958e+10 3.32 3.79
2 2021-12-03 1912.86 1923.48 1930.06 ... 14027893 3.125242e+10 2.52 3.00
3 2021-12-06 1924.43 1901.92 1940.57 ... 15612344 3.377371e+10 2.07 3.34
4 2021-12-07 1914.66 1851.77 1917.07 ... 14501660 3.131906e+10 4.61 3.10
.. ... ... ... ... ... ... ... ... ...
534 2024-02-08 1234.37 1271.41 1284.17 ... 9309314 1.033029e+10 5.01 1.99
535 2024-02-19 1271.91 1285.67 1294.59 ... 7797152 9.248781e+09 2.22 1.67
536 2024-02-20 1279.11 1285.77 1288.37 ... 5182130 6.270108e+09 1.86 1.11
537 2024-02-21 1274.53 1303.25 1336.49 ... 6059774 7.920041e+09 5.11 1.30
538 2024-02-22 1298.16 1320.27 1320.27 ... 4594781 5.684279e+09 1.94 0.98
[539 rows x 11 columns]
```

#### 东方财富-指数-分时
Expand Down

0 comments on commit aa27655

Please sign in to comment.