akshare 1.15.99__py3-none-any.whl → 1.16.2__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
@@ -3009,9 +3009,11 @@ amac_manager_cancelled_info # 中国证券投资基金业协会-信息公示-诚
3009
3009
  1.15.97 fix: fix stock_intraday_em interface
3010
3010
  1.15.98 fix: fix stock_board_concept_name_em interface
3011
3011
  1.15.99 fix: fix stock_esg_zd_sina interface
3012
+ 1.16.1 fix: fix stock_main_fund_flow interface
3013
+ 1.16.2 fix: fix stock_board_industry_hist_em interface
3012
3014
  """
3013
3015
 
3014
- __version__ = "1.15.99"
3016
+ __version__ = "1.16.2"
3015
3017
  __author__ = "AKFamily"
3016
3018
 
3017
3019
  import sys
@@ -22,9 +22,9 @@ def stock_board_industry_name_em() -> pd.DataFrame:
22
22
  url = "https://17.push2.eastmoney.com/api/qt/clist/get"
23
23
  params = {
24
24
  "pn": "1",
25
- "pz": "2000",
25
+ "pz": "50000",
26
26
  "po": "1",
27
- "np": "1",
27
+ "np": "2",
28
28
  "ut": "bd1d9ddb04089700cf9c27f6f7426281",
29
29
  "fltt": "2",
30
30
  "invt": "2",
@@ -37,7 +37,7 @@ def stock_board_industry_name_em() -> pd.DataFrame:
37
37
  }
38
38
  r = requests.get(url, params=params)
39
39
  data_json = r.json()
40
- temp_df = pd.DataFrame(data_json["data"]["diff"])
40
+ temp_df = pd.DataFrame(data_json["data"]["diff"]).T
41
41
  temp_df.reset_index(inplace=True)
42
42
  temp_df["index"] = temp_df.index + 1
43
43
  temp_df.columns = [
@@ -385,9 +385,9 @@ def stock_board_industry_cons_em(symbol: str = "小金属") -> pd.DataFrame:
385
385
  url = "http://29.push2.eastmoney.com/api/qt/clist/get"
386
386
  params = {
387
387
  "pn": "1",
388
- "pz": "2000",
388
+ "pz": "50000",
389
389
  "po": "1",
390
- "np": "1",
390
+ "np": "2",
391
391
  "ut": "bd1d9ddb04089700cf9c27f6f7426281",
392
392
  "fltt": "2",
393
393
  "invt": "2",
@@ -399,7 +399,7 @@ def stock_board_industry_cons_em(symbol: str = "小金属") -> pd.DataFrame:
399
399
  }
400
400
  r = requests.get(url, params=params)
401
401
  data_json = r.json()
402
- temp_df = pd.DataFrame(data_json["data"]["diff"])
402
+ temp_df = pd.DataFrame(data_json["data"]["diff"]).T
403
403
  temp_df.reset_index(inplace=True)
404
404
  temp_df["index"] = range(1, len(temp_df) + 1)
405
405
  temp_df.columns = [
@@ -6,7 +6,6 @@ Desc: 东方财富网-数据中心-资金流向
6
6
  https://data.eastmoney.com/zjlx/detail.html
7
7
  """
8
8
 
9
- import math
10
9
  import json
11
10
  import time
12
11
  from functools import lru_cache
@@ -14,8 +13,6 @@ from functools import lru_cache
14
13
  import pandas as pd
15
14
  import requests
16
15
 
17
- from akshare.utils.tqdm import get_tqdm
18
-
19
16
 
