akshare 1.14.39__py3-none-any.whl → 1.14.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
@@ -2850,9 +2850,10 @@ amac_manager_cancelled_info # 中国证券投资基金业协会-信息公示-诚
2850
2850
  1.14.37 fix: fix stock_zh_kcb_report_em interface
2851
2851
  1.14.38 fix: fix stock_industry_clf_hist_sw interface
2852
2852
  1.14.39 fix: fix stock_zh_b_daily interface
2853
+ 1.14.40 fix: fix fund_open_fund_rank_em interface
2853
2854
  """
2854
2855
 
2855
- __version__ = "1.14.39"
2856
+ __version__ = "1.14.40"
2856
2857
  __author__ = "AKFamily"
2857
2858
 
2858
2859
  import sys
@@ -2874,6 +2875,11 @@ if sys.version_info < (3, 9):
2874
2875
 
2875
2876
  del sys
2876
2877
 
2878
+ """
2879
+ 知名港股
2880
+ """
2881
+ from akshare.stock.stock_hk_famous import stock_hk_famous_spot_em
2882
+
2877
2883
  """
2878
2884
  同花顺-数据中心-宏观数据-股票筹资
2879
2885
  """
@@ -1,12 +1,13 @@
1
1
  #!/usr/bin/env python
2
2
  # -*- coding:utf-8 -*-
3
3
  """
4
- Date: 2024/2/29 18:00
4
+ Date: 2024/7/24 13:00
5
5
  Desc: 东方财富网-数据中心-开放基金排行
6
6
  https://fund.eastmoney.com/data/fundranking.html
7
7
  名词解释
8
8
  https://help.1234567.com.cn/list_236.html
9
9
  """
10
+
10
11
  from datetime import datetime, date
11
12
 
12
13
  import pandas as pd
@@ -33,7 +34,7 @@ def fund_open_fund_rank_em(symbol: str = "全部") -> pd.DataFrame:
33
34
  """
34
35
  东方财富网-数据中心-开放基金排行
35
36
  https://fund.eastmoney.com/data/fundranking.html
36
- :param symbol: choice of {"全部", "股票型", "混合型", "债券型", "指数型", "QDII", "LOF", "FOF"}
37
+ :param symbol: choice of {"全部", "股票型", "混合型", "债券型", "指数型", "QDII", "FOF"}
37
38
  :type symbol: str
38
39
  :return: 开放基金排行
39
40
  :rtype: pandas.DataFrame
@@ -69,12 +70,13 @@ def fund_open_fund_rank_em(symbol: str = "全部") -> pd.DataFrame:
69
70
  "v": "0.1591891419018292",
70
71
  }
71
72
  headers = {
72
- "User-Agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/81.0.4044.138 Safari/537.36",
73
+ "User-Agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) "
74
+ "Chrome/81.0.4044.138 Safari/537.36",
73
75
  "Referer": "https://fund.eastmoney.com/fundguzhi.html",
74
76
  }
75
77
  r = requests.get(url, params=params, headers=headers)
76
78
  data_text = r.text
77
- data_json = demjson.decode(data_text[data_text.find("{"): -1])
79
+ data_json = demjson.decode(data_text[data_text.find("{") : -1])
78
80
  temp_df = pd.DataFrame(data_json["datas"])
79
81
  temp_df = temp_df.iloc[:, 0].str.split(",", expand=True)
80
82
  temp_df.reset_index(inplace=True)
@@ -129,20 +131,20 @@ def fund_open_fund_rank_em(symbol: str = "全部") -> pd.DataFrame:
129
131
  "手续费",
130
132
  ]
131
133
  ]
