akshare 1.15.93__py3-none-any.whl → 1.15.95__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.
akshare/__init__.py CHANGED
@@ -3003,9 +3003,11 @@ amac_manager_cancelled_info # 中国证券投资基金业协会-信息公示-诚
3003
3003
  1.15.91 fix: fix stock_board_concept_cons_em interface
3004
3004
  1.15.92 fix: fix stock_main_fund_flow interface
3005
3005
  1.15.93 fix: fix fund_etf_spot_em interface
3006
+ 1.15.94 fix: fix stock_zh_index_spot_em interface
3007
+ 1.15.95 fix: fix stock_us_spot_em interface
3006
3008
  """
3007
3009
 
3008
- __version__ = "1.15.93"
3010
+ __version__ = "1.15.95"
3009
3011
  __author__ = "AKFamily"
3010
3012
 
3011
3013
  import sys
@@ -6,10 +6,11 @@ Desc: 天天基金-基金档案
6
6
  https://fundf10.eastmoney.com/jjfl_015641.html
7
7
  """
8
8
 
9
- import requests
10
- import pandas as pd
11
9
  from io import StringIO
12
10
 
11
+ import pandas as pd
12
+ import requests
13
+
13
14
 
14
15
  def fund_fee_em(symbol: str = "015641", indicator: str = "认购费率") -> pd.DataFrame:
15
16
  """
@@ -7,6 +7,7 @@ Desc: 股票指数数据-新浪-东财-腾讯
7
7
  https://finance.sina.com.cn/realstock/company/sz399552/nc.shtml
8
8
  """
9
9
 
10
+ import math
10
11
  import datetime
11
12
  import re
12
13
 
@@ -135,7 +136,7 @@ def __stock_zh_main_spot_em() -> pd.DataFrame:
135
136
  url = "https://33.push2.eastmoney.com/api/qt/clist/get"
136
137
  params = {
137
138
  "pn": "1",
138
- "pz": "5000",
139
+ "pz": "200",
139
140
  "po": "1",
140
141
  "np": "1",
141
142
  "ut": "bd1d9ddb04089700cf9c27f6f7426281",
@@ -151,7 +152,20 @@ def __stock_zh_main_spot_em() -> pd.DataFrame:
151
152
  }
152
153
  r = requests.get(url, params=params)
153
154
  data_json = r.json()
154
- temp_df = pd.DataFrame(data_json["data"]["diff"])
155
+ total_page = math.ceil(data_json["data"]["total"] / 200)
156
+ temp_list = []
157
+ tqdm = get_tqdm()
158
+ for page in tqdm(range(1, total_page + 1), leave=False):
159
+ params.update(
160
+ {
161
+ "pn": page,
162
+ }
163
+ )
164
+ r = requests.get(url, params=params, timeout=15)
165
+ data_json = r.json()
166
+ inner_temp_df = pd.DataFrame(data_json["data"]["diff"])
167
+ temp_list.append(inner_temp_df)
168
+ temp_df = pd.concat(temp_list, ignore_index=True)
155
169
  temp_df.reset_index(inplace=True)
156
170
  temp_df["index"] = temp_df["index"] + 1
