akshare 1.16.39__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
@@ -3048,9 +3048,11 @@ amac_manager_cancelled_info # 中国证券投资基金业协会-信息公示-诚
3048
3048
  1.16.37 fix: fix stock_board_concept_hist_em interface
3049
3049
  1.16.38 fix: fix fund_etf_hist_em interface
3050
3050
  1.16.39 fix: fix option_current_em interface
3051
+ 1.16.40 add: add stock_individual_basic_info_xq interface
3052
+ 1.16.41 fix: fix stock_individual_fund_flow_rank interface
3051
3053
  """
3052
3054
 
3053
- __version__ = "1.16.39"
3055
+ __version__ = "1.16.41"
3054
3056
  __author__ = "AKFamily"
3055
3057
 
3056
3058
  import sys
@@ -3072,6 +3074,11 @@ if sys.version_info < (3, 9):
3072
3074
 
3073
3075
  del sys
3074
3076
 
3077
+ """
3078
+ 雪球-个股-公司概况-公司简介
3079
+ """
3080
+ from akshare.stock_fundamental.stock_basic_info_xq import stock_individual_basic_info_xq
3081
+
3075
3082
  """
3076
3083
  新浪财经-行情中心-环球市场
3077
3084
  """
@@ -1,7 +1,7 @@
1
1
  #!/usr/bin/env python
2
2
  # -*- coding:utf-8 -*-
3
3
  """
4
- Date: 2025/2/28 16:30
4
+ Date: 2025/3/10 19:30
5
5
  Desc: 东方财富-沪深板块-行业板块
6
6
  https://quote.eastmoney.com/center/boardlist.html#industry_board
7
7
  """
@@ -12,6 +12,8 @@ from functools import lru_cache
12
12
  import pandas as pd
13
13
  import requests
14
14
 
15
+ from akshare.utils.func import fetch_paginated_data
16
+
15
17
 
16
18
  @lru_cache()
17
19
  def __stock_board_industry_name_em() -> pd.DataFrame:
@@ -24,9 +26,9 @@ def __stock_board_industry_name_em() -> pd.DataFrame:
24
26
  url = "https://17.push2.eastmoney.com/api/qt/clist/get"
25
27
  params = {
26
28
  "pn": "1",
27
- "pz": "50000",
29
+ "pz": "100",
28
30
  "po": "1",
29
- "np": "2",
31
+ "np": "1",
30
32
  "ut": "bd1d9ddb04089700cf9c27f6f7426281",
31
33
  "fltt": "2",
32
34
  "invt": "2",
@@ -37,11 +39,7 @@ def __stock_board_industry_name_em() -> pd.DataFrame:
37
39
  "f140,f141,f207,f208,f209,f222",
38
40
  "_": "1626075887768",
39
41
  }
40
- r = requests.get(url, params=params)
41
- data_json = r.json()
42
- temp_df = pd.DataFrame(data_json["data"]["diff"]).T
43
- temp_df.reset_index(inplace=True)
44
- temp_df["index"] = temp_df.index + 1
42
+ temp_df = fetch_paginated_data(url, params)
45
43
  temp_df.columns = [
46
44
  "排名",
47
45
  "-",
@@ -125,9 +123,9 @@ def stock_board_industry_name_em() -> pd.DataFrame:
125
123
  url = "https://17.push2.eastmoney.com/api/qt/clist/get"
126
124
  params = {
127
125
  "pn": "1",
128
- "pz": "50000",
126
+ "pz": "100",
129
127
  "po": "1",
130
- "np": "2",
128
+ "np": "1",
131
129
  "ut": "bd1d9ddb04089700cf9c27f6f7426281",
132
130
  "fltt": "2",
133
131
  "invt": "2",
@@ -138,11 +136,7 @@ def stock_board_industry_name_em() -> pd.DataFrame:
138
136
  "f140,f141,f207,f208,f209,f222",
139
137
  "_": "1626075887768",
140
138
  }
141
- r = requests.get(url, params=params)
142
- data_json = r.json()
143
- temp_df = pd.DataFrame(data_json["data"]["diff"]).T
144
- temp_df.reset_index(inplace=True)
145
- temp_df["index"] = temp_df.index + 1
139
+ temp_df = fetch_paginated_data(url, params)
146
140
  temp_df.columns = [
147
141
  "排名",
148
142
  "-",
@@ -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": "序号",
akshare/stock/stock_xq.py CHANGED
@@ -28,18 +28,18 @@ def _convert_timestamp(timestamp_ms: int) -> str:
28
28
 
29
29
  def stock_individual_spot_xq(
30
30
  symbol: str = "SH600000",
31
- timeout: float = None,
32
31
  token: str = None,
32
+ timeout: float = None,
33
33
  ) -> pd.DataFrame:
34
34
  """