132
- temp_df['日期'] = pd.to_datetime(temp_df['日期'], errors="coerce").dt.date
133
- temp_df['单位净值'] = pd.to_numeric(temp_df['单位净值'], errors="coerce")
134
- temp_df['累计净值'] = pd.to_numeric(temp_df['累计净值'], errors="coerce")
135
- temp_df['日增长率'] = pd.to_numeric(temp_df['日增长率'], errors="coerce")
136
- temp_df['近1周'] = pd.to_numeric(temp_df['近1周'], errors="coerce")
137
- temp_df['近1月'] = pd.to_numeric(temp_df['近1月'], errors="coerce")
138
- temp_df['近3月'] = pd.to_numeric(temp_df['近3月'], errors="coerce")
139
- temp_df['近6月'] = pd.to_numeric(temp_df['近6月'], errors="coerce")
140
- temp_df['近1年'] = pd.to_numeric(temp_df['近1年'], errors="coerce")
141
- temp_df['近2年'] = pd.to_numeric(temp_df['近2年'], errors="coerce")
142
- temp_df['近3年'] = pd.to_numeric(temp_df['近3年'], errors="coerce")
143
- temp_df['今年来'] = pd.to_numeric(temp_df['今年来'], errors="coerce")
144
- temp_df['成立来'] = pd.to_numeric(temp_df['成立来'], errors="coerce")
145
- temp_df['自定义'] = pd.to_numeric(temp_df['自定义'], errors="coerce")
134
+ temp_df["日期"] = pd.to_datetime(temp_df["日期"], errors="coerce").dt.date
135
+ temp_df["单位净值"] = pd.to_numeric(temp_df["单位净值"], errors="coerce")
136
+ temp_df["累计净值"] = pd.to_numeric(temp_df["累计净值"], errors="coerce")
137
+ temp_df["日增长率"] = pd.to_numeric(temp_df["日增长率"], errors="coerce")
138
+ temp_df["近1周"] = pd.to_numeric(temp_df["近1周"], errors="coerce")
139
+ temp_df["近1月"] = pd.to_numeric(temp_df["近1月"], errors="coerce")
140
+ temp_df["近3月"] = pd.to_numeric(temp_df["近3月"], errors="coerce")
141
+ temp_df["近6月"] = pd.to_numeric(temp_df["近6月"], errors="coerce")
142
+ temp_df["近1年"] = pd.to_numeric(temp_df["近1年"], errors="coerce")
143
+ temp_df["近2年"] = pd.to_numeric(temp_df["近2年"], errors="coerce")
144
+ temp_df["近3年"] = pd.to_numeric(temp_df["近3年"], errors="coerce")
145
+ temp_df["今年来"] = pd.to_numeric(temp_df["今年来"], errors="coerce")
146
+ temp_df["成立来"] = pd.to_numeric(temp_df["成立来"], errors="coerce")
147
+ temp_df["自定义"] = pd.to_numeric(temp_df["自定义"], errors="coerce")
146
148
  return temp_df
147
149
 
148
150
 
@@ -167,12 +169,13 @@ def fund_exchange_rank_em() -> pd.DataFrame:
167
169
  "v": "0.1591891419018292",
168
170
  }
169
171
  headers = {
170
- "User-Agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/81.0.4044.138 Safari/537.36",
172
+ "User-Agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) "
173
+ "Chrome/81.0.4044.138 Safari/537.36",
171
174
  "Referer": "https://fund.eastmoney.com/fundguzhi.html",
172
175
  }
173
176
  r = requests.get(url, params=params, headers=headers)
174
177
  text_data = r.text
175
- json_data = demjson.decode(text_data[text_data.find("{"): -1])
178
+ json_data = demjson.decode(text_data[text_data.find("{") : -1])
176
179
  temp_df = pd.DataFrame(json_data["datas"])
177
180
  temp_df = temp_df.iloc[:, 0].str.split(",", expand=True)
178
181
  temp_df.reset_index(inplace=True)
@@ -224,19 +227,19 @@ def fund_exchange_rank_em() -> pd.DataFrame:
224
227
  "成立日期",
225
228
  ]
226
229
  ]
227
- temp_df['日期'] = pd.to_datetime(temp_df['日期']).dt.date
228
- temp_df['成立日期'] = pd.to_datetime(temp_df['成立日期']).dt.date
229
- temp_df['单位净值'] = pd.to_numeric(temp_df['单位净值'], errors="coerce")
230
- temp_df['累计净值'] = pd.to_numeric(temp_df['累计净值'], errors="coerce")
231
- temp_df['近1周'] = pd.to_numeric(temp_df['近1周'], errors="coerce")
232
- temp_df['近1月'] = pd.to_numeric(temp_df['近1月'], errors="coerce")
233
- temp_df['近3月'] = pd.to_numeric(temp_df['近3月'], errors="coerce")
234
- temp_df['近6月'] = pd.to_numeric(temp_df['近6月'], errors="coerce")
235
- temp_df['近1年'] = pd.to_numeric(temp_df['近1年'], errors="coerce")
236
- temp_df['近2年'] = pd.to_numeric(temp_df['近2年'], errors="coerce")
237
- temp_df['近3年'] = pd.to_numeric(temp_df['近3年'], errors="coerce")
238
- temp_df['今年来'] = pd.to_numeric(temp_df['今年来'], errors="coerce")
239
- temp_df['成立来'] = pd.to_numeric(temp_df['成立来'], errors="coerce")
230
+ temp_df["日期"] = pd.to_datetime(temp_df["日期"], errors="coerce").dt.date
231
+ temp_df["成立日期"] = pd.to_datetime(temp_df["成立日期"]).dt.date
232
+ temp_df["单位净值"] = pd.to_numeric(temp_df["单位净值"], errors="coerce")
233
+ temp_df["累计净值"] = pd.to_numeric(temp_df["累计净值"], errors="coerce")
234
+ temp_df["近1周"] = pd.to_numeric(temp_df["近1周"], errors="coerce")
235
+ temp_df["近1月"] = pd.to_numeric(temp_df["近1月"], errors="coerce")
236
+ temp_df["近3月"] = pd.to_numeric(temp_df["近3月"], errors="coerce")
237
+ temp_df["近6月"] = pd.to_numeric(temp_df["近6月"], errors="coerce")
238
+ temp_df["近1年"] = pd.to_numeric(temp_df["近1年"], errors="coerce")
239
+ temp_df["近2年"] = pd.to_numeric(temp_df["近2年"], errors="coerce")
240
+ temp_df["近3年"] = pd.to_numeric(temp_df["近3年"], errors="coerce")
241
+ temp_df["今年来"] = pd.to_numeric(temp_df["今年来"], errors="coerce")
242
+ temp_df["成立来"] = pd.to_numeric(temp_df["成立来"], errors="coerce")
240
243
  return temp_df
