akshare 1.16.40__py3-none-any.whl → 1.16.41__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
@@ -3049,9 +3049,10 @@ amac_manager_cancelled_info # 中国证券投资基金业协会-信息公示-诚
3049
3049
  1.16.38 fix: fix fund_etf_hist_em interface
3050
3050
  1.16.39 fix: fix option_current_em interface
3051
3051
  1.16.40 add: add stock_individual_basic_info_xq interface
3052
+ 1.16.41 fix: fix stock_individual_fund_flow_rank interface
3052
3053
  """
3053
3054
 
3054
- __version__ = "1.16.40"
3055
+ __version__ = "1.16.41"
3055
3056
  __author__ = "AKFamily"
3056
3057
 
3057
3058
  import sys
@@ -1,7 +1,7 @@
1
1
  #!/usr/bin/env python
2
2
  # -*- coding:utf-8 -*-
3
3
  """
4
- Date: 2025/3/9 19:00
4
+ Date: 2025/3/10 19:00
5
5
  Desc: 东方财富网-数据中心-资金流向
6
6
  https://data.eastmoney.com/zjlx/detail.html
7
7
  """
@@ -12,6 +12,8 @@ from functools import lru_cache
12
12
 
13
13
  import pandas as pd
14
14
  import requests
15
+
16
+ from akshare.utils.func import fetch_paginated_data
15
17
  from akshare.utils.tqdm import get_tqdm
16
18
 
17
19
 
@@ -148,7 +150,7 @@ def stock_individual_fund_flow_rank(indicator: str = "5日") -> pd.DataFrame:
148
150
  params = {
149
151
  "fid": indicator_map[indicator][0],
150
152
  "po": "1",
151
- "pz": "200",
153
+ "pz": "100",
152
154
  "pn": "1",
153
155
  "np": "1",
154
156
  "fltt": "2",
@@ -159,7 +161,7 @@ def stock_individual_fund_flow_rank(indicator: str = "5日") -> pd.DataFrame:
159
161
  }
160
162
  r = requests.get(url, params=params)
161
163
  data_json = r.json()
162
- total_page = math.ceil(data_json["data"]["total"] / 200)
164
+ total_page = math.ceil(data_json["data"]["total"] / 100)
163
165
  temp_list = []
164
166
  tqdm = get_tqdm()
165
167
  for page in tqdm(range(1, total_page + 1), leave=False):
@@ -480,7 +482,7 @@ def stock_sector_fund_flow_rank(
480
482
  }
481
483
  params = {
482
484
  "pn": "1",
483
- "pz": "200",
485
+ "pz": "100",
484
486
  "po": "1",
485
487
  "np": "1",
486
488
  "ut": "b2884a393a59ad64002292a3e90d46a5",
@@ -495,7 +497,7 @@ def stock_sector_fund_flow_rank(
495
497
  }
496
498
  r = requests.get(url, params=params, headers=headers)
497
499
  data_json = r.json()
498
- total_page = math.ceil(data_json["data"]["total"] / 200)
500
+ total_page = math.ceil(data_json["data"]["total"] / 100)
499
501
  temp_list = []
500
502
  tqdm = get_tqdm()
501
503
  for page in tqdm(range(1, total_page + 1), leave=False):
@@ -654,15 +656,11 @@ def _get_stock_sector_fund_flow_summary_code() -> dict:
654
656
  :rtype: dict
655
657
  """
656
658
  url = "https://push2.eastmoney.com/api/qt/clist/get"
657
- headers = {
658
- "User-Agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 "
659
- "(KHTML, like Gecko) Chrome/81.0.4044.138 Safari/537.36",
660
- }
661
659
  params = {
662
660
  "pn": "1",
663
- "pz": "50000",
661
+ "pz": "100",
664
662
  "po": "1",
665
- "np": "2",
663
+ "np": "1",
666
664
  "ut": "b2884a393a59ad64002292a3e90d46a5",
667
665
  "fltt": "2",
668
666
  "invt": "2",
@@ -673,9 +671,7 @@ def _get_stock_sector_fund_flow_summary_code() -> dict:
673
671
  "rt": "52975239",
674
672
  "_": int(time.time() * 1000),
675
673
  }
676
- r = requests.get(url, params=params, headers=headers)
677
- data_json = r.json()
678
- temp_df = pd.DataFrame(data_json["data"]["diff"]).T
674
+ temp_df = fetch_paginated_data(url, params)
679
675
  name_code_map = dict(zip(temp_df["f14"], temp_df["f12"]))
680
676
  return name_code_map
681
677
 
