akshare 1.17.4__py3-none-any.whl → 1.17.5__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
@@ -3111,9 +3111,10 @@ amac_manager_cancelled_info # 中国证券投资基金业协会-信息公示-诚
3111
3111
  1.17.2 fix: fix stock_ggcg_em interface
3112
3112
  1.17.3 fix: fix stock_hot_search_baidu interface
3113
3113
  1.17.4 fix: fix stock_news_em interface
3114
+ 1.17.5 fix: fix stock_us_pink_spot_em interface
3114
3115
  """
3115
3116
 
3116
- __version__ = "1.17.4"
3117
+ __version__ = "1.17.5"
3117
3118
  __author__ = "AKFamily"
3118
3119
 
3119
3120
  import sys
@@ -1,7 +1,7 @@
1
1
  #!/usr/bin/env python
2
2
  # -*- coding:utf-8 -*-
3
3
  """
4
- Date: 2025/2/20 17:00
4
+ Date: 2025/6/17 14:00
5
5
  Desc: 东方财富网-行情中心-美股市场-粉单市场
6
6
  https://quote.eastmoney.com/center/gridlist.html#us_pinksheet
7
7
  """
@@ -9,6 +9,8 @@ https://quote.eastmoney.com/center/gridlist.html#us_pinksheet
9
9
  import pandas as pd
10
10
  import requests
11
11
 
12
+ from akshare.utils.tqdm import get_tqdm
13
+
12
14
 
13
15
  def stock_us_pink_spot_em() -> pd.DataFrame:
14
16
  """