241
244
 
242
245
 
@@ -259,7 +262,8 @@ def fund_money_rank_em() -> pd.DataFrame:
259
262
  "_": "1603867224251",
260
263
  }
261
264
  headers = {
262
- "User-Agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/81.0.4044.138 Safari/537.36",
265
+ "User-Agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) "
266
+ "Chrome/81.0.4044.138 Safari/537.36",
263
267
  "Referer": "https://fund.eastmoney.com/fundguzhi.html",
264
268
  }
265
269
  r = requests.get(url, params=params, headers=headers)
@@ -319,20 +323,24 @@ def fund_money_rank_em() -> pd.DataFrame:
319
323
  "手续费",
320
324
  ]
321
325
  ]
322
- temp_df['日期'] = pd.to_datetime(temp_df['日期']).dt.date
323
- temp_df['万份收益'] = pd.to_numeric(temp_df['万份收益'], errors="coerce")
324
- temp_df['年化收益率7日'] = pd.to_numeric(temp_df['年化收益率7日'], errors="coerce")
325
- temp_df['年化收益率14日'] = pd.to_numeric(temp_df['年化收益率14日'], errors="coerce")
326
- temp_df['年化收益率28'] = pd.to_numeric(temp_df['年化收益率28日'], errors="coerce")
327
- temp_df['近1月'] = pd.to_numeric(temp_df['近1月'], errors="coerce")
328
- temp_df['近3月'] = pd.to_numeric(temp_df['近3月'], errors="coerce")
329
- temp_df['近6月'] = pd.to_numeric(temp_df['近6月'], errors="coerce")
330
- temp_df['近1年'] = pd.to_numeric(temp_df['近1年'], errors="coerce")
331
- temp_df['2年'] = pd.to_numeric(temp_df['2年'], errors="coerce")
332
- temp_df['近3年'] = pd.to_numeric(temp_df['近3年'], errors="coerce")
333
- temp_df['5年'] = pd.to_numeric(temp_df['5年'], errors="coerce")
334
- temp_df['今年来'] = pd.to_numeric(temp_df['今年来'], errors="coerce")
335
- temp_df['成立来'] = pd.to_numeric(temp_df['成立来'], errors="coerce")
326
+ temp_df["日期"] = pd.to_datetime(temp_df["日期"], errors="coerce").dt.date
327
+ temp_df["万份收益"] = pd.to_numeric(temp_df["万份收益"], errors="coerce")
328
+ temp_df["年化收益率7日"] = pd.to_numeric(temp_df["年化收益率7日"], errors="coerce")
329
+ temp_df["年化收益率14日"] = pd.to_numeric(
330
+ temp_df["年化收益率14"], errors="coerce"
331
+ )
332
+ temp_df["年化收益率28日"] = pd.to_numeric(
333
+ temp_df["年化收益率28日"], errors="coerce"
334
+ )
335
+ temp_df["1月"] = pd.to_numeric(temp_df["1月"], errors="coerce")
336
+ temp_df["近3月"] = pd.to_numeric(temp_df["近3月"], errors="coerce")
337
+ temp_df["6月"] = pd.to_numeric(temp_df["6月"], errors="coerce")
338
+ temp_df["近1年"] = pd.to_numeric(temp_df["近1年"], errors="coerce")
339
+ temp_df["近2年"] = pd.to_numeric(temp_df["近2年"], errors="coerce")
340
+ temp_df["近3年"] = pd.to_numeric(temp_df["近3年"], errors="coerce")
341
+ temp_df["近5年"] = pd.to_numeric(temp_df["近5年"], errors="coerce")
342
+ temp_df["今年来"] = pd.to_numeric(temp_df["今年来"], errors="coerce")
343
+ temp_df["成立来"] = pd.to_numeric(temp_df["成立来"], errors="coerce")
336
344
  return temp_df
