akshare 1.15.96__py3-none-any.whl → 1.15.97__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.

Potentially problematic release.


This version of akshare might be problematic. Click here for more details.

akshare/__init__.py CHANGED
@@ -3006,9 +3006,10 @@ amac_manager_cancelled_info # 中国证券投资基金业协会-信息公示-诚
3006
3006
  1.15.94 fix: fix stock_zh_index_spot_em interface
3007
3007
  1.15.95 fix: fix stock_us_spot_em interface
3008
3008
  1.15.96 fix: fix bond_cov_comparison interface
3009
+ 1.15.97 fix: fix stock_intraday_em interface
3009
3010
  """
3010
3011
 
3011
- __version__ = "1.15.96"
3012
+ __version__ = "1.15.97"
3012
3013
  __author__ = "AKFamily"
3013
3014
 
3014
3015
  import sys
@@ -73,7 +73,7 @@ def fund_etf_spot_em() -> pd.DataFrame:
73
73
  "fltt": "2",
74
74
  "invt": "2",
75
75
  "wbp2u": "|0|0|0|web",
76
- "fid": "f3",
76
+ "fid": "f12",
77
77
  "fs": "b:MK0021,b:MK0022,b:MK0023,b:MK0024,b:MK0827",
78
78
  "fields": (
79
79
  "f1,f2,f3,f4,f5,f6,f7,f8,f9,f10,"
@@ -247,7 +247,7 @@ def stock_zh_index_spot_em(symbol: str = "沪深重要指数") -> pd.DataFrame:
247
247
  "fltt": "2",
248
248
  "invt": "2",
249
249
  "wbp2u": "|0|0|0|web",
250
- "fid": "f3",
250
+ "fid": "f12",
251
251
  "fs": symbol_map[symbol],
252
252
  "fields": "f1,f2,f3,f4,f5,f6,f7,f8,f9,f10,f12,f13,f14,f15,f16,f17,f18,f20,f21,f23,f24,f25,"
253
253
  "f26,f22,f33,f11,f62,f128,f136,f115,f152",
@@ -31,7 +31,7 @@ def index_code_id_map_em() -> dict:
31
31
  "ut": "bd1d9ddb04089700cf9c27f6f7426281",
32
32
  "fltt": "2",
33
33
  "invt": "2",
34
- "fid": "f3",
34
+ "fid": "f12",
35
35
  "fs": "m:1 t:2,m:1 t:23",
36
36
  "fields": "f12",
37
37
  "_": "1623833739532",
@@ -63,7 +63,7 @@ def index_code_id_map_em() -> dict:
63
63
  "ut": "bd1d9ddb04089700cf9c27f6f7426281",
64
64
  "fltt": "2",
65
65
  "invt": "2",
66
- "fid": "f3",
66
+ "fid": "f12",
67
67
  "fs": "m:0 t:6,m:0 t:80",
68
68
  "fields": "f12",
69
69
  "_": "1623833739532",
@@ -95,7 +95,7 @@ def index_code_id_map_em() -> dict:
95
95
  "ut": "bd1d9ddb04089700cf9c27f6f7426281",
96
96
  "fltt": "2",
97
97
  "invt": "2",
98
- "fid": "f3",
98
+ "fid": "f12",
99
99
  "fs": "m:0 t:81 s:2048",
100
100
  "fields": "f12",
101
101
  "_": "1623833739532",
@@ -1,17 +1,20 @@
1
1
  #!/usr/bin/env python
2
2
  # -*- coding:utf-8 -*-
3
3
  """
4
- Date: 2023/10/14 22:00
4
+ Date: 2025/2/17 14:00
5
5
  Desc: 东财财富-日内分时数据
6
6
  https://quote.eastmoney.com/f1.html?newcode=0.000001
