akshare 1.16.45__py3-none-any.whl → 1.16.46__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
@@ -3054,9 +3054,10 @@ amac_manager_cancelled_info # 中国证券投资基金业协会-信息公示-诚
3054
3054
  1.16.43 fix: fix option_value_analysis_em interface
3055
3055
  1.16.44 fix: fix stock_board_concept_hist_em interface
3056
3056
  1.16.45 fix: fix option_risk_analysis_em interface
3057
+ 1.16.46 fix: fix stock_hk_index_spot_em interface
3057
3058
  """
3058
3059
 
3059
- __version__ = "1.16.45"
3060
+ __version__ = "1.16.46"
3060
3061
  __author__ = "AKFamily"
3061
3062
 
3062
3063
  import sys
@@ -1,7 +1,7 @@
1
1
  #!/usr/bin/env python
2
2
  # -*- coding:utf-8 -*-
3
3
  """
4
- Date: 2025/2/18 16:00
4
+ Date: 2025/3/15 22:30
5
5
  Desc: 港股股票指数数据-新浪-东财
6
6
  所有指数-实时行情数据和历史行情数据
7
7
  https://finance.sina.com.cn/realstock/company/sz399552/nc.shtml
@@ -17,6 +17,7 @@ import py_mini_racer
17
17
  from functools import lru_cache
18
18
 
19
19
  from akshare.stock.cons import hk_js_decode
20
+ from akshare.utils.func import fetch_paginated_data
20
21
 
21
22
 
22
23
  def _replace_comma(x) -> str:
@@ -154,9 +155,9 @@ def stock_hk_index_spot_em() -> pd.DataFrame:
154
155
  url = "https://15.push2.eastmoney.com/api/qt/clist/get"
155
156
  params = {
156
157
  "pn": "1",
157
- "pz": "20000",
158
+ "pz": "100",
158
159
  "po": "1",
159
- "np": "2",
160
+ "np": "1",
160
161
  "ut": "bd1d9ddb04089700cf9c27f6f7426281",
161
162
  "fltt": "2",
162
163
  "invt": "2",
@@ -167,11 +168,7 @@ def stock_hk_index_spot_em() -> pd.DataFrame:
167
168
  "f26,f22,f33,f11,f62,f128,f136,f115,f152",
168
169
  "_": "1683800547682",
169
170
  }
170
- r = requests.get(url, params=params)
171
- data_json = r.json()
172
- temp_df = pd.DataFrame(data_json["data"]["diff"]).T
173
- temp_df.reset_index(inplace=True)
174
- temp_df["index"] = temp_df["index"].astype(int) + 1
171
+ temp_df = fetch_paginated_data(url, params)
175
172
  temp_df.rename(
176
173
  columns={
177
174
  "index": "序号",
@@ -302,5 +299,5 @@ if __name__ == "__main__":
302
299
  stock_hk_index_spot_em_df = stock_hk_index_spot_em()
303
300
  print(stock_hk_index_spot_em_df)
304
301
 
305
- stock_hk_index_daily_em_df = stock_hk_index_daily_em(symbol="HSAHP")
302
+ stock_hk_index_daily_em_df = stock_hk_index_daily_em(symbol="HSTECH")
306
303
  print(stock_hk_index_daily_em_df)
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.2
2
2
  Name: akshare
3
- Version: 1.16.45
3
+ Version: 1.16.46
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=LlUT8S4hhcp3AvSrfHbZtr4Z7WaA9ppZiRqasKLWI90,191000
1
+ akshare/__init__.py,sha256=IdhhyoCSc6vByWKKn47EhyfXyp7Fqx2I7H1kwZW0uLA,191050
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
@@ -170,7 +170,7 @@ akshare/index/index_option_qvix.py,sha256=UHqLJXObn31Oa-RAB4Lgk5LwZ2FYAr1p--JvEf
170
170
  akshare/index/index_research_fund_sw.py,sha256=kVYjBl3vZg6CyYBCrxZiSv8taHMnqmG7PQ-LVmMNd3I,4603
171
171
  akshare/index/index_research_sw.py,sha256=Mm1YtiP-PXhDysJwmFidX3RZSZZ92AyXpjl_tVrjdwA,21758
172
172
  akshare/index/index_spot.py,sha256=meTBTCp2DPVTX_N3qpCLtkI-0q3XhrJ3gndNugRBGKg,1767
173
- akshare/index/index_stock_hk.py,sha256=eCtL477XlLpbOvBRWG_ooDlFV4kFRk8na0k2r_rr_GU,9795
173
+ akshare/index/index_stock_hk.py,sha256=2DM6Uu7dEkl7iTOOtYzA5Ow9nG1CfoLwHYsMOQO_i1U,9678
174
174
  akshare/index/index_stock_us_sina.py,sha256=IxOk4G49oasv7EfEQenL9-GLuelyUus6c4JPyRlaOzY,1551
175
175
  akshare/index/index_stock_zh.py,sha256=gVMgD_sgZwZLOmqj8jyt-oKc7s9bBFCTGqfBMpjvWw0,18060
176
176
  akshare/index/index_stock_zh_csindex.py,sha256=sRVoDD-fitqAMuDs0XPm1oCz2nZ2QTkvNswL1WvXpwo,4164
@@ -389,8 +389,8 @@ akshare/utils/token_process.py,sha256=K4rGXjh_tgugbRcyOK2h2x0jP3PT65IIK7nxhUKhOe
389
389
  akshare/utils/tqdm.py,sha256=MuPNwcswkOGjwWQOMWXi9ZvQ_RmW4obCWRj2i7HM7FE,847
390
390
  tests/__init__.py,sha256=gNzhlO0UPjFq6Ieb38kaVIODXv4cTDByrdohAZnDYt4,82
391
391
  tests/test_func.py,sha256=j1MGYbZI2if2j_LY1S4FLsf4qfq4NwVqD5wmRlv5Log,832
392
- akshare-1.16.45.dist-info/LICENSE,sha256=mmSZCPgfHiVw34LXuFArd-SUgQtBJ_QsIlh-kWlDHfs,1073
393
- akshare-1.16.45.dist-info/METADATA,sha256=kpRwFQizLDZmEHrIpUdUWr0yBlNCnK7obzi6HVvMDxE,13653
394
- akshare-1.16.45.dist-info/WHEEL,sha256=52BFRY2Up02UkjOa29eZOS2VxUrpPORXg1pkohGGUS8,91
395
- akshare-1.16.45.dist-info/top_level.txt,sha256=jsf9ZzZPmHaISTVumQPsAw7vv7Yv-PdEVW70SMEelQQ,14
396
- akshare-1.16.45.dist-info/RECORD,,
392
+ akshare-1.16.46.dist-info/LICENSE,sha256=mmSZCPgfHiVw34LXuFArd-SUgQtBJ_QsIlh-kWlDHfs,1073
393
+ akshare-1.16.46.dist-info/METADATA,sha256=tIY4Km-jXwh3JiNvg_gRhFBCANVtJocGGftLNoeKreA,13653
394
+ akshare-1.16.46.dist-info/WHEEL,sha256=52BFRY2Up02UkjOa29eZOS2VxUrpPORXg1pkohGGUS8,91
395
+ akshare-1.16.46.dist-info/top_level.txt,sha256=jsf9ZzZPmHaISTVumQPsAw7vv7Yv-PdEVW70SMEelQQ,14
396
+ akshare-1.16.46.dist-info/RECORD,,