337
345
 
338
346
 
@@ -358,13 +366,14 @@ def fund_lcx_rank_em() -> pd.DataFrame:
358
366
  "_": "1603867224251",
359
367
  }
360
368
  headers = {
361
- "User-Agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/81.0.4044.138 Safari/537.36",
369
+ "User-Agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) "
370
+ "Chrome/81.0.4044.138 Safari/537.36",
362
371
  "Referer": "https://fund.eastmoney.com/fundguzhi.html",
363
372
  }
364
373
  r = requests.get(url, params=params, headers=headers)
365
374
  try:
366
375
  data_json = r.json()
367
- except:
376
+ except: # noqa: E722
368
377
  return pd.DataFrame()
369
378
  temp_df = pd.DataFrame(data_json["Data"])
370
379
  temp_df.reset_index(inplace=True)
@@ -427,21 +436,22 @@ def fund_hk_rank_em() -> pd.DataFrame:
427
436
  format_date = datetime.now().date().isoformat()
428
437
  url = "https://overseas.1234567.com.cn/overseasapi/OpenApiHander.ashx"
429
438
  params = {
430
- 'api': 'HKFDApi',
431
- 'm': 'MethodFundList',
432
- 'action': '1',
433
- 'pageindex': '0',
434
- 'pagesize': '5000',
435
- 'dy': '1',
436
- 'date1': format_date,
437
- 'date2': format_date,
438
- 'sortfield': 'Y',
439
- 'sorttype': '-1',
440
- 'isbuy': '0',
441
- '_': '1610790553848',
439
+ "api": "HKFDApi",
440
+ "m": "MethodFundList",
441
+ "action": "1",
442
+ "pageindex": "0",
443
+ "pagesize": "5000",
444
+ "dy": "1",
445
+ "date1": format_date,
446
+ "date2": format_date,
447
+ "sortfield": "Y",
448
+ "sorttype": "-1",
449
+ "isbuy": "0",
450
+ "_": "1610790553848",
442
451
  }
443
452
  headers = {
444
- "User-Agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/81.0.4044.138 Safari/537.36",
453
+ "User-Agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) "
454
+ "Chrome/81.0.4044.138 Safari/537.36",
445
455
  "Referer": "https://fund.eastmoney.com/fundguzhi.html",
446
456
  }
447
457
  r = requests.get(url, params=params, headers=headers)
@@ -494,20 +504,22 @@ def fund_hk_rank_em() -> pd.DataFrame:
494
504
  "香港基金代码",
495
505
  ]
496
506
  ]
497
- temp_df['日期'] = pd.to_datetime(temp_df['日期']).dt.date
498
- temp_df['单位净值'] = pd.to_numeric(temp_df['单位净值'], errors="coerce")
499
- temp_df['日增长率'] = pd.to_numeric(temp_df['日增长率'], errors="coerce")
500
- temp_df['近1周'] = pd.to_numeric(temp_df['近1周'], errors="coerce")
501
- temp_df['近1月'] = pd.to_numeric(temp_df['近1月'], errors="coerce")
502
- temp_df['近3月'] = pd.to_numeric(temp_df['近3月'], errors="coerce")
503
- temp_df['近6月'] = pd.to_numeric(temp_df['近6月'], errors="coerce")
504
- temp_df['近1年'] = pd.to_numeric(temp_df['近1年'], errors="coerce")
505
- temp_df['近2年'] = pd.to_numeric(temp_df['近2年'], errors="coerce")
506
- temp_df['近3年'] = pd.to_numeric(temp_df['近3年'], errors="coerce")
507
- temp_df['今年来'] = pd.to_numeric(temp_df['今年来'], errors="coerce")
508
- temp_df['成立来'] = pd.to_numeric(temp_df['成立来'], errors="coerce")
509
- temp_df['成立来'] = pd.to_numeric(temp_df['成立来'], errors="coerce")
510
- temp_df['可购买'] = temp_df['可购买'].map(lambda x: "可购买" if x == "1" else "不可购买")
507
+ temp_df["日期"] = pd.to_datetime(temp_df["日期"], errors="coerce").dt.date
508
+ temp_df["单位净值"] = pd.to_numeric(temp_df["单位净值"], errors="coerce")
509
+ temp_df["日增长率"] = pd.to_numeric(temp_df["日增长率"], errors="coerce")
510
+ temp_df["近1周"] = pd.to_numeric(temp_df["近1周"], errors="coerce")
511
+ temp_df["近1月"] = pd.to_numeric(temp_df["近1月"], errors="coerce")
512
+ temp_df["近3月"] = pd.to_numeric(temp_df["近3月"], errors="coerce")
513
+ temp_df["近6月"] = pd.to_numeric(temp_df["近6月"], errors="coerce")
514
+ temp_df["近1年"] = pd.to_numeric(temp_df["近1年"], errors="coerce")
515
+ temp_df["近2年"] = pd.to_numeric(temp_df["近2年"], errors="coerce")
516
+ temp_df["近3年"] = pd.to_numeric(temp_df["近3年"], errors="coerce")
517
+ temp_df["今年来"] = pd.to_numeric(temp_df["今年来"], errors="coerce")
518
+ temp_df["成立来"] = pd.to_numeric(temp_df["成立来"], errors="coerce")
519
+ temp_df["成立来"] = pd.to_numeric(temp_df["成立来"], errors="coerce")
520
+ temp_df["可购买"] = temp_df["可购买"].map(
521
+ lambda x: "可购买" if x == "1" else "不可购买"
522
+ )
511
523
  return temp_df