7
7
  """
8
8
 
9
9
  import json
10
+ import math
10
11
  from functools import lru_cache
11
12
 
12
13
  import pandas as pd
13
14
  import requests
14
15
 
16
+ from akshare.utils.tqdm import get_tqdm
17
+
15
18
 
16
19
  @lru_cache()
17
20
  def __code_id_map_em() -> dict:
@@ -24,13 +27,13 @@ def __code_id_map_em() -> dict:
24
27
  url = "http://80.push2.eastmoney.com/api/qt/clist/get"
25
28
  params = {
26
29
  "pn": "1",
27
- "pz": "50000",
30
+ "pz": "200",
28
31
  "po": "1",
29
32
  "np": "1",
30
33
  "ut": "bd1d9ddb04089700cf9c27f6f7426281",
31
34
  "fltt": "2",
32
35
  "invt": "2",
33
- "fid": "f3",
36
+ "fid": "f12",
34
37
  "fs": "m:1 t:2,m:1 t:23",
35
38
  "fields": "f12",
36
39
  "_": "1623833739532",
@@ -39,19 +42,32 @@ def __code_id_map_em() -> dict:
39
42
  data_json = r.json()
40
43
  if not data_json["data"]["diff"]:
41
44
  return dict()
42
- temp_df = pd.DataFrame(data_json["data"]["diff"])
45
+ total_page = math.ceil(data_json["data"]["total"] / 200)
46
+ temp_list = []
47
+ tqdm = get_tqdm()
48
+ for page in tqdm(range(1, total_page + 1), leave=False):
49
+ params.update(
50
+ {
51
+ "pn": page,
52
+ }
53
+ )
54
+ r = requests.get(url, params=params, timeout=15)
55
+ data_json = r.json()
56
+ inner_temp_df = pd.DataFrame(data_json["data"]["diff"])
57
+ temp_list.append(inner_temp_df)
58
+ temp_df = pd.concat(temp_list, ignore_index=True)
43
59
  temp_df["market_id"] = 1
44
60
  temp_df.columns = ["sh_code", "sh_id"]
45
61
  code_id_dict = dict(zip(temp_df["sh_code"], temp_df["sh_id"]))
46
62
  params = {
47
63
  "pn": "1",
48
- "pz": "50000",
64
+ "pz": "200",
49
65
  "po": "1",
50
66
  "np": "1",
51
67
  "ut": "bd1d9ddb04089700cf9c27f6f7426281",
52
68
  "fltt": "2",
53
69
  "invt": "2",
54
- "fid": "f3",
70
+ "fid": "f12",
55
71
  "fs": "m:0 t:6,m:0 t:80",
56
72
  "fields": "f12",
57
73
  "_": "1623833739532",
@@ -60,18 +76,31 @@ def __code_id_map_em() -> dict:
60
76
  data_json = r.json()
61
77
  if not data_json["data"]["diff"]:
62
78
  return dict()
63
- temp_df_sz = pd.DataFrame(data_json["data"]["diff"])
79
+ total_page = math.ceil(data_json["data"]["total"] / 200)
80
+ temp_list = []
81
+ tqdm = get_tqdm()
82
+ for page in tqdm(range(1, total_page + 1), leave=False):
83
+ params.update(
84
+ {
85
+ "pn": page,
86
+ }
87
+ )
88
+ r = requests.get(url, params=params, timeout=15)
89
+ data_json = r.json()
90
+ inner_temp_df = pd.DataFrame(data_json["data"]["diff"])
91
+ temp_list.append(inner_temp_df)
92
+ temp_df_sz = pd.concat(temp_list, ignore_index=True)
64
93
  temp_df_sz["sz_id"] = 0
65
94
  code_id_dict.update(dict(zip(temp_df_sz["f12"], temp_df_sz["sz_id"])))
66
95
  params = {
67
96
  "pn": "1",
68
- "pz": "50000",
97
+ "pz": "200",
69
98
  "po": "1",
70
99
  "np": "1",
71
100
  "ut": "bd1d9ddb04089700cf9c27f6f7426281",
72
101
  "fltt": "2",
73
102
  "invt": "2",
74
- "fid": "f3",
103
+ "fid": "f12",
75
104
  "fs": "m:0 t:81 s:2048",
76
105
  "fields": "f12",
77
106
  "_": "1623833739532",
@@ -80,7 +109,20 @@ def __code_id_map_em() -> dict:
80
109
  data_json = r.json()
81
110
  if not data_json["data"]["diff"]:
82
111
  return dict()
83
- temp_df_sz = pd.DataFrame(data_json["data"]["diff"])
112
+ total_page = math.ceil(data_json["data"]["total"] / 200)
113
+ temp_list = []
114
+ tqdm = get_tqdm()
115
+ for page in tqdm(range(1, total_page + 1), leave=False):
116
+ params.update(
117
+ {
118
+ "pn": page,
119
+ }
120
+ )
121
+ r = requests.get(url, params=params, timeout=15)
122
+ data_json = r.json()
123
+ inner_temp_df = pd.DataFrame(data_json["data"]["diff"])
124
+ temp_list.append(inner_temp_df)
125
+ temp_df_sz = pd.concat(temp_list, ignore_index=True)
84
126
  temp_df_sz["bj_id"] = 0
85
127
  code_id_dict.update(dict(zip(temp_df_sz["f12"], temp_df_sz["bj_id"])))
86
128
  return code_id_dict
@@ -121,9 +163,7 @@ def stock_intraday_em(symbol: str = "000001") -> pd.DataFrame:
121
163
  "secid": f"{code_id_map_em_dict[symbol]}.{symbol}",
122
164
  "wbp2u": "|0|0|0|web",
123
165
  }
124
-
125
166
  big_df = pd.DataFrame() # 创建一个空的 DataFrame
126
-
127
167
  for event in __event_stream(url, params):
128
168
  # 从每个事件的数据行中删除 "data: ",然后解析 JSON
129
169
  event_json = json.loads(event.replace("data: ", ""))
@@ -1,7 +1,7 @@
1
1
  #!/usr/bin/env python
2
2
  # -*- coding:utf-8 -*-
3
3
  """
