akshare 1.16.2__py3-none-any.whl → 1.16.3__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
@@ -3011,9 +3011,10 @@ amac_manager_cancelled_info # 中国证券投资基金业协会-信息公示-诚
3011
3011
  1.15.99 fix: fix stock_esg_zd_sina interface
3012
3012
  1.16.1 fix: fix stock_main_fund_flow interface
3013
3013
  1.16.2 fix: fix stock_board_industry_hist_em interface
3014
+ 1.16.3 fix: fix stock_zh_index_spot_em interface
3014
3015
  """
3015
3016
 
3016
- __version__ = "1.16.2"
3017
+ __version__ = "1.16.3"
3017
3018
  __author__ = "AKFamily"
3018
3019
 
3019
3020
  import sys
@@ -1,13 +1,12 @@
1
1
  #!/usr/bin/env python
2
2
  # -*- coding:utf-8 -*-
3
3
  """
4
- Date: 2024/5/28 15:30
4
+ Date: 2025/2/17 20:30
5
5
  Desc: 股票指数数据-新浪-东财-腾讯
6
6
  所有指数-实时行情数据和历史行情数据
7
7
  https://finance.sina.com.cn/realstock/company/sz399552/nc.shtml
8
8
  """
9
9
 
10
- import math
11
10
  import datetime
12
11
  import re
13
12
 
@@ -136,9 +135,9 @@ def __stock_zh_main_spot_em() -> pd.DataFrame:
136
135
  url = "https://33.push2.eastmoney.com/api/qt/clist/get"
137
136
  params = {
138
137
  "pn": "1",
139
- "pz": "200",
138
+ "pz": "50000",
140
139
  "po": "1",
141
- "np": "1",
140
+ "np": "2",
142
141
  "ut": "bd1d9ddb04089700cf9c27f6f7426281",
143
142
  "fltt": "2",
144
143
  "invt": "2",
@@ -152,22 +151,9 @@ def __stock_zh_main_spot_em() -> pd.DataFrame:
152
151
  }
153
152
  r = requests.get(url, params=params)
154
153
  data_json = r.json()
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)
154
+ temp_df = pd.DataFrame(data_json["data"]["diff"]).T
169
155
  temp_df.reset_index(inplace=True)
170
- temp_df["index"] = temp_df["index"] + 1
156
+ temp_df["index"] = temp_df["index"].astype(int) + 1
171
157
  temp_df.rename(
172
158
  columns={
173
159
  "index": "序号",
@@ -240,14 +226,14 @@ def stock_zh_index_spot_em(symbol: str = "沪深重要指数") -> pd.DataFrame:
240
226
  }
241
227
  params = {
242
228
  "pn": "1",
243
- "pz": "200",
229
+ "pz": "20000",
244
230
  "po": "1",
245
- "np": "1",
231
+ "np": "2",
246
232
  "ut": "bd1d9ddb04089700cf9c27f6f7426281",
247
233
  "fltt": "2",
248
234
  "invt": "2",
249
235
  "wbp2u": "|0|0|0|web",
250
- "fid": "f12",
236
+ "fid": "f3",
251
237
  "fs": symbol_map[symbol],
252
238
  "fields": "f1,f2,f3,f4,f5,f6,f7,f8,f9,f10,f12,f13,f14,f15,f16,f17,f18,f20,f21,f23,f24,f25,"
253
239
  "f26,f22,f33,f11,f62,f128,f136,f115,f152",
@@ -255,22 +241,9 @@ def stock_zh_index_spot_em(symbol: str = "沪深重要指数") -> pd.DataFrame:
255
241
  }
256
242
  r = requests.get(url, params=params)
257
243
  data_json = r.json()
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)
244
+ temp_df = pd.DataFrame(data_json["data"]["diff"]).T
272
245
  temp_df.reset_index(inplace=True)
273
- temp_df["index"] = temp_df["index"] + 1
246
+ temp_df["index"] = temp_df["index"].astype(int) + 1
274
247
  temp_df.rename(
275
248
  columns={
276
249
  "index": "序号",
@@ -2007,7 +2007,7 @@ if __name__ == "__main__":
2007
2007
  print(stock_us_hist_min_em_df)
2008
2008
 
2009
2009
  stock_zh_a_hist_min_em_df = stock_zh_a_hist_min_em(
2010
- symbol="002881",
2010
+ symbol="300364",
2011
2011
  start_date="2025-02-14 09:30:00",
2012
2012
  end_date="2025-02-14 15:00:00",
2013
2013
  period="5",
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.2
2
2
  Name: akshare
3
- Version: 1.16.2
3
+ Version: 1.16.3
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=5CyzzlkBhnUIdIFQDFJkaQDZ0IwrpdkpRRTu89bKies,187624
1
+ akshare/__init__.py,sha256=qyTL0Zxm-uf-LeLZh-oRLAOwDFbx-lGUMF90dm7akis,187673
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
@@ -167,7 +167,7 @@ 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=NpzOI3VudIMsIwEm549Mr3tQ4Dwa9IC0d6gb4h_FuEY,18725
170
+ akshare/index/index_stock_zh.py,sha256=T79qIxZbRub4yprZ5ukEllWqfj-WV2Zkx4i7KyEwGjE,17860
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
@@ -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=vluzByaRnfUIczZqOxpythZLjnosn8VsNpSgqZ7hdHo,69295
314
+ akshare/stock_feature/stock_hist_em.py,sha256=izbhwdVCUp672hvHBSNpP4eXdFd1NDlJkUW-Z42KBDo,69295
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.16.2.dist-info/LICENSE,sha256=mmSZCPgfHiVw34LXuFArd-SUgQtBJ_QsIlh-kWlDHfs,1073
384
- akshare-1.16.2.dist-info/METADATA,sha256=G9VObBvjxnQVWaRZ96JM-fd_qSNLBm66Ta9o_uzxX7Y,13678
385
- akshare-1.16.2.dist-info/WHEEL,sha256=In9FTNxeP60KnTkGw7wk6mJPYd_dQSjEZmXdBdMCI-8,91
386
- akshare-1.16.2.dist-info/top_level.txt,sha256=jsf9ZzZPmHaISTVumQPsAw7vv7Yv-PdEVW70SMEelQQ,14
387
- akshare-1.16.2.dist-info/RECORD,,
383
+ akshare-1.16.3.dist-info/LICENSE,sha256=mmSZCPgfHiVw34LXuFArd-SUgQtBJ_QsIlh-kWlDHfs,1073
384
+ akshare-1.16.3.dist-info/METADATA,sha256=9BqugMLhRte0Ok28Bgz7XGGoBwRq92cMycIbb_-N1dU,13678
385
+ akshare-1.16.3.dist-info/WHEEL,sha256=In9FTNxeP60KnTkGw7wk6mJPYd_dQSjEZmXdBdMCI-8,91
386
+ akshare-1.16.3.dist-info/top_level.txt,sha256=jsf9ZzZPmHaISTVumQPsAw7vv7Yv-PdEVW70SMEelQQ,14
387
+ akshare-1.16.3.dist-info/RECORD,,