akshare 1.16.34__py3-none-any.whl → 1.16.35__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
@@ -3043,9 +3043,10 @@ amac_manager_cancelled_info # 中国证券投资基金业协会-信息公示-诚
3043
3043
  1.16.32 fix: fix news_economic_baidu interface
3044
3044
  1.16.33 fix: fix fund_open_fund_daily_em interface
3045
3045
  1.16.34 fix: fix stock_individual_fund_flow_rank interface
3046
+ 1.16.35 fix: fix futures_global_spot_em interface
3046
3047
  """
3047
3048
 
3048
- __version__ = "1.16.34"
3049
+ __version__ = "1.16.35"
3049
3050
  __author__ = "AKFamily"
3050
3051
 
3051
3052
  import sys
@@ -1,7 +1,7 @@
1
1
  #!/usr/bin/env python
2
2
  # -*- coding:utf-8 -*-
3
3
  """
4
- Date: 2025/3/5 19:00
4
+ Date: 2025/3/9 22:00
5
5
  Desc: 东方财富网-行情中心-期货市场-国际期货
6
6
  https://quote.eastmoney.com/center/gridlist.html#futures_global
7
7
  """
@@ -93,7 +93,7 @@ def futures_global_spot_em() -> pd.DataFrame:
93
93
  """
94
94
  url = "https://futsseapi.eastmoney.com/list/COMEX,NYMEX,COBOT,SGX,NYBOT,LME,MDEX,TOCOM,IPE"