4
- Date: 2025/2/15 21:00
4
+ Date: 2025/2/17 14:00
5
5
  Desc: 东方财富网-行情首页-沪深京 A 股
6
6
  https://quote.eastmoney.com/
7
7
  """
@@ -151,7 +151,7 @@ def stock_sh_a_spot_em() -> pd.DataFrame:
151
151
  url = "https://82.push2.eastmoney.com/api/qt/clist/get"
152
152
  params = {
153
153
  "pn": "1",
154
- "pz": "50000",
154
+ "pz": "200",
155
155
  "po": "1",
156
156
  "np": "1",
157
157
  "ut": "bd1d9ddb04089700cf9c27f6f7426281",
@@ -167,7 +167,20 @@ def stock_sh_a_spot_em() -> pd.DataFrame:
167
167
  data_json = r.json()
168
168
  if not data_json["data"]["diff"]:
169
169
  return pd.DataFrame()
170
- temp_df = pd.DataFrame(data_json["data"]["diff"])
170
+ total_page = math.ceil(data_json["data"]["total"] / 200)
171
+ temp_list = []
172
+ tqdm = get_tqdm()
173
+ for page in tqdm(range(1, total_page + 1), leave=False):
174
+ params.update(
175
+ {
176
+ "pn": page,
177
+ }
178
+ )
179
+ r = requests.get(url, params=params, timeout=15)
180
+ data_json = r.json()
181
+ inner_temp_df = pd.DataFrame(data_json["data"]["diff"])
182
+ temp_list.append(inner_temp_df)
183
+ temp_df = pd.concat(temp_list, ignore_index=True)
171
184
  temp_df.columns = [
172
185
  "_",
173
186
  "最新价",
@@ -266,7 +279,7 @@ def stock_sz_a_spot_em() -> pd.DataFrame:
266
279
  url = "https://82.push2.eastmoney.com/api/qt/clist/get"
267
280
  params = {
268
281
  "pn": "1",
269
- "pz": "50000",
282
+ "pz": "200",
270
283
  "po": "1",
271
284
  "np": "1",
272
285
  "ut": "bd1d9ddb04089700cf9c27f6f7426281",
@@ -282,7 +295,20 @@ def stock_sz_a_spot_em() -> pd.DataFrame:
282
295
  data_json = r.json()
283
296
  if not data_json["data"]["diff"]:
284
297
  return pd.DataFrame()
285
- temp_df = pd.DataFrame(data_json["data"]["diff"])
298
+ total_page = math.ceil(data_json["data"]["total"] / 200)
299
+ temp_list = []
300
+ tqdm = get_tqdm()
301
+ for page in tqdm(range(1, total_page + 1), leave=False):
302
+ params.update(
303
+ {
304
+ "pn": page,
305
+ }
306
+ )
307
+ r = requests.get(url, params=params, timeout=15)
308
+ data_json = r.json()
309
+ inner_temp_df = pd.DataFrame(data_json["data"]["diff"])
310
+ temp_list.append(inner_temp_df)
311
+ temp_df = pd.concat(temp_list, ignore_index=True)
286
312
  temp_df.columns = [
287
313
  "_",
288
314
  "最新价",
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.2
2
2
  Name: akshare
3
- Version: 1.15.96
3
+ Version: 1.15.97
4
4
  Summary: AKShare is an elegant and simple financial data interface library for Python, built for human beings!
5
5
  Home-page: https://github.com/akfamily/akshare
6
6
  Author: AKFamily
@@ -1,4 +1,4 @@
1
- akshare/__init__.py,sha256=O6QRS4yLoVvgcYmSl5gPP3Zp7FzMNOp5WIqMMuVf_Lk,187378
1
+ akshare/__init__.py,sha256=-fpSUTt2coTEzLEVK_Dxhaoma0ptMyZRcLGC9RVNK0M,187423
2
2
  akshare/datasets.py,sha256=rKuRNZrqi6IMsZ9nyvO3Rx02js0tH3zMLjz8HQNAoPQ,963
3
3
  akshare/exceptions.py,sha256=WEJjIhSmJ_xXNW6grwV4nufE_cfmmyuhmueVGiN1VAg,878
4
4
  akshare/request.py,sha256=HtFFf9MhfEibR-ETWe-1Tts6ELU4VKSqA-ghaXjegQM,4252
@@ -86,7 +86,7 @@ akshare/fund/fund_amac.py,sha256=Dml3EgpJhmVgkttb0OdaWN41ynOCIbJ0-1qAPDWF0oo,338
86
86
  akshare/fund/fund_announcement.py,sha256=g5rcIC9vQ4HapZd0b7cDbFYzHu9V6bOKhwxRHVfmv8k,1848
87
87
  akshare/fund/fund_aum_em.py,sha256=dy1R1-0X48H8S-LPiuggNA5M-6MvQ08fnp5bytvCGPQ,3518
88
88
  akshare/fund/fund_em.py,sha256=nX0VA5JeiF-zRr1J10X-U9-pJj5KFDUAbovN1DWjvTo,40450
89
- akshare/fund/fund_etf_em.py,sha256=a2h_htijqERVaplRYt3D8GALGFh8w3uLtlRo9y4aLaI,18319
89
+ akshare/fund/fund_etf_em.py,sha256=WdekgvHHyBOA5ON3x--7I4uTnp_2U09hooszHlDqfDI,18320
90
90
  akshare/fund/fund_etf_sina.py,sha256=YV2KrqKMF_h8kgrywvWvRJx2oy62lhgizvHFk40E4Rk,7042
91
91
  akshare/fund/fund_etf_ths.py,sha256=vb_jy0h2-Kz2dNWUrwBYxPB0MAotv0KZgnFhE98ohSM,3432
92
92
  akshare/fund/fund_fee_em.py,sha256=fa_Nfr4GWx4FNzNY0blBPhIZ3fGW5qedQOuYIAlVsvE,4158
@@ -167,13 +167,13 @@ akshare/index/index_research_sw.py,sha256=Mm1YtiP-PXhDysJwmFidX3RZSZZ92AyXpjl_tV
167
167
  akshare/index/index_spot.py,sha256=meTBTCp2DPVTX_N3qpCLtkI-0q3XhrJ3gndNugRBGKg,1767
168
168
  akshare/index/index_stock_hk.py,sha256=nPFzRrjyiUpRK-OSDsdi5AFCKHNKqOVji6WJcQxOvNo,9781
169
169
  akshare/index/index_stock_us_sina.py,sha256=IxOk4G49oasv7EfEQenL9-GLuelyUus6c4JPyRlaOzY,1551
170
- akshare/index/index_stock_zh.py,sha256=A_-vZ0jk-UCBd4B0SbzAnctVUBilnc3IoSd-2EWZX6M,18724
170
+ akshare/index/index_stock_zh.py,sha256=NpzOI3VudIMsIwEm549Mr3tQ4Dwa9IC0d6gb4h_FuEY,18725
171
171
  akshare/index/index_stock_zh_csindex.py,sha256=sRVoDD-fitqAMuDs0XPm1oCz2nZ2QTkvNswL1WvXpwo,4164
172
172
  akshare/index/index_sugar.py,sha256=B_Nj9Q6JP-Y_d7myZ0C79izTxxrbuZIp1Vv_CilVMOc,5006
173
173
  akshare/index/index_sw.py,sha256=hETMmFszQb7JDY8UHjLK8szfwkr7Ui_6QcseOoEfxaI,10456
174
174
  akshare/index/index_yw.py,sha256=6FF38kooLQulnMTqAd1__TNWip4XC1VA72k3T049xYc,4319
175
175
  akshare/index/index_zh_a_scope.py,sha256=4Ej2Gnqtd66EBiI67sQZKhblcIJXdD5CoMIJYD_KwYU,1367
176
- akshare/index/index_zh_em.py,sha256=j4vxtEb6hrCUVIlO0Tyey9REhI4ILa-rywTNQPtPQ_4,17614
176
+ akshare/index/index_zh_em.py,sha256=o_GbQ6cfr7DSyyjnFnJYv_rlDVTQePq9kvoG3fAShUU,17617
177
177
  akshare/interest_rate/__init__.py,sha256=O6dl1roEQUWwtXgRpa6wOABUU7MH0YmFDrkfhBpYOX4,81
178
178
  akshare/interest_rate/interbank_rate_em.py,sha256=iKvmWxM4bpl9JgHNvavq0yhzMRq69BPEON1cGcWJrf4,4549
179
179
  akshare/movie/__init__.py,sha256=YzijIIzvGpcc9hORC6qJSEK6vkjH5c4Docb5tQq2iHs,82
@@ -257,7 +257,7 @@ akshare/stock/stock_industry_pe_cninfo.py,sha256=0OjjsFGG90zJRZEBqaCsjKSpSAgrp3P
257
257
  akshare/stock/stock_industry_sw.py,sha256=C0FjDg976EA0EksRS3sChbmJOZmOPEOzKCrHVs2YqTg,1441
258
258
  akshare/stock/stock_info.py,sha256=AqzLzsTlYTSExBtyrZZBjI-D-VROj9e7Sq37WKHJ7XQ,16314
259
259
  akshare/stock/stock_info_em.py,sha256=F-K8ZzWW70KTzShP82semh8RKklUEot2zxuzNDum20I,2615
260
- akshare/stock/stock_intraday_em.py,sha256=r1DvqVpRMJH_Y14GmgbKXQUWYi_KFhnEvsHD0Mp384o,4532
260
+ akshare/stock/stock_intraday_em.py,sha256=cm0qKVeCOqmjqd3WxqwjMCoa1uMA2zb98f6HX9_pIPQ,5905
261
261
  akshare/stock/stock_intraday_sina.py,sha256=HMuAAO2Teu4NUrOcBvyJdxYgWx-51qJCdtcqFmFNQg8,2359
262
262
  akshare/stock/stock_ipo_summary_cninfo.py,sha256=Ma-54GsOOhRWxilLH-Qmm0VVbpJQGf2XWKaJ8NBSgAY,3847
263
263
  akshare/stock/stock_new_cninfo.py,sha256=EOuZowDLQSSHyPAwXcuPXbQkqhbz2nRBZsM7o2ZWILE,5725
@@ -311,7 +311,7 @@ akshare/stock_feature/stock_gdhs.py,sha256=Z6ZMy1A03BqMu9TghcIu2Sd_wwEtpIH7qawHu
311
311
  akshare/stock_feature/stock_gdzjc_em.py,sha256=SHJH5iS3_NhvjTqRXF0vPooZl0s_ASeyZmNCC50ZYqs,4426
312
312
  akshare/stock_feature/stock_gpzy_em.py,sha256=FgyjVgdoxrtMM7WwxdQJxK0mYGJklIHaT9KmMCFmEPM,17869
313
313
  akshare/stock_feature/stock_gxl_lg.py,sha256=I8TpDEpFzadZSSyZisyIk6163mJlRxup91dmlBH4t4U,2641
314
- akshare/stock_feature/stock_hist_em.py,sha256=1glmjIwnJ8c_G5Jk3QteK-Xjl3PNuk9_Meu8ylhUXLA,71648
314
+ akshare/stock_feature/stock_hist_em.py,sha256=gFB9EUehXrCKvHd-QHyBLYesPEXq1YpJosoDYOPwUno,72528
315
315
  akshare/stock_feature/stock_hist_tx.py,sha256=WpLsbkG2didSx7lYNkSbTWNTrLhUKbcopfD18WO2Rlc,3397
316
316
  akshare/stock_feature/stock_hk_valuation_baidu.py,sha256=_sErx4UhNsSXJgXyPfrL0aPxkW53Mg1zH9gEKoziaCA,1968
317
317
  akshare/stock_feature/stock_hot_xq.py,sha256=NmoH4x-0hiDztj-YwzMFVIyOICQ2wUUBbhjt91q-tq4,9112
@@ -380,8 +380,8 @@ akshare/utils/token_process.py,sha256=K4rGXjh_tgugbRcyOK2h2x0jP3PT65IIK7nxhUKhOe
380
380
  akshare/utils/tqdm.py,sha256=MuPNwcswkOGjwWQOMWXi9ZvQ_RmW4obCWRj2i7HM7FE,847
381
381
  tests/__init__.py,sha256=gNzhlO0UPjFq6Ieb38kaVIODXv4cTDByrdohAZnDYt4,82
382
382
  tests/test_func.py,sha256=j1MGYbZI2if2j_LY1S4FLsf4qfq4NwVqD5wmRlv5Log,832
383
- akshare-1.15.96.dist-info/LICENSE,sha256=mmSZCPgfHiVw34LXuFArd-SUgQtBJ_QsIlh-kWlDHfs,1073
384
- akshare-1.15.96.dist-info/METADATA,sha256=BoL4xFItQel6sCyaihQ3MqGkCMViEYHExw47z6F1w8U,13679
385
- akshare-1.15.96.dist-info/WHEEL,sha256=In9FTNxeP60KnTkGw7wk6mJPYd_dQSjEZmXdBdMCI-8,91
386
- akshare-1.15.96.dist-info/top_level.txt,sha256=jsf9ZzZPmHaISTVumQPsAw7vv7Yv-PdEVW70SMEelQQ,14
387
- akshare-1.15.96.dist-info/RECORD,,
383
+ akshare-1.15.97.dist-info/LICENSE,sha256=mmSZCPgfHiVw34LXuFArd-SUgQtBJ_QsIlh-kWlDHfs,1073
384
+ akshare-1.15.97.dist-info/METADATA,sha256=oc2rkfI8yv9Rw9tnO2Flx5nmYdEPDAO9PxHaHVUbIn0,13679
385
+ akshare-1.15.97.dist-info/WHEEL,sha256=In9FTNxeP60KnTkGw7wk6mJPYd_dQSjEZmXdBdMCI-8,91
386
+ akshare-1.15.97.dist-info/top_level.txt,sha256=jsf9ZzZPmHaISTVumQPsAw7vv7Yv-PdEVW70SMEelQQ,14
387
+ akshare-1.15.97.dist-info/RECORD,,