157
171
  temp_df.rename(
@@ -205,7 +219,7 @@ def __stock_zh_main_spot_em() -> pd.DataFrame:
205
219
  return temp_df
206
220
 
207
221
 
208
- def stock_zh_index_spot_em(symbol: str = "上证系列指数") -> pd.DataFrame:
222
+ def stock_zh_index_spot_em(symbol: str = "沪深重要指数") -> pd.DataFrame:
209
223
  """
210
224
  东方财富网-行情中心-沪深京指数
211
225
  https://quote.eastmoney.com/center/gridlist.html#index_sz
@@ -226,7 +240,7 @@ def stock_zh_index_spot_em(symbol: str = "上证系列指数") -> pd.DataFrame:
226
240
  }
227
241
  params = {
228
242
  "pn": "1",
229
- "pz": "5000",
243
+ "pz": "200",
230
244
  "po": "1",
231
245
  "np": "1",
232
246
  "ut": "bd1d9ddb04089700cf9c27f6f7426281",
@@ -241,7 +255,20 @@ def stock_zh_index_spot_em(symbol: str = "上证系列指数") -> pd.DataFrame:
241
255
  }
242
256
  r = requests.get(url, params=params)
243
257
  data_json = r.json()
244
- temp_df = pd.DataFrame(data_json["data"]["diff"])
258
+ total_page = math.ceil(data_json["data"]["total"] / 200)
259
+ temp_list = []
260
+ tqdm = get_tqdm()
261
+ for page in tqdm(range(1, total_page + 1), leave=False):
262
+ params.update(
263
+ {
264
+ "pn": page,
265
+ }
266
+ )
267
+ r = requests.get(url, params=params, timeout=15)
268
+ data_json = r.json()
269
+ inner_temp_df = pd.DataFrame(data_json["data"]["diff"])
270
+ temp_list.append(inner_temp_df)
271
+ temp_df = pd.concat(temp_list, ignore_index=True)
245
272
  temp_df.reset_index(inplace=True)
246
273
  temp_df["index"] = temp_df["index"] + 1
247
274
  temp_df.rename(
@@ -1,15 +1,18 @@
1
1
  #!/usr/bin/env python
2
2
  # -*- coding:utf-8 -*-
3
3
  """
4
- Date: 2025/1/10 18:10
4
+ Date: 2025/2/16 18:10
5
5
  Desc: 东方财富网-指数行情数据
6
6
  """
7
7
 
8
+ import math
8
9
  from functools import lru_cache
9
10
 
10
11
  import pandas as pd
11
12
  import requests
12
13
 
14
+ from akshare.utils.tqdm import get_tqdm
15
+
13
16
 
14
17
  @lru_cache()
15
18
  def index_code_id_map_em() -> dict:
@@ -22,7 +25,7 @@ def index_code_id_map_em() -> dict:
22
25
  url = "https://80.push2.eastmoney.com/api/qt/clist/get"
23
26
  params = {
24
27
  "pn": "1",
25
- "pz": "10000",
28
+ "pz": "200",
26
29
  "po": "1",
27
30
  "np": "1",
28
31
  "ut": "bd1d9ddb04089700cf9c27f6f7426281",
@@ -35,15 +38,26 @@ def index_code_id_map_em() -> dict:
35
38
  }
36
39
  r = requests.get(url, params=params)
37
40
  data_json = r.json()
38
- if not data_json["data"]["diff"]:
39
- return dict()
40
- temp_df = pd.DataFrame(data_json["data"]["diff"])
41
+ total_page = math.ceil(data_json["data"]["total"] / 200)
42
+ temp_list = []
43
+ tqdm = get_tqdm()
44
+ for page in tqdm(range(1, total_page + 1), leave=False):
45
+ params.update(
46
+ {
47
+ "pn": page,
48
+ }
49
+ )
50
+ r = requests.get(url, params=params, timeout=15)
51
+ data_json = r.json()
52
+ inner_temp_df = pd.DataFrame(data_json["data"]["diff"])
53
+ temp_list.append(inner_temp_df)
54
+ temp_df = pd.concat(temp_list, ignore_index=True)
41
55
  temp_df["market_id"] = 1
42
56
  temp_df.columns = ["sh_code", "sh_id"]
43
57
  code_id_dict = dict(zip(temp_df["sh_code"], temp_df["sh_id"]))
44
58
  params = {
45
59
  "pn": "1",
46
- "pz": "10000",
60
+ "pz": "200",
47
61
  "po": "1",
48
62
  "np": "1",
49
63
  "ut": "bd1d9ddb04089700cf9c27f6f7426281",
@@ -56,14 +70,26 @@ def index_code_id_map_em() -> dict:
56
70
  }
57
71
  r = requests.get(url, params=params)
58
72
  data_json = r.json()
59
- if not data_json["data"]["diff"]:
60
- return dict()
61
- temp_df_sz = pd.DataFrame(data_json["data"]["diff"])
73
+ total_page = math.ceil(data_json["data"]["total"] / 200)
74
+ temp_list = []
75
+ tqdm = get_tqdm()
76
+ for page in tqdm(range(1, total_page + 1), leave=False):
77
+ params.update(
78
+ {
79
+ "pn": page,
80
+ }
81
+ )
82
+ r = requests.get(url, params=params, timeout=15)
83
+ data_json = r.json()
84
+ inner_temp_df = pd.DataFrame(data_json["data"]["diff"])
85
+ temp_list.append(inner_temp_df)
86
+ temp_df_sz = pd.concat(temp_list, ignore_index=True)
62
87
  temp_df_sz["sz_id"] = 0
63
88
  code_id_dict.update(dict(zip(temp_df_sz["f12"], temp_df_sz["sz_id"])))
89
+
64
90
  params = {
65
91
  "pn": "1",
66
- "pz": "10000",
92
+ "pz": "200",
67
93
  "po": "1",
68
94
  "np": "1",
69
95
  "ut": "bd1d9ddb04089700cf9c27f6f7426281",
@@ -76,9 +102,20 @@ def index_code_id_map_em() -> dict:
76
102
  }
77
103
  r = requests.get(url, params=params)
78
104
  data_json = r.json()
79
- if not data_json["data"]["diff"]:
80
- return dict()
81
- temp_df_sz = pd.DataFrame(data_json["data"]["diff"])
105
+ total_page = math.ceil(data_json["data"]["total"] / 200)
106
+ temp_list = []
107
+ tqdm = get_tqdm()
108
+ for page in tqdm(range(1, total_page + 1), leave=False):
109
+ params.update(
110
+ {
111
+ "pn": page,
112
+ }
113
+ )
114
+ r = requests.get(url, params=params, timeout=15)
115
+ data_json = r.json()
116
+ inner_temp_df = pd.DataFrame(data_json["data"]["diff"])
117
+ temp_list.append(inner_temp_df)
118
+ temp_df_sz = pd.concat(temp_list, ignore_index=True)
82
119
  temp_df_sz["bj_id"] = 0
83
120
  code_id_dict.update(dict(zip(temp_df_sz["f12"], temp_df_sz["bj_id"])))
84
121
  code_id_dict = {
@@ -440,9 +477,9 @@ if __name__ == "__main__":
440
477
  print(index_zh_a_hist_df)
441
478
 
442
479
  index_zh_a_hist_min_em_df = index_zh_a_hist_min_em(
443
- symbol="932000",
444
- period="1",
445
- start_date="2025-01-10 09:30:00",
446
- end_date="2025-01-10 19:00:00",
480
+ symbol="000001",
481
+ period="15",
482
+ start_date="2025-02-14 09:30:00",
483
+ end_date="2025-02-14 19:00:00",
447
484
  )
448
485
  print(index_zh_a_hist_min_em_df)
@@ -1,7 +1,7 @@
1
1
  #!/usr/bin/env python
2
2
  # -*- coding:utf-8 -*-
3
3
  """
4
- Date: 2024/3/20 15:00
4
+ Date: 2025/2/16 18:30
5
5
  Desc: 东方财富-行情报价
6
6
  https://quote.eastmoney.com/sz000001.html
7
7
  """
@@ -6,10 +6,12 @@ Desc: 东方财富网-行情首页-沪深京 A 股
6
6
  https://quote.eastmoney.com/
7
7
  """
8
8
 
9
- from functools import lru_cache
10
9
  import math
10
+ from functools import lru_cache
11
+
11
12
  import pandas as pd
12
13
  import requests
14
+
13
15
  from akshare.utils.tqdm import get_tqdm
14
16
 
15
17
 
@@ -1730,7 +1732,7 @@ def stock_us_spot_em() -> pd.DataFrame:
1730
1732
  url = "https://72.push2.eastmoney.com/api/qt/clist/get"
1731
1733
  params = {
1732
1734
  "pn": "1",
1733
- "pz": "20000",
1735
+ "pz": "200",
1734
1736
  "po": "1",
1735
1737
  "np": "1",
1736
1738
  "ut": "bd1d9ddb04089700cf9c27f6f7426281",
@@ -1744,7 +1746,20 @@ def stock_us_spot_em() -> pd.DataFrame:
1744
1746
  }
1745
1747
  r = requests.get(url, timeout=15, params=params)
1746
1748
  data_json = r.json()
1747
- temp_df = pd.DataFrame(data_json["data"]["diff"])
1749
+ total_page = math.ceil(data_json["data"]["total"] / 200)
1750
+ temp_list = []
1751
+ tqdm = get_tqdm()
1752
+ for page in tqdm(range(1, total_page + 1), leave=False):
1753
+ params.update(
1754
+ {
1755
+ "pn": page,
1756
+ }
1757
+ )
1758
+ r = requests.get(url, params=params, timeout=15)
1759
+ data_json = r.json()
1760
+ inner_temp_df = pd.DataFrame(data_json["data"]["diff"])
1761
+ temp_list.append(inner_temp_df)
1762
+ temp_df = pd.concat(temp_list, ignore_index=True)
1748
1763
  temp_df.columns = [
1749
1764
  "_",
1750
1765
  "最新价",
@@ -2052,9 +2067,9 @@ if __name__ == "__main__":
2052
2067
  print(stock_us_hist_min_em_df)
2053
2068
 
2054
2069
  stock_zh_a_hist_min_em_df = stock_zh_a_hist_min_em(
2055
- symbol="000001",
2056
- start_date="2024-03-20 09:30:00",
2057
- end_date="2024-03-20 15:00:00",
2070
+ symbol="002881",
2071
+ start_date="2025-02-14 09:30:00",
2072
+ end_date="2025-02-14 15:00:00",
2058
2073
  period="5",
2059
2074
  adjust="hfq",
2060
2075
  )
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.2
2
2
  Name: akshare
3
- Version: 1.15.93
3
+ Version: 1.15.95
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=pLRcn57d-L-a8Rvet-SX5fDjoW0qd_zTD8FnvKWe2Ts,187237
1
+ akshare/__init__.py,sha256=_RNaea-_Q7gKyinvchTt6fy9jY7K7JQ-5xVSS4jQlvg,187331
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
@@ -89,7 +89,7 @@ akshare/fund/fund_em.py,sha256=nX0VA5JeiF-zRr1J10X-U9-pJj5KFDUAbovN1DWjvTo,40450
89
89
  akshare/fund/fund_etf_em.py,sha256=a2h_htijqERVaplRYt3D8GALGFh8w3uLtlRo9y4aLaI,18319
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
- akshare/fund/fund_fee_em.py,sha256=rkA2qVEhuWBUTFlvEP-zY_4Fw7_vL9cDx9hR-P38yDk,4157
92
+ akshare/fund/fund_fee_em.py,sha256=fa_Nfr4GWx4FNzNY0blBPhIZ3fGW5qedQOuYIAlVsvE,4158
93
93
  akshare/fund/fund_fhsp_em.py,sha256=-zSwwveiCB4HHRxwAuaLDTQHmNe3FxwxxeoPeiG8JbM,5546
94
94
  akshare/fund/fund_init_em.py,sha256=4kOhsOkEs50B-RAxz-fTyWxNC1J4jNBDoKGJlFUpIjQ,2210
95
95
  akshare/fund/fund_lof_em.py,sha256=eWpIlHzUYbscyxvz8awiDERxd7gTucHcGcrBPTCCFno,12473
@@ -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-tfbz6KHTLmBJimSzvaINrdmkWJ8V-mUkjcy7ly258,17669
170
+ akshare/index/index_stock_zh.py,sha256=vwOmUs6B7XPJSVYK8A0kfRu8ewBkArIkxSYmpflOOLg,18563
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=j62koX1r5ifRNWUgRW8tHs_xRYJrn_CgyMitZlQaoIE,16419
176
+ akshare/index/index_zh_em.py,sha256=j4vxtEb6hrCUVIlO0Tyey9REhI4ILa-rywTNQPtPQ_4,17614
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
@@ -230,7 +230,7 @@ akshare/spot/spot_sge.py,sha256=sXaUGPm8yEXogssNFyFgTlnpf363g7s3U6xO4Zyvk9g,8213
230
230
  akshare/stock/__init__.py,sha256=jSa9260d6aNZajaW68chI2mpPkDSXLOgi3eXrqo4MQ8,82
231
231
  akshare/stock/cons.py,sha256=0oyUW5Pu-iQ3qgh-TFemM_O5f1fAwVe-PsI4Qa8EYpQ,42956
232
232
  akshare/stock/stock_allotment_cninfo.py,sha256=OVjVdWp2XVRNbJvVgtgVVoBmPBJgBB4RyIIgA_9QHM8,6066
233
- akshare/stock/stock_ask_bid_em.py,sha256=ioVkmRMVs7A7Lj_PboxwIoZINNk73nAko80wIJX4RKU,5510
233
+ akshare/stock/stock_ask_bid_em.py,sha256=6RdOK5820SR3CylISZoA2po8DpRvL8lvtVq794po0ls,5510
234
234
  akshare/stock/stock_board_concept_em.py,sha256=zCtHicBUcFN3GN2b5sKd0JV74KVSZKOOHDxS7v9DeCM,14042
235
235
  akshare/stock/stock_board_industry_em.py,sha256=AfRVUVZrgSJXaoKAK81Ga-_m3hfv8YZzczBnnBdFq-I,16195
236
236
  akshare/stock/stock_cg_equity_mortgage.py,sha256=Pui5aWKKPwGuKjF_GNpejDzsMGNPrxiaJviLz3x2e9I,3426
@@ -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=ibI1uQvI-UwkQ9dvSWLMmGdOLbr9u_e083SUxbV20_8,70766
314
+ akshare/stock_feature/stock_hist_em.py,sha256=BfquRZiou859x1S7x-nJxO7rm8IbPjsNFa47KwbqhuI,71208
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.93.dist-info/LICENSE,sha256=mmSZCPgfHiVw34LXuFArd-SUgQtBJ_QsIlh-kWlDHfs,1073
384
- akshare-1.15.93.dist-info/METADATA,sha256=1BlzSPJYYXMrwnTGzRxw8eTGD84cTjh24MUVkRjq1yY,13679
385
- akshare-1.15.93.dist-info/WHEEL,sha256=In9FTNxeP60KnTkGw7wk6mJPYd_dQSjEZmXdBdMCI-8,91
386
- akshare-1.15.93.dist-info/top_level.txt,sha256=jsf9ZzZPmHaISTVumQPsAw7vv7Yv-PdEVW70SMEelQQ,14
387
- akshare-1.15.93.dist-info/RECORD,,
383
+ akshare-1.15.95.dist-info/LICENSE,sha256=mmSZCPgfHiVw34LXuFArd-SUgQtBJ_QsIlh-kWlDHfs,1073
384
+ akshare-1.15.95.dist-info/METADATA,sha256=aAPD-yMxNh_DVWgBbJ48FsvnvfrdzEdTaiRRe9N4gLE,13679
385
+ akshare-1.15.95.dist-info/WHEEL,sha256=In9FTNxeP60KnTkGw7wk6mJPYd_dQSjEZmXdBdMCI-8,91
386
+ akshare-1.15.95.dist-info/top_level.txt,sha256=jsf9ZzZPmHaISTVumQPsAw7vv7Yv-PdEVW70SMEelQQ,14
387
+ akshare-1.15.95.dist-info/RECORD,,