akshare 1.16.39__py3-none-any.whl → 1.16.40__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,10 @@ 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
3051
3052
  """
3052
3053
 
3053
- __version__ = "1.16.39"
3054
+ __version__ = "1.16.40"
3054
3055
  __author__ = "AKFamily"
3055
3056
 
3056
3057
  import sys
@@ -3072,6 +3073,11 @@ if sys.version_info < (3, 9):
3072
3073
 
3073
3074
  del sys
3074
3075
 
3076
+ """
3077
+ 雪球-个股-公司概况-公司简介
3078
+ """
3079
+ from akshare.stock_fundamental.stock_basic_info_xq import stock_individual_basic_info_xq
3080
+
3075
3081
  """
3076
3082
  新浪财经-行情中心-环球市场
3077
3083
  """
@@ -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
  "-",
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.40
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=vDMTa-t_OXE_HSBvNNSXAcMzYQXf2YQSfz0mMQfFStQ,190727
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,7 +237,7 @@ 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
@@ -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.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,,