95
95
  params = {
96
- "orderBy": "zdf",
96
+ "orderBy": "dm",
97
97
  "sort": "desc",
98
98
  "pageSize": "20",
99
99
  "pageIndex": "0",
@@ -1,14 +1,18 @@
1
1
  #!/usr/bin/env python
2
2
  # -*- coding:utf-8 -*-
3
3
  """
4
- Date: 2025/3/4 23:00
4
+ Date: 2025/3/9 23:00
5
5
  Desc: 东方财富网-行情中心-沪深港通
6
6
  https://quote.eastmoney.com/center/gridlist.html#ah_comparison
7
7
  """
8
8
 
9
+ import math
10
+
9
11
  import pandas as pd
10
12
  import requests
11
13
 
14
+ from akshare.utils.tqdm import get_tqdm
15
+
12
16
 
13
17
  def stock_zh_ah_spot_em() -> pd.DataFrame:
14
18
  """
@@ -19,14 +23,14 @@ def stock_zh_ah_spot_em() -> pd.DataFrame:
19
23
  """
20
24
  url = "https://push2.eastmoney.com/api/qt/clist/get"
21
25
  params = {
22
- "np": "2",
26
+ "np": "1",
23
27
  "fltt": "1",
24
28
  "invt": "2",
25
29
  "fs": "b:DLMK0101",
26
30
  "fields": "f193,f191,f192,f12,f13,f14,f1,f2,f4,f3,f152,f186,f190,f187,f189,f188",
27
31
  "fid": "f3",
28
32
  "pn": "1",
29
- "pz": "50000",
33
+ "pz": "200",
30
34
  "po": "1",
31
35
  "dect": "1",
32
36
  "ut": "fa5fd1943c7b386f172d6893dbfba10b",
@@ -35,7 +39,7 @@ def stock_zh_ah_spot_em() -> pd.DataFrame:
35
39
  }
36
40
  r = requests.get(url, params=params)
37
41
  data_json = r.json()
38
- temp_df = pd.DataFrame(data_json["data"]["diff"]).T
42
+ temp_df = pd.DataFrame(data_json["data"]["diff"])
39
43
  temp_df.reset_index(inplace=True)
40
44
  temp_df["index"] = temp_df["index"].astype(int) + 1
41
45
  temp_df.rename(
@@ -85,14 +89,14 @@ def stock_hsgt_sh_hk_spot_em() -> pd.DataFrame:
85
89
  """
86
90
  url = "https://push2.eastmoney.com/api/qt/clist/get"
87
91
  params = {
88
- "np": "2",
92
+ "np": "1",
89
93
  "fltt": "1",
90
94
  "invt": "2",
91
95
  "fs": "b:DLMK0144",
92
96
  "fields": "f12,f13,f14,f19,f1,f2,f4,f3,f152,f17,f18,f15,f16,f5,f6",
93
- "fid": "f3",
97
+ "fid": "f12",
94
98
  "pn": "1",
95
- "pz": "50000",
99
+ "pz": "200",
96
100
  "po": "1",
97
101
  "dect": "1",
98
102
  "ut": "fa5fd1943c7b386f172d6893dbfba10b",
@@ -101,12 +105,22 @@ def stock_hsgt_sh_hk_spot_em() -> pd.DataFrame:
101
105
  }
102
106
  r = requests.get(url, params=params)
103
107
  data_json = r.json()
104
- temp_df = pd.DataFrame(data_json["data"]["diff"]).T
105
- temp_df.reset_index(inplace=True)
106
- temp_df["index"] = temp_df["index"].astype(int) + 1
108
+ total_page = math.ceil(data_json["data"]["total"] / 200)
109
+ temp_list = []
110
+ tqdm = get_tqdm()
111
+ for page in tqdm(range(1, total_page + 1), leave=False):
112
+ params.update(
113
+ {
114
+ "pn": page,
115
+ }
116
+ )
117
+ r = requests.get(url, params=params, timeout=15)
118
+ data_json = r.json()
119
+ inner_temp_df = pd.DataFrame(data_json["data"]["diff"])
120
+ temp_list.append(inner_temp_df)
121
+ temp_df = pd.concat(temp_list, ignore_index=True)
107
122
  temp_df.rename(
108
123
  columns={
109
- "index": "序号",
110
124
  "f12": "代码",
111
125
  "f14": "名称",
112
126
  "f2": "最新价",
@@ -124,7 +138,6 @@ def stock_hsgt_sh_hk_spot_em() -> pd.DataFrame:
124
138
 
125
139
  temp_df = temp_df[
126
140
  [
127
- "序号",
128
141
  "代码",
129
142
  "名称",
130
143
  "最新价",
@@ -147,6 +160,10 @@ def stock_hsgt_sh_hk_spot_em() -> pd.DataFrame:
147
160
  temp_df["昨收"] = pd.to_numeric(temp_df["昨收"], errors="coerce") / 1000
148
161
  temp_df["成交量"] = pd.to_numeric(temp_df["成交量"], errors="coerce") / 100000000
149
162
  temp_df["成交额"] = pd.to_numeric(temp_df["成交额"], errors="coerce") / 100000000
163
+ temp_df.sort_values(["代码"], ignore_index=True, inplace=True)
164
+ temp_df.reset_index(inplace=True)
165
+ temp_df["index"] = temp_df["index"].astype(int) + 1
166
+ temp_df.rename(columns={"index": "序号"}, inplace=True)
150
167
  return temp_df
151
168
 
152
169
 
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.2
2
2
  Name: akshare
3
- Version: 1.16.34
3
+ Version: 1.16.35
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=DutWejDt-Bjv3GwoxVtS2P2QUVlB9bRucy-j0-EH6YQ,190292
1
+ akshare/__init__.py,sha256=vAG55v1T8N_eCiPJG-o7jIrXQtUZpcwbcqVeE4tEZ9M,190342
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
@@ -115,7 +115,7 @@ akshare/futures/futures_comm_qihuo.py,sha256=uQfabZ63qME8sTaxUbIUVQBVi8yTaPPDhD7
115
115
  akshare/futures/futures_contract_detail.py,sha256=auwzNdaoFi5hoJY6rNkO54v5FD2gmEkQu7B90yEDtkc,1175
116
116
  akshare/futures/futures_daily_bar.py,sha256=pultXs8digLfWT0dzyWs0AtFk3Fi2uZDT-zxbg_PcOM,25299
117
117
  akshare/futures/futures_foreign.py,sha256=2cbMA-eug_jriDFwKZWmA_TbPW2GQAjscpZHBrs287E,2131
118
- akshare/futures/futures_hf_em.py,sha256=vEgJav-g_PNO_Jh4Xup27PIt-ARGqVk9TjNXK_3eC-E,7966
118
+ akshare/futures/futures_hf_em.py,sha256=eCksGjWRRWXUT61ulzc2UifjTQzC8BNOKqKq7JB20oU,7965
119
119
  akshare/futures/futures_hist_em.py,sha256=Q8I20qRjp2ujiJMCCNBvTHXmrIth22p2k6KpvbkC3dk,6472
120
120
  akshare/futures/futures_hq_sina.py,sha256=HZBAve1yxp1fnwgEy_2CqVoniTXRkt8KI3REt0N0TiY,9575
121
121
  akshare/futures/futures_index_ccidx.py,sha256=_kgWioCOpFNn8WUcL5qKHGb3rUHzrbrx2AszprKpBh4,4460
@@ -256,7 +256,7 @@ akshare/stock/stock_hold_num_cninfo.py,sha256=JY9LcZMhhTiCHfQJv4pwMrLrpUxTKGLE4o
256
256
  akshare/stock/stock_hot_rank_em.py,sha256=WMbadW1CFU3ppZHMSPjG2HtXgs7PgYGugNqmyrRQQe4,7349
257
257
  akshare/stock/stock_hot_search_baidu.py,sha256=Zex1iZB2qaqsxYPj6EmuzAXLbAa53W8LcePivGwrwAs,1769
258
258
  akshare/stock/stock_hot_up_em.py,sha256=sRwbpAHLzAylobUAIlVKuQo8vbuTA0Jt6gb1oiSgNwA,2509
259
- akshare/stock/stock_hsgt_em.py,sha256=54eKgUM_F-bp6-bEsS2g5fQ928_6Fign76X8KCbWrMY,5250
259
+ akshare/stock/stock_hsgt_em.py,sha256=ZyKRk-ORYyZZkXMzg7-iUsXZTwzhGBsVCl2wzpPc4uw,5817
260
260
  akshare/stock/stock_industry.py,sha256=7axm0G1EZc-G6uX9mNX4d3bHHYS_hq2tKFytxEj9YJM,5767
261
261
  akshare/stock/stock_industry_cninfo.py,sha256=dJ19zPeKRTbUrAoa8fpBB25caZuIjX92RePG8Pz-9h8,6560
262
262
  akshare/stock/stock_industry_pe_cninfo.py,sha256=0OjjsFGG90zJRZEBqaCsjKSpSAgrp3PpXzMtom_ll_s,4287
@@ -388,8 +388,8 @@ akshare/utils/token_process.py,sha256=K4rGXjh_tgugbRcyOK2h2x0jP3PT65IIK7nxhUKhOe
388
388
  akshare/utils/tqdm.py,sha256=MuPNwcswkOGjwWQOMWXi9ZvQ_RmW4obCWRj2i7HM7FE,847
389
389
  tests/__init__.py,sha256=gNzhlO0UPjFq6Ieb38kaVIODXv4cTDByrdohAZnDYt4,82
390
390
  tests/test_func.py,sha256=j1MGYbZI2if2j_LY1S4FLsf4qfq4NwVqD5wmRlv5Log,832
391
- akshare-1.16.34.dist-info/LICENSE,sha256=mmSZCPgfHiVw34LXuFArd-SUgQtBJ_QsIlh-kWlDHfs,1073
392
- akshare-1.16.34.dist-info/METADATA,sha256=pddVy6ctAKgEYJFTjzhTNGbHbtTHCRhI-d91Lqg679g,13653
393
- akshare-1.16.34.dist-info/WHEEL,sha256=EaM1zKIUYa7rQnxGiOCGhzJABRwy4WO57rWMR3_tj4I,91
394
- akshare-1.16.34.dist-info/top_level.txt,sha256=jsf9ZzZPmHaISTVumQPsAw7vv7Yv-PdEVW70SMEelQQ,14
395
- akshare-1.16.34.dist-info/RECORD,,
391
+ akshare-1.16.35.dist-info/LICENSE,sha256=mmSZCPgfHiVw34LXuFArd-SUgQtBJ_QsIlh-kWlDHfs,1073
392
+ akshare-1.16.35.dist-info/METADATA,sha256=9e0Iq61KfT8dieIOQTPKWjvnebu4fnngqBOcEK__FDQ,13653
393
+ akshare-1.16.35.dist-info/WHEEL,sha256=52BFRY2Up02UkjOa29eZOS2VxUrpPORXg1pkohGGUS8,91
394
+ akshare-1.16.35.dist-info/top_level.txt,sha256=jsf9ZzZPmHaISTVumQPsAw7vv7Yv-PdEVW70SMEelQQ,14
395
+ akshare-1.16.35.dist-info/RECORD,,
@@ -1,5 +1,5 @@
1
1
  Wheel-Version: 1.0
2
- Generator: setuptools (75.9.1)
2
+ Generator: setuptools (76.0.0)
3
3
  Root-Is-Purelib: true
4
4
  Tag: py3-none-any
5
5