35
35
  雪球-行情中心-个股
36
36
  https://xueqiu.com/S/SH600000
37
37
  :param symbol: 证券代码,可以是 A 股代码,A 股场内基金代码,A 股指数,美股代码, 美股指数
38
38
  :type symbol: str
39
- :param timeout: choice of None or a positive float number
40
- :type timeout: float
41
39
  :param token: set xueqiu token
42
40
  :type token: str
41
+ :param timeout: choice of None or a positive float number
42
+ :type timeout: float
43
43
  :return: 证券最新行情
44
44
  :rtype: pandas.DataFrame
45
45
  """
@@ -0,0 +1,48 @@
1
+ # !/usr/bin/env python
2
+ # -*- coding:utf-8 -*-
3
+ """
4
+ Date: 2025/3/10 20:00
5
+ Desc: 雪球-个股-公司概况-公司简介
6
+ https://xueqiu.com/snowman/S/SH601127/detail#/GSJJ
7
+ """
8
+
9
+ import pandas as pd
10
+ import requests
11
+
12
+ from akshare.utils.cons import headers
13
+
14
+
15
+ def stock_individual_basic_info_xq(
16
+ symbol: str = "SH601127", token: str = None, timeout: float = None
17
+ ) -> pd.DataFrame:
18
+ """
19
+ 雪球-个股-公司概况-公司简介
20
+ https://xueqiu.com/snowman/S/SH601127/detail#/GSJJ
21
+ :param symbol: 证券代码
22
+ :type symbol: str
23
+ :param token: 雪球财经的 token
24
+ :type token: str
25
+ :param timeout: 设置超时时间
26
+ :type timeout: float
27
+ :return: 公司简介
28
+ :rtype: pandas.DataFrame
29
+ """
30
+ xq_a_token = token or "afb2d000c59b0e6fa5539ff13798ca8e64330985"
31
+ url = "https://stock.xueqiu.com/v5/stock/f10/cn/company.json"
32
+ params = {
33
+ "symbol": symbol,
34
+ }
35
+ headers.update({"cookie": f"xq_a_token={xq_a_token};"})
36
+ r = requests.get(url, params=params, headers=headers, timeout=timeout)
37
+ data_json = r.json()
38
+ temp_df = pd.DataFrame(data_json["data"])
39
+ temp_df.reset_index(inplace=True)
40
+ temp_df.columns = ["item", "value"]
41
+ return temp_df
42
+
43
+
44
+ if __name__ == "__main__":
45
+ stock_individual_basic_info_xq_df = stock_individual_basic_info_xq(
46
+ symbol="SH601127"
47
+ )
48
+ print(stock_individual_basic_info_xq_df)
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.2
2
2
  Name: akshare
3
- Version: 1.16.39
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=N4xHW6fGYJxHg15VX8SkEEUgl6R3vE1PSDblUTwmDOk,190531
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
@@ -237,13 +237,13 @@ akshare/stock/cons.py,sha256=0oyUW5Pu-iQ3qgh-TFemM_O5f1fAwVe-PsI4Qa8EYpQ,42956
237
237
  akshare/stock/stock_allotment_cninfo.py,sha256=OVjVdWp2XVRNbJvVgtgVVoBmPBJgBB4RyIIgA_9QHM8,6066
238
238
  akshare/stock/stock_ask_bid_em.py,sha256=bo7VNkp1PmK4Z-GPZuVn_I-IAdzeW8cs3W_75KodxCg,3368
239
239
  akshare/stock/stock_board_concept_em.py,sha256=9gf-hhb9-s-iOnPD7mlBSAf8_XYbyB-ly1Z8eg5CBGc,18116
240
- akshare/stock/stock_board_industry_em.py,sha256=Whqgve1JrghcKuaC2F80Vt-z-9oSxQW66GIZwMM0QG8,19170
240
+ akshare/stock/stock_board_industry_em.py,sha256=2u5iuz9u6xreX1t5CkfJVAMiciYRqFRn0_792F6SH4o,18913
241
241
  akshare/stock/stock_cg_equity_mortgage.py,sha256=Pui5aWKKPwGuKjF_GNpejDzsMGNPrxiaJviLz3x2e9I,3426
242
242
  akshare/stock/stock_cg_guarantee.py,sha256=ts7qcQhhyN1PHB7Q4XlMn38HhfVvubOvky9RZfmUP94,3844
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
@@ -280,7 +280,7 @@ akshare/stock/stock_us_js.py,sha256=wwZpRvVHqjxwd0cb2O5vtRW8Zw90Kdl5O4XNwoevN64,
280
280
  akshare/stock/stock_us_pink.py,sha256=BX7-tG4Zs0k2vSYGxHH0Yob-moD6AAu2a-ytZpxgIRQ,3065
281
281
  akshare/stock/stock_us_sina.py,sha256=D4fhJgpmvnlVoeSV2wQQ7H6lig8h6vaJp71o88dZhDg,8200
282
282
  akshare/stock/stock_weibo_nlp.py,sha256=eM7ofsNSrKiYeS0g38Qj9CxT6dkJZrn_pmziIiTqp4U,3286
283
- akshare/stock/stock_xq.py,sha256=A8bdpDlqj_jYVE1odsYTpWGC_ToDEwx5qN65KC6raCY,4641
283
+ akshare/stock/stock_xq.py,sha256=vkOblh7FYHyUysux0kt7XKUCdJfcjAL3k-5Aftgx5rI,4641
284
284
  akshare/stock/stock_zh_a_sina.py,sha256=ZobGnFMIR67ENk05ocqIkeiItLlgK67dW8ZjLdDss3s,18862
285
285
  akshare/stock/stock_zh_a_special.py,sha256=RRXkeZtRWm_maIPWgxvhBdX6eNybECjhSuEesZHRFJI,10294
286
286
  akshare/stock/stock_zh_a_tick_tx.py,sha256=TJUAWLKAeoLEaVVJQlj0t-1smZGoAO0X0rPsUPVhZZ4,2131
@@ -359,6 +359,7 @@ akshare/stock_feature/stock_zh_vote_baidu.py,sha256=SsSNnCq7PDFMzWFcPFcC_MSc9rua
359
359
  akshare/stock_feature/stock_ztb_em.py,sha256=hMi0NSlBs-qEid3oXKOAempZSItNApPDQKvcsdtF8j8,18141
360
360
  akshare/stock_feature/ths.js,sha256=AWPkHf3L2Il1UUL0F5qDqNn1dfU0OlZBNUbMf8AmI3Y,39664
361
361
  akshare/stock_fundamental/__init__.py,sha256=jiXoO9OXiMxB0wHaPQkuxNckYuoFKtzuhZL1ytnE2nQ,82
362
+ akshare/stock_fundamental/stock_basic_info_xq.py,sha256=qtLYKqv-zNIgJy2Y-F2nHVXP1VCiNgoSZkY80Mbftxs,1390
362
363
  akshare/stock_fundamental/stock_finance_hk_em.py,sha256=cCiaWX6ZyKe4W2H9qe-ttpMeVMWp6tHdvnjhRuYQhl8,7017
363
364
  akshare/stock_fundamental/stock_finance_sina.py,sha256=432EjGHWFtG0L32PNSC_HWpVLDntabNt9koyUtNG77E,30718
364
365
  akshare/stock_fundamental/stock_finance_ths.py,sha256=nS9bt_hzklzh7pBTCH1PjOa69OUcNZ41Z_zSHiz9Y1U,11527
@@ -388,8 +389,8 @@ akshare/utils/token_process.py,sha256=K4rGXjh_tgugbRcyOK2h2x0jP3PT65IIK7nxhUKhOe
388
389
  akshare/utils/tqdm.py,sha256=MuPNwcswkOGjwWQOMWXi9ZvQ_RmW4obCWRj2i7HM7FE,847
389
390
  tests/__init__.py,sha256=gNzhlO0UPjFq6Ieb38kaVIODXv4cTDByrdohAZnDYt4,82
390
391
  tests/test_func.py,sha256=j1MGYbZI2if2j_LY1S4FLsf4qfq4NwVqD5wmRlv5Log,832
391
- akshare-1.16.39.dist-info/LICENSE,sha256=mmSZCPgfHiVw34LXuFArd-SUgQtBJ_QsIlh-kWlDHfs,1073
392
- akshare-1.16.39.dist-info/METADATA,sha256=tHG2gpJ4nT8AAmz7PKYOODVWbEdgLQppyAjBCZXtk4E,13653
393
- akshare-1.16.39.dist-info/WHEEL,sha256=52BFRY2Up02UkjOa29eZOS2VxUrpPORXg1pkohGGUS8,91
394
- akshare-1.16.39.dist-info/top_level.txt,sha256=jsf9ZzZPmHaISTVumQPsAw7vv7Yv-PdEVW70SMEelQQ,14
395
- akshare-1.16.39.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,,