@@ -19,22 +21,32 @@ def stock_us_pink_spot_em() -> pd.DataFrame:
19
21
  """
20
22
  url = "https://23.push2.eastmoney.com/api/qt/clist/get"
21
23
  params = {
24
+ "np": "1",
25
+ "fltt": "1",
26
+ "invt": "1",
27
+ "fs": "m:153",
28
+ "fields": "f1,f2,f3,f4,f5,f6,f7,f8,f9,f10,f12,f13,f14,f15,f16,f17,f18,f20,f21,f23,f24,f25,"
29
+ "f26,f22,f33,f11,f62,f128,f136,f115,f152",
30
+ "fid": "f3",
22
31
  "pn": "1",
23
- "pz": "50000",
32
+ "pz": "100",
24
33
  "po": "1",
25
- "np": "2",
34
+ "dect": "1",
26
35
  "ut": "bd1d9ddb04089700cf9c27f6f7426281",
27
- "fltt": "2",
28
- "invt": "2",
29
- "fid": "f3",
30
- "fs": "m:153",
31
- "fields": "f1,f2,f3,f4,f5,f6,f7,f8,f9,f10,f12,f13,f14,f15,f16,f17,f18,f20,f21,f23,f24,f25,"
32
- "f26,f22,f33,f11,f62,f128,f136,f115,f152",
33
36
  }
34
37
  r = requests.get(url, params=params)
35
38
  data_json = r.json()
36
- temp_df = pd.DataFrame(data_json["data"]["diff"]).T
37
- temp_df.columns = [
39
+ import math
40
+ total_page = math.ceil(data_json['data']["total"] / 100)
41
+ tqdm = get_tqdm()
42
+ big_df = pd.DataFrame()
43
+ for page in tqdm(range(1, total_page + 1), leave=False):
44
+ params.update({"pn": page})
45
+ r = requests.get(url, params=params)
46
+ data_json = r.json()
47
+ temp_df = pd.DataFrame(data_json["data"]["diff"])
48
+ big_df = pd.concat(objs=[big_df, temp_df], ignore_index=True)
49
+ big_df.columns = [
38
50
  "_",
39
51
  "最新价",
40
52
  "涨跌幅",
@@ -69,11 +81,11 @@ def stock_us_pink_spot_em() -> pd.DataFrame:
69
81
  "_",
70
82
  "_",
71
83
  ]
72
- temp_df.reset_index(inplace=True)
73
- temp_df["index"] = range(1, len(temp_df) + 1)
74
- temp_df.rename(columns={"index": "序号"}, inplace=True)
75
- temp_df["代码"] = temp_df["编码"].astype(str) + "." + temp_df["简称"]
76
- temp_df = temp_df[
84
+ big_df.reset_index(inplace=True)
85
+ big_df["index"] = range(1, len(big_df) + 1)
86
+ big_df.rename(columns={"index": "序号"}, inplace=True)
87
+ big_df["代码"] = big_df["编码"].astype(str) + "." + big_df["简称"]
88
+ big_df = big_df[
77
89
  [
78
90
  "序号",
79
91
  "名称",
@@ -89,16 +101,16 @@ def stock_us_pink_spot_em() -> pd.DataFrame:
89
101
  "代码",
90
102
  ]
91
103
  ]
92
- temp_df["最新价"] = pd.to_numeric(temp_df["最新价"], errors="coerce")
93
- temp_df["涨跌额"] = pd.to_numeric(temp_df["涨跌额"], errors="coerce")
94
- temp_df["涨跌幅"] = pd.to_numeric(temp_df["涨跌幅"], errors="coerce")
95
- temp_df["开盘价"] = pd.to_numeric(temp_df["开盘价"], errors="coerce")
96
- temp_df["最高价"] = pd.to_numeric(temp_df["最高价"], errors="coerce")
97
- temp_df["最低价"] = pd.to_numeric(temp_df["最低价"], errors="coerce")
98
- temp_df["昨收价"] = pd.to_numeric(temp_df["昨收价"], errors="coerce")
99
- temp_df["总市值"] = pd.to_numeric(temp_df["总市值"], errors="coerce")
100
- temp_df["市盈率"] = pd.to_numeric(temp_df["市盈率"], errors="coerce")
101
- return temp_df
104
+ big_df["最新价"] = pd.to_numeric(big_df["最新价"], errors="coerce")
105
+ big_df["涨跌额"] = pd.to_numeric(big_df["涨跌额"], errors="coerce")
106
+ big_df["涨跌幅"] = pd.to_numeric(big_df["涨跌幅"], errors="coerce")
107
+ big_df["开盘价"] = pd.to_numeric(big_df["开盘价"], errors="coerce")
108
+ big_df["最高价"] = pd.to_numeric(big_df["最高价"], errors="coerce")
109
+ big_df["最低价"] = pd.to_numeric(big_df["最低价"], errors="coerce")
110
+ big_df["昨收价"] = pd.to_numeric(big_df["昨收价"], errors="coerce")
111
+ big_df["总市值"] = pd.to_numeric(big_df["总市值"], errors="coerce")
112
+ big_df["市盈率"] = pd.to_numeric(big_df["市盈率"], errors="coerce")
113
+ return big_df
102
114
 
103
115
 
104
116
  if __name__ == "__main__":
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: akshare
3
- Version: 1.17.4
3
+ Version: 1.17.5
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=twJAGFkSIFLrKHrK1E70Rd2OLGdMNShna9kAF5LEMgg,194559
1
+ akshare/__init__.py,sha256=3j-3vUz9pWscK31P9S6UJUj68G4POhBLsJuzWx1cAM8,194607
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
@@ -278,7 +278,7 @@ akshare/stock/stock_stop.py,sha256=WRFvnldImkwNI8b8Y3kAdS6Ua69DUG5s5nlKHZav7R0,1
278
278
  akshare/stock/stock_summary.py,sha256=6J4a3q4H2xKNdeiWNmjfyqyzJzb6QirmvowUuUvbqD4,11745
279
279
  akshare/stock/stock_us_famous.py,sha256=03qlwpDQT3EJSSDuGuzemP3TU2QwLZBOXotaOgDe1dQ,3628
280
280
  akshare/stock/stock_us_js.py,sha256=VleGUb7K-NjmW3jMPRc2jwHXM0CMq4IzVM9kUpwURDQ,2503
281
- akshare/stock/stock_us_pink.py,sha256=b48o56E6Ur1Z_50gPvaZo8ZyegePwVJs8z8KMSqHg0U,3035
281
+ akshare/stock/stock_us_pink.py,sha256=tt30S6yvqaHO4AiWiqnpfRf1dwa0w_K78sTF26htnzs,3446
282
282
  akshare/stock/stock_us_sina.py,sha256=D4fhJgpmvnlVoeSV2wQQ7H6lig8h6vaJp71o88dZhDg,8200
283
283
  akshare/stock/stock_weibo_nlp.py,sha256=-k7gzAusb8_D4l0rc6bOzQ3x4b2dFBXJ2hgOntwEGc8,3266
284
284
  akshare/stock/stock_xq.py,sha256=DMF1U8xkdR31L7BQ3bScxeh4x6XaHNV0pAQBSLdSEc0,4901
@@ -392,10 +392,10 @@ akshare/utils/func.py,sha256=4cwmXFztU86yJNONJ40KJLvsIEQHBbct4iMm3zT2v30,2315
392
392
  akshare/utils/multi_decrypt.py,sha256=aWoL2iEPeuXHJg8-n7OtMKixLnIhfzepACgxfrfmQB4,1657
393
393
  akshare/utils/token_process.py,sha256=nGtgnZGRprXJkhLXH8mcUH4TgIFwzsTOb0EaEPa0Euo,667
394
394
  akshare/utils/tqdm.py,sha256=MuPNwcswkOGjwWQOMWXi9ZvQ_RmW4obCWRj2i7HM7FE,847
395
- akshare-1.17.4.dist-info/licenses/LICENSE,sha256=mmSZCPgfHiVw34LXuFArd-SUgQtBJ_QsIlh-kWlDHfs,1073
395
+ akshare-1.17.5.dist-info/licenses/LICENSE,sha256=mmSZCPgfHiVw34LXuFArd-SUgQtBJ_QsIlh-kWlDHfs,1073
396
396
  tests/__init__.py,sha256=gNzhlO0UPjFq6Ieb38kaVIODXv4cTDByrdohAZnDYt4,82
397
397
  tests/test_func.py,sha256=j1MGYbZI2if2j_LY1S4FLsf4qfq4NwVqD5wmRlv5Log,832
398
- akshare-1.17.4.dist-info/METADATA,sha256=7xQNnRGIghEd_sQJBZ_t2BooXUMLmxw0HQ_1G4W3oN4,11901
399
- akshare-1.17.4.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
400
- akshare-1.17.4.dist-info/top_level.txt,sha256=jsf9ZzZPmHaISTVumQPsAw7vv7Yv-PdEVW70SMEelQQ,14
401
- akshare-1.17.4.dist-info/RECORD,,
398
+ akshare-1.17.5.dist-info/METADATA,sha256=enaQvq9Qs2pAiPxnKq1qkmFTAONXmm0lDTfEQd1b7lY,11901
399
+ akshare-1.17.5.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
400
+ akshare-1.17.5.dist-info/top_level.txt,sha256=jsf9ZzZPmHaISTVumQPsAw7vv7Yv-PdEVW70SMEelQQ,14
401
+ akshare-1.17.5.dist-info/RECORD,,