20
17
  def stock_individual_fund_flow(
21
18
  stock: str = "600094", market: str = "sh"
@@ -150,9 +147,9 @@ def stock_individual_fund_flow_rank(indicator: str = "5日") -> pd.DataFrame:
150
147
  params = {
151
148
  "fid": indicator_map[indicator][0],
152
149
  "po": "1",
153
- "pz": "200",
150
+ "pz": "50000",
154
151
  "pn": "1",
155
- "np": "1",
152
+ "np": "2",
156
153
  "fltt": "2",
157
154
  "invt": "2",
158
155
  "ut": "b2884a393a59ad64002292a3e90d46a5",
@@ -161,20 +158,7 @@ def stock_individual_fund_flow_rank(indicator: str = "5日") -> pd.DataFrame:
161
158
  }
162
159
  r = requests.get(url, params=params)
163
160
  data_json = r.json()
164
- total_page = math.ceil(data_json["data"]["total"] / 200)
165
- temp_list = []
166
- tqdm = get_tqdm()
167
- for page in tqdm(range(1, total_page + 1), leave=False):
168
- params.update(
169
- {
170
- "pn": page,
171
- }
172
- )
173
- r = requests.get(url, params=params, timeout=15)
174
- data_json = r.json()
175
- inner_temp_df = pd.DataFrame(data_json["data"]["diff"])
176
- temp_list.append(inner_temp_df)
177
- temp_df = pd.concat(temp_list, ignore_index=True)
161
+ temp_df = pd.DataFrame(data_json["data"]["diff"]).T
178
162
  temp_df.reset_index(inplace=True)
179
163
  temp_df["index"] = range(1, len(temp_df) + 1)
180
164
  if indicator == "今日":
@@ -954,6 +938,8 @@ def stock_sector_fund_flow_summary(
954
938
  temp_df["10日小单净流入-净占比"], errors="coerce"
955
939
  )
956
940
  return temp_df
941
+ else:
942
+ return pd.DataFrame()
957
943
 
958
944
 
959
945
  def stock_sector_fund_flow_hist(symbol: str = "电源设备") -> pd.DataFrame:
@@ -1186,9 +1172,9 @@ def stock_main_fund_flow(symbol: str = "全部股票") -> pd.DataFrame:
1186
1172
  params = {
1187
1173
  "fid": "f184",
1188
1174
  "po": "1",
1189
- "pz": "200",
1175
+ "pz": "50000",
1190
1176
  "pn": "1",
1191
- "np": "1",
1177
+ "np": "2",
1192
1178
  "fltt": "2",
1193
1179
  "invt": "2",
1194
1180
  "fields": "f2,f3,f12,f13,f14,f62,f184,f225,f165,f263,f109,f175,f264,f160,f100,f124,f265,f1",
@@ -1197,20 +1183,7 @@ def stock_main_fund_flow(symbol: str = "全部股票") -> pd.DataFrame:
1197
1183
  }
1198
1184
  r = requests.get(url, params=params, timeout=15)
1199
1185
  data_json = r.json()
1200
- total_page = math.ceil(data_json["data"]["total"] / 200)
1201
- temp_list = []
1202
- tqdm = get_tqdm()
1203
- for page in tqdm(range(1, total_page + 1), leave=False):
1204
- params.update(
1205
- {
1206
- "pn": page,
1207
- }
1208
- )
1209
- r = requests.get(url, params=params, timeout=15)
1210
- data_json = r.json()
1211
- inner_temp_df = pd.DataFrame(data_json["data"]["diff"])
1212
- temp_list.append(inner_temp_df)
1213
- temp_df = pd.concat(temp_list, ignore_index=True)
1186
+ temp_df = pd.DataFrame(data_json["data"]["diff"]).T
1214
1187
  temp_df["序号"] = range(1, len(temp_df) + 1)
1215
1188
  temp_df.rename(
1216
1189
  columns={
akshare/stock/stock_xq.py CHANGED
@@ -44,7 +44,7 @@ def stock_individual_spot_xq(
44
44
  :rtype: pandas.DataFrame
45
45
  """
46
46
  session = requests.Session()
47
- xq_a_token = token or "b1d767edc014ddf478005982ba9e053910dad8dc"
47
+ xq_a_token = token or "55d5135321462c545489a47de10df4ea66183cbf"
48
48
  headers = {
49
49
  "cookie": f"xq_a_token={xq_a_token};",
50
50
  "User-Agent": "Mozilla/5.0 (iPhone; CPU iPhone OS 16_6 like Mac OS X) AppleWebKit/605.1.15 "
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.2
2
2
  Name: akshare
3
- Version: 1.15.99
3
+ Version: 1.16.2
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=A7PXQwrV1Zg07nFz4vVEUuJvqmhjqpAhFcxHJwyH3Y4,187523
1
+ akshare/__init__.py,sha256=5CyzzlkBhnUIdIFQDFJkaQDZ0IwrpdkpRRTu89bKies,187624
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
@@ -232,13 +232,13 @@ akshare/stock/cons.py,sha256=0oyUW5Pu-iQ3qgh-TFemM_O5f1fAwVe-PsI4Qa8EYpQ,42956
232
232
  akshare/stock/stock_allotment_cninfo.py,sha256=OVjVdWp2XVRNbJvVgtgVVoBmPBJgBB4RyIIgA_9QHM8,6066
233
233
  akshare/stock/stock_ask_bid_em.py,sha256=nXQhYIpU4k7GUc7nthWC29zVS9GhYb9ppQTLD0gycF4,3438
234
234
  akshare/stock/stock_board_concept_em.py,sha256=8_XxPk1GrkEpfBdvXNYiFZWd4i328eAasCKJMyZ3KlQ,15024
235
- akshare/stock/stock_board_industry_em.py,sha256=AfRVUVZrgSJXaoKAK81Ga-_m3hfv8YZzczBnnBdFq-I,16195
235
+ akshare/stock/stock_board_industry_em.py,sha256=ViXBcqSfUnBSvCDo-D7ZRupd9PpI1uEQ19KMAuGxGuQ,16201
236
236
  akshare/stock/stock_cg_equity_mortgage.py,sha256=Pui5aWKKPwGuKjF_GNpejDzsMGNPrxiaJviLz3x2e9I,3426
237
237
  akshare/stock/stock_cg_guarantee.py,sha256=ts7qcQhhyN1PHB7Q4XlMn38HhfVvubOvky9RZfmUP94,3844
238
238
  akshare/stock/stock_cg_lawsuit.py,sha256=6Y92pPw0JgyrInteqHuU07G1jwmdX2wjaDtrJN8y6Hg,4129
239
239
  akshare/stock/stock_dividend_cninfo.py,sha256=_vipLQu94qBDoPkaIWZKRFA0mFfgroUMnn5EdLcjAc4,3195
240
240
  akshare/stock/stock_dzjy_em.py,sha256=QMo2w-_I9UnmCr1IXk_InFeW5ok_GpRE9HdWFDUdGyM,22556
241
- akshare/stock/stock_fund_em.py,sha256=iUOr6uxk1urNqj14gPo8aXQHndDQxL5xexACX7WXQL4,49807
241
+ akshare/stock/stock_fund_em.py,sha256=jFTqmiJMBTlR1vN6xj-tqMYxAQn0ZwAWLA2L7pbkg20,48918
242
242
  akshare/stock/stock_fund_hold.py,sha256=iFEmRFber7MF6aPi0QOJxpvYjO7I26KouUvC-xTQdCk,6056
243
243
  akshare/stock/stock_gsrl_em.py,sha256=oy5vO681ZPTEehZgz10T8jgIQ8dNm_E7MXGr1PGoHqI,1951
244
244
  akshare/stock/stock_hk_famous.py,sha256=g-p1cdRibei9fw2HEMPyarLP-wT4bFwIK7Mxi77jH9E,3015
@@ -274,7 +274,7 @@ akshare/stock/stock_us_js.py,sha256=wwZpRvVHqjxwd0cb2O5vtRW8Zw90Kdl5O4XNwoevN64,
274
274
  akshare/stock/stock_us_pink.py,sha256=jgkEjPm_qa4zSN1MH0unHJopSkcF-8Rqlp5Kus2KaQ8,3062
275
275
  akshare/stock/stock_us_sina.py,sha256=D4fhJgpmvnlVoeSV2wQQ7H6lig8h6vaJp71o88dZhDg,8200
276
276
  akshare/stock/stock_weibo_nlp.py,sha256=eM7ofsNSrKiYeS0g38Qj9CxT6dkJZrn_pmziIiTqp4U,3286
277
- akshare/stock/stock_xq.py,sha256=N0RE-9dFhti9Vayk_MIZYFi-SKgFz4O1JtMpd-qBGwM,4641
277
+ akshare/stock/stock_xq.py,sha256=E7dCNJw8GsJry3lU1LzCjADqRhrsZE4fERIF-G5SoVE,4641
278
278
  akshare/stock/stock_zh_a_sina.py,sha256=ZobGnFMIR67ENk05ocqIkeiItLlgK67dW8ZjLdDss3s,18862
279
279
  akshare/stock/stock_zh_a_special.py,sha256=RRXkeZtRWm_maIPWgxvhBdX6eNybECjhSuEesZHRFJI,10294
280
280
  akshare/stock/stock_zh_a_tick_tx.py,sha256=TJUAWLKAeoLEaVVJQlj0t-1smZGoAO0X0rPsUPVhZZ4,2131
@@ -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.99.dist-info/LICENSE,sha256=mmSZCPgfHiVw34LXuFArd-SUgQtBJ_QsIlh-kWlDHfs,1073
384
- akshare-1.15.99.dist-info/METADATA,sha256=lAYoXAL-syR6Mg73zy_xiTUCSkvxnFIxOxyK-lUTQNA,13679
385
- akshare-1.15.99.dist-info/WHEEL,sha256=In9FTNxeP60KnTkGw7wk6mJPYd_dQSjEZmXdBdMCI-8,91
386
- akshare-1.15.99.dist-info/top_level.txt,sha256=jsf9ZzZPmHaISTVumQPsAw7vv7Yv-PdEVW70SMEelQQ,14
387
- akshare-1.15.99.dist-info/RECORD,,
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,,