512
524
 
513
525
 
@@ -530,9 +542,6 @@ if __name__ == "__main__":
530
542
  fund_open_fund_rank_em_df = fund_open_fund_rank_em(symbol="QDII")
531
543
  print(fund_open_fund_rank_em_df)
532
544
 
533
- fund_open_fund_rank_em_df = fund_open_fund_rank_em(symbol="LOF")
534
- print(fund_open_fund_rank_em_df)
535
-
536
545
  fund_open_fund_rank_em_df = fund_open_fund_rank_em(symbol="FOF")
537
546
  print(fund_open_fund_rank_em_df)
538
547
 
@@ -0,0 +1,108 @@
1
+ #!/usr/bin/env python
2
+ # -*- coding:utf-8 -*-
3
+ """
4
+ Date: 2024/7/24 13:30
5
+ Desc: 东方财富网-行情中心-港股市场-知名港股
6
+ https://quote.eastmoney.com/center/gridlist.html#hk_wellknown
7
+ """
8
+
9
+ import pandas as pd
10
+ import requests
11
+
12
+
13
+ def stock_hk_famous_spot_em() -> pd.DataFrame:
14
+ """
15
+ 东方财富网-行情中心-港股市场-知名港股
16
+ https://quote.eastmoney.com/center/gridlist.html#hk_wellknown
17
+ :return: 知名美股实时行情
18
+ :rtype: pandas.DataFrame
19
+ """
20
+ url = "https://69.push2.eastmoney.com/api/qt/clist/get"
21
+ params = {
22
+ "pn": "1",
23
+ "pz": "2000",
24
+ "po": "1",
25
+ "np": "1",
26
+ "ut": "bd1d9ddb04089700cf9c27f6f7426281",
27
+ "fltt": "2",
28
+ "invt": "2",
29
+ "dect": "1",
30
+ "wbp2u": "|0|0|0|web",
31
+ "fid": "f3",
32
+ "fs": "b:DLMK0106",
33
+ "fields": "f1,f2,f3,f4,f5,f6,f7,f8,f9,f10,f12,f13,f14,f15,f16,f17,f18,f20,f21,f23,f24,"
34
+ "f25,f26,f22,f33,f11,f62,f128,f136,f115,f152",
35
+ "_": "1631271634231",
36
+ }
37
+ r = requests.get(url, params=params)
38
+ data_json = r.json()
39
+ temp_df = pd.DataFrame(data_json["data"]["diff"])
40
+ temp_df.columns = [
41
+ "_",
42
+ "最新价",
43
+ "涨跌幅",
44
+ "涨跌额",
45
+ "成交量",
46
+ "成交额",
47
+ "_",
48
+ "_",
49
+ "_",
50
+ "_",
51
+ "_",
52
+ "代码",
53
+ "编码",
54
+ "名称",
55
+ "最高",
56
+ "最低",
57
+ "今开",
58
+ "昨收",
59
+ "总市值",
60
+ "_",
61
+ "_",
62
+ "_",
63
+ "_",
64
+ "_",
65
+ "_",
66
+ "_",
67
+ "_",
68
+ "市盈率",
69
+ "_",
70
+ "_",
71
+ "_",
72
+ "_",
73
+ "_",
74
+ ]
75
+ temp_df.reset_index(inplace=True)
76
+ temp_df["index"] = range(1, len(temp_df) + 1)
77
+ temp_df.rename(columns={"index": "序号"}, inplace=True)
78
+ temp_df = temp_df[
79
+ [
80
+ "序号",
81
+ "代码",
82
+ "名称",
83
+ "最新价",
84
+ "涨跌额",
85
+ "涨跌幅",
86
+ "今开",
87
+ "最高",
88
+ "最低",
89
+ "昨收",
90
+ "成交量",
91
+ "成交额",
92
+ ]
93
+ ]
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
+ temp_df["成交量"] = pd.to_numeric(temp_df["成交量"], errors="coerce")
102
+ temp_df["成交额"] = pd.to_numeric(temp_df["成交额"], errors="coerce")
103
+ return temp_df
104
+
105
+
106
+ if __name__ == "__main__":
107
+ stock_hk_famous_spot_em_df = stock_hk_famous_spot_em()
108
+ print(stock_hk_famous_spot_em_df)
@@ -1,10 +1,11 @@
1
1
  #!/usr/bin/env python
