akshare 1.16.44__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
@@ -3053,9 +3053,11 @@ amac_manager_cancelled_info # 中国证券投资基金业协会-信息公示-诚
3053
3053
  1.16.42 fix: fix stock_concept_fund_flow_hist interface
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
+ 1.16.45 fix: fix option_risk_analysis_em interface
3057
+ 1.16.46 fix: fix stock_hk_index_spot_em interface
3056
3058
  """
3057
3059
 
3058
- __version__ = "1.16.44"
3060
+ __version__ = "1.16.46"
3059
3061
  __author__ = "AKFamily"
3060
3062
 
3061
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,14 +1,15 @@
1
1
  # -*- coding:utf-8 -*-
2
2
  # !/usr/bin/env python
3
3
  """
4
- Date: 2025/2/22 21:00
4
+ Date: 2025/3/13 21:50
5
5
  Desc: 东方财富网-数据中心-特色数据-期权风险分析
6
6
  https://data.eastmoney.com/other/riskanal.html
7
7
  """
8
8
 
9
- import requests
10
9
  import pandas as pd
11
10
 
11
+ from akshare.utils.func import fetch_paginated_data
12
+
12
13
 
13
14
  def option_risk_analysis_em() -> pd.DataFrame:
14
15
  """
@@ -19,21 +20,20 @@ def option_risk_analysis_em() -> pd.DataFrame:
19
20
  """
20
21
  url = "https://push2.eastmoney.com/api/qt/clist/get"
21
22
  params = {
22
- "fid": "f3",
23
+ "fid": "f12",
23
24
  "po": "1",
24
- "pz": "50000",
25
+ "pz": "100",
25
26
  "pn": "1",
26
- "np": "2",
27
+ "np": "1",
27
28
  "fltt": "2",
28
29
  "invt": "2",
29
30
  "ut": "b2884a393a59ad64002292a3e90d46a5",
30
31
  "fields": "f1,f2,f3,f12,f13,f14,f302,f303,f325,f326,f327,f329,f328,f301,f152,f154",
31
32
  "fs": "m:10",
32
33
  }
33
- r = requests.get(url, params=params)
34
- data_json = r.json()
35
- temp_df = pd.DataFrame(data_json["data"]["diff"]).T
34
+ temp_df = fetch_paginated_data(url, params)
36
35
  temp_df.columns = [
36
+ "-",
37
37
  "-",
38
38
  "最新价",
39
39
  "涨跌幅",
@@ -76,7 +76,9 @@ def option_risk_analysis_em() -> pd.DataFrame:
76
76
  temp_df["Vega"] = pd.to_numeric(temp_df["Vega"], errors="coerce")
77
77
  temp_df["Rho"] = pd.to_numeric(temp_df["Rho"], errors="coerce")
78
78
  temp_df["Theta"] = pd.to_numeric(temp_df["Theta"], errors="coerce")
79
- temp_df["到期日"] = pd.to_datetime(temp_df["到期日"], format="%Y%m%d").dt.date
79
+ temp_df["到期日"] = pd.to_datetime(
80
+ temp_df["到期日"], format="%Y%m%d", errors="coerce"
81
+ ).dt.date
80
82
  return temp_df
81
83
 
82
84
 
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.2
2
2
  Name: akshare
3
- Version: 1.16.44
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=qpLKmVrt3Z19a32XYvGS3DC41Yu6OU_HDDLwex4FtoI,190949
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
@@ -204,7 +204,7 @@ akshare/option/option_finance.py,sha256=7rnEeHo-7Sddrs36Q4c99CXL_9m8IJzw9S1Aqh3B
204
204
  akshare/option/option_finance_sina.py,sha256=Pzsrl_NKN99nWPSAirq7ushGwSfd738ISVYeCHxMZXE,37843
205
205
  akshare/option/option_lhb_em.py,sha256=VHrV2BWAPE7tj8q7J5Crjm-sey8QarYd1lgxKbkX2CQ,9090
206
206
  akshare/option/option_premium_analysis_em.py,sha256=E0_RVSnEcUBlicHv1GdWG5gJYzCgqx6uTXY81y4LY5c,2543
207
- akshare/option/option_risk_analysis_em.py,sha256=3IlE-OxJprB8MOmSXd2Ym4y8xM01zHCML9lUQxJFa0g,2581
207
+ akshare/option/option_risk_analysis_em.py,sha256=OcmZ42Ewg9XCJkNDt8uLjtF9akmKsEdoF9Zu97Hz4eE,2587
208
208
  akshare/option/option_risk_indicator_sse.py,sha256=W1_mGrk8M9pbbadzSAy5euWMEGn4-cVWBc8Jk_I2WmI,2484
209
209
  akshare/option/option_value_analysis_em.py,sha256=KIzLJxax1P8SuIUFD0CnnEpTntSnaObwYotGn28DgoY,2658
210
210
  akshare/other/__init__.py,sha256=guH4GLhFcE_5iaMHOHtgK7QKa0i7esYdmZFfJMG6E10,82
@@ -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.44.dist-info/LICENSE,sha256=mmSZCPgfHiVw34LXuFArd-SUgQtBJ_QsIlh-kWlDHfs,1073
393
- akshare-1.16.44.dist-info/METADATA,sha256=A5wp6ryzFC-PvikOBgJf_jh1l__eTL0tiwguGQ1ChmU,13653
394
- akshare-1.16.44.dist-info/WHEEL,sha256=52BFRY2Up02UkjOa29eZOS2VxUrpPORXg1pkohGGUS8,91
395
- akshare-1.16.44.dist-info/top_level.txt,sha256=jsf9ZzZPmHaISTVumQPsAw7vv7Yv-PdEVW70SMEelQQ,14
396
- akshare-1.16.44.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,,