@@ -1196,19 +1192,16 @@ def stock_main_fund_flow(symbol: str = "全部股票") -> pd.DataFrame:
1196
1192
  params = {
1197
1193
  "fid": "f184",
1198
1194
  "po": "1",
1199
- "pz": "50000",
1195
+ "pz": "100",
1200
1196
  "pn": "1",
1201
- "np": "2",
1197
+ "np": "1",
1202
1198
  "fltt": "2",
1203
1199
  "invt": "2",
1204
1200
  "fields": "f2,f3,f12,f13,f14,f62,f184,f225,f165,f263,f109,f175,f264,f160,f100,f124,f265,f1",
1205
1201
  "ut": "b2884a393a59ad64002292a3e90d46a5",
1206
1202
  "fs": symbol_map[symbol],
1207
1203
  }
1208
- r = requests.get(url, params=params, timeout=15)
1209
- data_json = r.json()
1210
- temp_df = pd.DataFrame(data_json["data"]["diff"]).T
1211
- temp_df["序号"] = range(1, len(temp_df) + 1)
1204
+ temp_df = fetch_paginated_data(url, params)
1212
1205
  temp_df.rename(
1213
1206
  columns={
1214
1207
  "index": "序号",
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.2
2
2
  Name: akshare
3
- Version: 1.16.40
3
+ Version: 1.16.41
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=vDMTa-t_OXE_HSBvNNSXAcMzYQXf2YQSfz0mMQfFStQ,190727
1
+ akshare/__init__.py,sha256=fDWH6nPARpqyU685imTKWBVlAb_kvyZgGSxTKy8q9D0,190786
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
@@ -243,7 +243,7 @@ akshare/stock/stock_cg_guarantee.py,sha256=ts7qcQhhyN1PHB7Q4XlMn38HhfVvubOvky9RZ
243
243
  akshare/stock/stock_cg_lawsuit.py,sha256=6Y92pPw0JgyrInteqHuU07G1jwmdX2wjaDtrJN8y6Hg,4129
244
244
  akshare/stock/stock_dividend_cninfo.py,sha256=_vipLQu94qBDoPkaIWZKRFA0mFfgroUMnn5EdLcjAc4,3195
245
245
  akshare/stock/stock_dzjy_em.py,sha256=QMo2w-_I9UnmCr1IXk_InFeW5ok_GpRE9HdWFDUdGyM,22556
246
- akshare/stock/stock_fund_em.py,sha256=Ki7BC8XvkrJoMSfUf6bgH2t0JqPhTQQ2jgG8C43IjBA,49648
246
+ akshare/stock/stock_fund_em.py,sha256=Gvo0SprdeRmgPhL9TvK6Zo2MqyiUWh6zpL5W68DbsSY,49296
247
247
  akshare/stock/stock_fund_hold.py,sha256=iFEmRFber7MF6aPi0QOJxpvYjO7I26KouUvC-xTQdCk,6056
248
248
  akshare/stock/stock_gsrl_em.py,sha256=oy5vO681ZPTEehZgz10T8jgIQ8dNm_E7MXGr1PGoHqI,1951
249
249
  akshare/stock/stock_hk_famous.py,sha256=uF1iUkrwvMMxvxE3-O7byxQ-oS0SjlMBwOEraTBA41s,3018
@@ -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.40.dist-info/LICENSE,sha256=mmSZCPgfHiVw34LXuFArd-SUgQtBJ_QsIlh-kWlDHfs,1073
393
- akshare-1.16.40.dist-info/METADATA,sha256=tlDYGLGJXAv8GeNvFU-Q7kFUx4HrwlOCwi9RslTBhr8,13653
394
- akshare-1.16.40.dist-info/WHEEL,sha256=52BFRY2Up02UkjOa29eZOS2VxUrpPORXg1pkohGGUS8,91
395
- akshare-1.16.40.dist-info/top_level.txt,sha256=jsf9ZzZPmHaISTVumQPsAw7vv7Yv-PdEVW70SMEelQQ,14
396
- akshare-1.16.40.dist-info/RECORD,,
392
+ akshare-1.16.41.dist-info/LICENSE,sha256=mmSZCPgfHiVw34LXuFArd-SUgQtBJ_QsIlh-kWlDHfs,1073
393
+ akshare-1.16.41.dist-info/METADATA,sha256=CZuKlCLDnR_avh_MAWvHw9CtfMv972A4y5V_eKx_BBc,13653
394
+ akshare-1.16.41.dist-info/WHEEL,sha256=52BFRY2Up02UkjOa29eZOS2VxUrpPORXg1pkohGGUS8,91
395
+ akshare-1.16.41.dist-info/top_level.txt,sha256=jsf9ZzZPmHaISTVumQPsAw7vv7Yv-PdEVW70SMEelQQ,14
396
+ akshare-1.16.41.dist-info/RECORD,,