2
2
  # -*- coding:utf-8 -*-
3
3
  """
4
- Date: 2022/9/28 17:02
4
+ Date: 2024/7/24 13:30
5
5
  Desc: 东方财富网-行情中心-美股市场-知名美股
6
- http://quote.eastmoney.com/center/gridlist.html#us_wellknown
6
+ https://quote.eastmoney.com/center/gridlist.html#us_wellknown
7
7
  """
8
+
8
9
  import pandas as pd
9
10
  import requests
10
11
 
@@ -12,7 +13,7 @@ import requests
12
13
  def stock_us_famous_spot_em(symbol: str = "科技类") -> pd.DataFrame:
13
14
  """
14
15
  东方财富网-行情中心-美股市场-知名美股
15
- http://quote.eastmoney.com/center/gridlist.html#us_wellknown
16
+ https://quote.eastmoney.com/center/gridlist.html#us_wellknown
16
17
  :symbol: choice of {'科技类', '金融类', '医药食品类', '媒体类', '汽车能源类', '制造零售类'}
17
18
  :type: str
18
19
  :return: 知名美股实时行情
@@ -26,7 +27,7 @@ def stock_us_famous_spot_em(symbol: str = "科技类") -> pd.DataFrame:
26
27
  "汽车能源类": "0219",
27
28
  "制造零售类": "0221",
28
29
  }
29
- url = "http://69.push2.eastmoney.com/api/qt/clist/get"
30
+ url = "https://69.push2.eastmoney.com/api/qt/clist/get"
30
31
  params = {
31
32
  "pn": "1",
32
33
  "pz": "2000",
@@ -37,7 +38,8 @@ def stock_us_famous_spot_em(symbol: str = "科技类") -> pd.DataFrame:
37
38
  "invt": "2",
38
39
  "fid": "f3",
39
40
  "fs": f"b:MK{market_map[symbol]}",
40
- "fields": "f1,f2,f3,f4,f5,f6,f7,f8,f9,f10,f12,f13,f14,f15,f16,f17,f18,f20,f21,f23,f24,f25,f26,f22,f33,f11,f62,f128,f136,f115,f152",
41
+ "fields": "f1,f2,f3,f4,f5,f6,f7,f8,f9,f10,f12,f13,f14,f15,f16,f17,f18,f20,f21,f23,f24,"
42
+ "f25,f26,f22,f33,f11,f62,f128,f136,f115,f152",
41
43
  "_": "1631271634231",
42
44
  }
43
45
  r = requests.get(url, params=params)
@@ -111,6 +113,13 @@ def stock_us_famous_spot_em(symbol: str = "科技类") -> pd.DataFrame:
111
113
 
112
114
 
113
115
  if __name__ == "__main__":
114
- for item in {"科技类", "金融类", "医药食品类", "媒体类", "汽车能源类", "制造零售类"}:
116
+ for item in {
117
+ "科技类",
118
+ "金融类",
119
+ "医药食品类",
120
+ "媒体类",
121
+ "汽车能源类",
122
+ "制造零售类",
123
+ }:
115
124
  stock_us_famous_spot_em_df = stock_us_famous_spot_em(symbol=item)
116
125
  print(stock_us_famous_spot_em_df)
@@ -338,7 +338,7 @@ if __name__ == "__main__":
338
338
  print(stock_board_industry_info_ths_df)
339
339
 
340
340
  stock_board_industry_index_ths_df = stock_board_industry_index_ths(
341
- symbol="元件", start_date="20240101", end_date="20240718"
341
+ symbol="消费电子", start_date="20240101", end_date="20240724"
342
342
  )
343
343
  print(stock_board_industry_index_ths_df)
344
344
 
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: akshare
3
- Version: 1.14.39
3
+ Version: 1.14.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=wa7kk7t3wz4KGFZsDd4wdPRXTY0mRVJw_Q3Az_7hbco,179743
1
+ akshare/__init__.py,sha256=VRPanVIgg9EjtWZjTI7gBw3eUkUa87xH3kDCq368JNM,179881
2
2
  akshare/datasets.py,sha256=oIu1zC7o_LMHY22lQmdM7vCnryHibKrJLBqJwQiitlI,1167
3
3
  akshare/air/__init__.py,sha256=RMTf1bT5EOE3ttWpn3hGu1LtUmsVxDoa0W7W0gXHOy8,81
4
4
  akshare/air/air_hebei.py,sha256=xIXNGLK7IGYqrkteM9fxnHAwWqk6PCQs6D9-ggZ7byY,4442
@@ -95,7 +95,7 @@ akshare/fund/fund_lof_em.py,sha256=eWpIlHzUYbscyxvz8awiDERxd7gTucHcGcrBPTCCFno,1
95
95
  akshare/fund/fund_manager.py,sha256=yhpXp_WKradzSc0dMfGKJibNCksts2L2Bg_gvUU4_VQ,2801
96
96
  akshare/fund/fund_portfolio_em.py,sha256=8kk7a8hA22ANfnlnK1j4f5qXepfkgJOiEMpuazP2Xlk,10785
97
97
  akshare/fund/fund_position_lg.py,sha256=dxwGvfc8SXlRziWBWHIcaqOOltsKlxHgHL0Cxr7cCeM,3857
98
- akshare/fund/fund_rank_em.py,sha256=0RBrO4lKnSjpbetmGApElSiRpg8bU_0uatuXbAc11t8,17823
98
+ akshare/fund/fund_rank_em.py,sha256=FZX5YxoGAaRWlqKJDp1CLWORjxzvHMFCnoKp2yx-K4k,17874
99
99
  akshare/fund/fund_rating.py,sha256=oBZTOBaiC9RMfTK2XGKIMY58sPxc7M6GlMJ3_M3i0lQ,11680
100
100
  akshare/fund/fund_report_cninfo.py,sha256=l2YXZCt_lD_qIygeXtpls3amJwSfWp8s3KqbNZOTJhU,8670
101
101
  akshare/fund/fund_scale_em.py,sha256=8XLZpz9DzsAnJCo1moBmzf3u7mfZNZHsb3cPKJ-gCJM,4237
@@ -245,6 +245,7 @@ akshare/stock/stock_dzjy_em.py,sha256=AOgZTThw3kr_0N0y6-ujthaVg-OK0EYGGeetD58Xqm
245
245
  akshare/stock/stock_fund_em.py,sha256=wTpPCOh6PcwHK8iL8iWBgzIGXLGn5vDo-PLzHVM21xY,48849
246
246
  akshare/stock/stock_fund_hold.py,sha256=iFEmRFber7MF6aPi0QOJxpvYjO7I26KouUvC-xTQdCk,6056
247
247
  akshare/stock/stock_gsrl_em.py,sha256=oy5vO681ZPTEehZgz10T8jgIQ8dNm_E7MXGr1PGoHqI,1951
248
+ akshare/stock/stock_hk_famous.py,sha256=2tAiC86vpcxwX-2fpV4jjQMExUhG2f7C450fbl_G_zY,3015
248
249
  akshare/stock/stock_hk_fhpx_ths.py,sha256=68soKJIOMoAGuCvJIMZBVU-2wL_umtv67SuqVzl2C14,2191
249
250
  akshare/stock/stock_hk_hot_rank_em.py,sha256=IhLGahWXfYPQRrCoB1Ph7DRbs_39BcrmXpIgXgEkttg,4746
250
251
  akshare/stock/stock_hk_sina.py,sha256=sRX977vZ_nbuJ2Y7a8WA6efHp79h2ikocH3xfZ1hLfg,9586
@@ -271,7 +272,7 @@ akshare/stock/stock_share_changes_cninfo.py,sha256=7I3YUVdlW2HHm77zGkx94WiSw89d2
271
272
  akshare/stock/stock_share_hold.py,sha256=uToDxxnaD9nVtsidq0kVK-LzWU4XZdZBdzJnJvywAfI,10959
272
273
  akshare/stock/stock_stop.py,sha256=8HyazJAFj-s12ujUtrxO8VPXyA5bF9-3eNEj0qzGwMg,1185
273
274
  akshare/stock/stock_summary.py,sha256=g6BKqQRT3VAtirMaPJcIdA4itARq5NhTXKSIJaxA5KA,22524
274
- akshare/stock/stock_us_famous.py,sha256=rXIHDpvlWnFRMXEiPzs15ve-r-l-Vog586SYBQdWHIc,3585
275
+ akshare/stock/stock_us_famous.py,sha256=enx_-EzEJWAhrMVQZaN83ETY_YEWO2xEStRm6z3upO0,3655
275
276
  akshare/stock/stock_us_js.py,sha256=wwZpRvVHqjxwd0cb2O5vtRW8Zw90Kdl5O4XNwoevN64,2502
276
277
  akshare/stock/stock_us_pink.py,sha256=jgkEjPm_qa4zSN1MH0unHJopSkcF-8Rqlp5Kus2KaQ8,3062
277
278
  akshare/stock/stock_us_sina.py,sha256=3bD41Y5GqDTv52bx5jbjrt0psaHZS10UL_e7E2B6wW8,8146
@@ -293,7 +294,7 @@ akshare/stock_feature/stock_a_pe_and_pb.py,sha256=8R67gE1vUYtu9bLbZNXD88kHMcKSnB
293
294
  akshare/stock_feature/stock_account_em.py,sha256=PA-531xnv5uerFrYGc40mk8q8O0DGciHC_XVlE9udis,3342
294
295
  akshare/stock_feature/stock_all_pb.py,sha256=2yQLq03qXNbTB5AtJ-Q8uJldOluElH5zTjYneY3aaZ0,1194
295
296
  akshare/stock_feature/stock_analyst_em.py,sha256=0MmDNZYET0TAn7PBasGJgBV0Y3ljkgocQL4X5bn-7RU,9610
296
- akshare/stock_feature/stock_board_industry_ths.py,sha256=UoZxbUJqxNID2Tc-Wq5KUNgBoiJDqAI7Bn4sjZXtTKE,12482
297
+ akshare/stock_feature/stock_board_industry_ths.py,sha256=bn4vPXaK_ybU-qUttQshnzFC1L_S9reO2OydmAt7sGI,12488
297
298
  akshare/stock_feature/stock_buffett_index_lg.py,sha256=NpNccHmGjtqLz6aUladB6InPzO2pjoImbgCgmNEYUuM,2027
298
299
  akshare/stock_feature/stock_classify_sina.py,sha256=Lg7ROG5W9HioFRplJI2rZ6tAAHM09N3g9qF6kReIQYI,3210
299
300
  akshare/stock_feature/stock_comment_em.py,sha256=3HpMZkCiIC6o6LzLZLNA-rYKBMRPeuTaj6xfuU7o4J0,14252
@@ -380,8 +381,8 @@ akshare/utils/token_process.py,sha256=K4rGXjh_tgugbRcyOK2h2x0jP3PT65IIK7nxhUKhOe
380
381
  akshare/utils/tqdm.py,sha256=MuPNwcswkOGjwWQOMWXi9ZvQ_RmW4obCWRj2i7HM7FE,847
381
382
  tests/__init__.py,sha256=gNzhlO0UPjFq6Ieb38kaVIODXv4cTDByrdohAZnDYt4,82
382
383
  tests/test_func.py,sha256=tfvy_YnYmDra2dkKZ5JvprU1gNW5X9T634PszdSdH1A,944
383
- akshare-1.14.39.dist-info/LICENSE,sha256=mmSZCPgfHiVw34LXuFArd-SUgQtBJ_QsIlh-kWlDHfs,1073
384
- akshare-1.14.39.dist-info/METADATA,sha256=qxv-2dm72_INlEhq1CUTsLS5Z8CfaaStqpqr0NuSYHM,13976
385
- akshare-1.14.39.dist-info/WHEEL,sha256=Wyh-_nZ0DJYolHNn1_hMa4lM7uDedD_RGVwbmTjyItk,91
386
- akshare-1.14.39.dist-info/top_level.txt,sha256=jsf9ZzZPmHaISTVumQPsAw7vv7Yv-PdEVW70SMEelQQ,14
387
- akshare-1.14.39.dist-info/RECORD,,
384
+ akshare-1.14.40.dist-info/LICENSE,sha256=mmSZCPgfHiVw34LXuFArd-SUgQtBJ_QsIlh-kWlDHfs,1073
385
+ akshare-1.14.40.dist-info/METADATA,sha256=vqKWi0qZBzfByxvcNAaJXMk9oT7iSQV_rirrBRV7PX8,13976
386
+ akshare-1.14.40.dist-info/WHEEL,sha256=Wyh-_nZ0DJYolHNn1_hMa4lM7uDedD_RGVwbmTjyItk,91
387
+ akshare-1.14.40.dist-info/top_level.txt,sha256=jsf9ZzZPmHaISTVumQPsAw7vv7Yv-PdEVW70SMEelQQ,14
388
+ akshare-1.14.40.dist-info/RECORD,,