akshare 1.14.39__py3-none-any.whl → 1.14.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.

Potentially problematic release.


This version of akshare might be problematic. Click here for more details.

akshare/__init__.py CHANGED
@@ -2850,9 +2850,11 @@ 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
2854
+ 1.14.41 fix: fix fund_report_asset_allocation_cninfo interface
2853
2855
  """
2854
2856
 
2855
- __version__ = "1.14.39"
2857
+ __version__ = "1.14.41"
2856
2858
  __author__ = "AKFamily"
2857
2859
 
2858
2860
  import sys
@@ -2874,6 +2876,11 @@ if sys.version_info < (3, 9):
2874
2876
 
2875
2877
  del sys
2876
2878
 
2879
+ """
2880
+ 知名港股
2881
+ """
2882
+ from akshare.stock.stock_hk_famous import stock_hk_famous_spot_em
2883
+
2877
2884
  """
2878
2885
  同花顺-数据中心-宏观数据-股票筹资
2879
2886
  """
@@ -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
 
@@ -1,14 +1,14 @@
1
1
  # -*- coding:utf-8 -*-
2
2
  # !/usr/bin/env python
3
3
  """
4
- Date: 2023/6/13 16:12
4
+ Date: 2024/7/24 23:30
5
5
  Desc: 巨潮资讯-数据中心-专题统计-基金报表
6
- http://webapi.cninfo.com.cn/#/thematicStatistics
6
+ https://webapi.cninfo.com.cn/#/thematicStatistics
7
7
  """
8
8
 
9
9
  import pandas as pd
10
- import requests
11
10
  import py_mini_racer
11
+ import requests
12
12
 
13
13
  from akshare.datasets import get_ths_js
14
14
 
@@ -22,7 +22,7 @@ def _get_file_content_cninfo(file: str = "cninfo.js") -> str:
22
22
  :rtype: str
23
23
  """
24
24
  setting_file_path = get_ths_js(file)
25
- with open(setting_file_path) as f:
25
+ with open(setting_file_path, encoding="utf-8") as f:
26
26
  file_data = f.read()
27
27
  return file_data
28
28
 
@@ -30,13 +30,13 @@ def _get_file_content_cninfo(file: str = "cninfo.js") -> str:
30
30
  def fund_report_stock_cninfo(date: str = "20210630") -> pd.DataFrame:
31
31
  """
32
32
  巨潮资讯-数据中心-专题统计-基金报表-基金重仓股
33
- http://webapi.cninfo.com.cn/#/thematicStatistics
33
+ https://webapi.cninfo.com.cn/#/thematicStatistics
34
34
  :param date: 报告时间; choice of {"XXXX0331", "XXXX0630", "XXXX0930", "XXXX1231"}
35
35
  :type date: str
36
36
  :return: 基金重仓股
37
37
  :rtype: pandas.DataFrame
38
38
  """
39
- url = "http://webapi.cninfo.com.cn/api/sysapi/p_sysapi1112"
39
+ url = "https://webapi.cninfo.com.cn/api/sysapi/p_sysapi1112"
40
40
  js_code = py_mini_racer.MiniRacer()
41
41
  js_content = _get_file_content_cninfo("cninfo.js")
42
42
  js_code.eval(js_content)
@@ -49,11 +49,12 @@ def fund_report_stock_cninfo(date: str = "20210630") -> pd.DataFrame:
49
49
  "Cache-Control": "no-cache",
50
50
  "Content-Length": "0",
51
51
  "Host": "webapi.cninfo.com.cn",
52
- "Origin": "http://webapi.cninfo.com.cn",
52
+ "Origin": "https://webapi.cninfo.com.cn",
53
53
  "Pragma": "no-cache",
54
54
  "Proxy-Connection": "keep-alive",
55
- "Referer": "http://webapi.cninfo.com.cn/",
56
- "User-Agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/93.0.4577.63 Safari/537.36",
55
+ "Referer": "https://webapi.cninfo.com.cn/",
56
+ "User-Agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) "
57
+ "Chrome/93.0.4577.63 Safari/537.36",
57
58
  "X-Requested-With": "XMLHttpRequest",
58
59
  }
59
60
  params = {
@@ -89,19 +90,20 @@ def fund_report_stock_cninfo(date: str = "20210630") -> pd.DataFrame:
89
90
  temp_df["持股总数"] = pd.to_numeric(temp_df["持股总数"], errors="coerce")
90
91
  temp_df["持股总市值"] = pd.to_numeric(temp_df["持股总市值"], errors="coerce")
91
92
  temp_df["基金覆盖家数"] = pd.to_numeric(temp_df["基金覆盖家数"], errors="coerce")
93
+ temp_df["序号"] = range(1, len(temp_df) + 1)
92
94
  return temp_df
93
95
 
94
96
 
95
97
  def fund_report_industry_allocation_cninfo(date: str = "20210630") -> pd.DataFrame:
96
98
  """
97
99
  巨潮资讯-数据中心-专题统计-基金报表-基金行业配置
98
- http://webapi.cninfo.com.cn/#/thematicStatistics
100
+ https://webapi.cninfo.com.cn/#/thematicStatistics
99
101
  :param date: 报告时间; choice of {"XXXX0331", "XXXX0630", "XXXX0930", "XXXX1231"}, 从 2017 年开始
100
102
  :type date: str
101
103
  :return: 基金行业配置
102
104
  :rtype: pandas.DataFrame
103
105
  """
104
- url = "http://webapi.cninfo.com.cn/api/sysapi/p_sysapi1113"
106
+ url = "https://webapi.cninfo.com.cn/api/sysapi/p_sysapi1113"
105
107
  js_code = py_mini_racer.MiniRacer()
106
108
  js_content = _get_file_content_cninfo("cninfo.js")
107
109
  js_code.eval(js_content)
@@ -114,11 +116,12 @@ def fund_report_industry_allocation_cninfo(date: str = "20210630") -> pd.DataFra
114
116
  "Cache-Control": "no-cache",
115
117
  "Content-Length": "0",
116
118
  "Host": "webapi.cninfo.com.cn",
117
- "Origin": "http://webapi.cninfo.com.cn",
119
+ "Origin": "https://webapi.cninfo.com.cn",
118
120
  "Pragma": "no-cache",
119
121
  "Proxy-Connection": "keep-alive",
120
- "Referer": "http://webapi.cninfo.com.cn/",
121
- "User-Agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/93.0.4577.63 Safari/537.36",
122
+ "Referer": "https://webapi.cninfo.com.cn/",
123
+ "User-Agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) "
124
+ "Chrome/93.0.4577.63 Safari/537.36",
122
125
  "X-Requested-With": "XMLHttpRequest",
123
126
  }
124
127
  params = {
@@ -158,11 +161,11 @@ def fund_report_industry_allocation_cninfo(date: str = "20210630") -> pd.DataFra
158
161
  def fund_report_asset_allocation_cninfo() -> pd.DataFrame:
159
162
  """
160
163
  巨潮资讯-数据中心-专题统计-基金报表-基金资产配置
161
- http://webapi.cninfo.com.cn/#/thematicStatistics
164
+ https://webapi.cninfo.com.cn/#/thematicStatistics
162
165
  :return: 基金资产配置
163
166
  :rtype: pandas.DataFrame
164
167
  """
165
- url = "http://webapi.cninfo.com.cn/api/sysapi/p_sysapi1114"
168
+ url = "https://webapi.cninfo.com.cn/api/sysapi/p_sysapi1114"
166
169
  js_code = py_mini_racer.MiniRacer()
167
170
  js_content = _get_file_content_cninfo("cninfo.js")
168
171
  js_code.eval(js_content)
@@ -175,11 +178,12 @@ def fund_report_asset_allocation_cninfo() -> pd.DataFrame:
175
178
  "Cache-Control": "no-cache",
176
179
  "Content-Length": "0",
177
180
  "Host": "webapi.cninfo.com.cn",
178
- "Origin": "http://webapi.cninfo.com.cn",
181
+ "Origin": "https://webapi.cninfo.com.cn",
179
182
  "Pragma": "no-cache",
180
183
  "Proxy-Connection": "keep-alive",
181
- "Referer": "http://webapi.cninfo.com.cn/",
182
- "User-Agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/93.0.4577.63 Safari/537.36",
184
+ "Referer": "https://webapi.cninfo.com.cn/",
185
+ "User-Agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) "
186
+ "Chrome/93.0.4577.63 Safari/537.36",
183
187
  "X-Requested-With": "XMLHttpRequest",
184
188
  }
185
189
  r = requests.post(url, headers=headers)
@@ -1,14 +1,14 @@
1
1
  #!/usr/bin/env python
2
2
  # -*- coding:utf-8 -*-
3
3
  """
4
- Date: 2023/5/29 23:34
4
+ Date: 2024/7/24 23:30
5
5
  Desc: 巨潮资讯-数据中心-专题统计-公司治理-股权质押
6
- http://webapi.cninfo.com.cn/#/thematicStatistics
6
+ https://webapi.cninfo.com.cn/#/thematicStatistics
7
7
  """
8
8
 
9
9
  import pandas as pd
10
- import requests
11
10
  import py_mini_racer
11
+ import requests
12
12
 
13
13
  from akshare.datasets import get_ths_js
14
14
 
@@ -22,7 +22,7 @@ def _get_file_content_ths(file: str = "cninfo.js") -> str:
22
22
  :rtype: str
23
23
  """
24
24
  setting_file_path = get_ths_js(file)
25
- with open(setting_file_path) as f:
25
+ with open(setting_file_path, encoding="utf-8") as f:
26
26
  file_data = f.read()
27
27
  return file_data
28
28
 
@@ -30,13 +30,13 @@ def _get_file_content_ths(file: str = "cninfo.js") -> str:
30
30
  def stock_cg_equity_mortgage_cninfo(date: str = "20210930") -> pd.DataFrame:
31
31
  """
32
32
  巨潮资讯-数据中心-专题统计-公司治理-股权质押
33
- http://webapi.cninfo.com.cn/#/thematicStatistics
33
+ https://webapi.cninfo.com.cn/#/thematicStatistics
34
34
  :param date: 开始统计时间
35
35
  :type date: str
36
36
  :return: 股权质押
37
37
  :rtype: pandas.DataFrame
38
38
  """
39
- url = "http://webapi.cninfo.com.cn/api/sysapi/p_sysapi1094"
39
+ url = "https://webapi.cninfo.com.cn/api/sysapi/p_sysapi1094"
40
40
  js_code = py_mini_racer.MiniRacer()
41
41
  js_content = _get_file_content_ths("cninfo.js")
42
42
  js_code.eval(js_content)
@@ -49,11 +49,12 @@ def stock_cg_equity_mortgage_cninfo(date: str = "20210930") -> pd.DataFrame:
49
49
  "Cache-Control": "no-cache",
50
50
  "Content-Length": "0",
51
51
  "Host": "webapi.cninfo.com.cn",
52
- "Origin": "http://webapi.cninfo.com.cn",
52
+ "Origin": "https://webapi.cninfo.com.cn",
53
53
  "Pragma": "no-cache",
54
54
  "Proxy-Connection": "keep-alive",
55
- "Referer": "http://webapi.cninfo.com.cn/",
56
- "User-Agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/93.0.4577.63 Safari/537.36",
55
+ "Referer": "https://webapi.cninfo.com.cn/",
56
+ "User-Agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) "
57
+ "Chrome/93.0.4577.63 Safari/537.36",
57
58
  "X-Requested-With": "XMLHttpRequest",
58
59
  }
59
60
  params = {
@@ -88,7 +89,7 @@ def stock_cg_equity_mortgage_cninfo(date: str = "20210930") -> pd.DataFrame:
88
89
  "累计质押占总股本比例",
89
90
  ]
90
91
  ]
91
- temp_df["公告日期"] = pd.to_datetime(temp_df["公告日期"]).dt.date
92
+ temp_df["公告日期"] = pd.to_datetime(temp_df["公告日期"], errors="coerce").dt.date
92
93
  temp_df["质押数量"] = pd.to_numeric(temp_df["质押数量"], errors="coerce")
93
94
  temp_df["占总股本比例"] = pd.to_numeric(temp_df["占总股本比例"], errors="coerce")
94
95
  temp_df["质押解除数量"] = pd.to_numeric(temp_df["质押解除数量"], errors="coerce")
@@ -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,19 +1,19 @@
1
1
  #!/usr/bin/env python
2
2
  # -*- coding:utf-8 -*-
3
3
  """
4
- Date: 2023/8/23 8:30
4
+ Date: 2024/7/24 23:30
5
5
  Desc: 巨潮资讯-数据中心-专题统计-股东股本-实际控制人持股变动
6
- http://webapi.cninfo.com.cn/#/thematicStatistics
6
+ https://webapi.cninfo.com.cn/#/thematicStatistics
7
7
 
8
8
  巨潮资讯-数据中心-专题统计-股东股本-高管持股变动明细
9
- http://webapi.cninfo.com.cn/#/thematicStatistics
9
+ https://webapi.cninfo.com.cn/#/thematicStatistics
10
10
  """
11
11
 
12
12
  import datetime
13
13
 
14
14
  import pandas as pd
15
- import requests
16
15
  import py_mini_racer
16
+ import requests
17
17
 
18
18
  from akshare.datasets import get_ths_js
19
19
 
@@ -27,7 +27,7 @@ def _get_file_content_cninfo(file: str = "cninfo.js") -> str:
27
27
  :rtype: str
28
28
  """
29
29
  setting_file_path = get_ths_js(file)
30
- with open(setting_file_path) as f:
30
+ with open(setting_file_path, encoding="utf-8") as f:
31
31
  file_data = f.read()
32
32
  return file_data
33
33
 
@@ -35,7 +35,7 @@ def _get_file_content_cninfo(file: str = "cninfo.js") -> str:
35
35
  def stock_hold_control_cninfo(symbol: str = "全部") -> pd.DataFrame:
36
36
  """
37
37
  巨潮资讯-数据中心-专题统计-股东股本-实际控制人持股变动
38
- http://webapi.cninfo.com.cn/#/thematicStatistics
38
+ https://webapi.cninfo.com.cn/#/thematicStatistics
39
39
  :param symbol: choice of {"单独控制", "实际控制人", "一致行动人", "家族控制", "全部"}; 从 2010 开始
40
40
  :type symbol: str
41
41
  :return: 实际控制人持股变动
@@ -48,7 +48,7 @@ def stock_hold_control_cninfo(symbol: str = "全部") -> pd.DataFrame:
48
48
  "家族控制": "069004",
49
49
  "全部": "",
50
50
  }
51
- url = "http://webapi.cninfo.com.cn/api/sysapi/p_sysapi1033"
51
+ url = "https://webapi.cninfo.com.cn/api/sysapi/p_sysapi1033"
52
52
  js_code = py_mini_racer.MiniRacer()
53
53
  js_content = _get_file_content_cninfo("cninfo.js")
54
54
  js_code.eval(js_content)
@@ -61,11 +61,12 @@ def stock_hold_control_cninfo(symbol: str = "全部") -> pd.DataFrame:
61
61
  "Cache-Control": "no-cache",
62
62
  "Content-Length": "0",
63
63
  "Host": "webapi.cninfo.com.cn",
64
- "Origin": "http://webapi.cninfo.com.cn",
64
+ "Origin": "https://webapi.cninfo.com.cn",
65
65
  "Pragma": "no-cache",
66
66
  "Proxy-Connection": "keep-alive",
67
- "Referer": "http://webapi.cninfo.com.cn/",
68
- "User-Agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/93.0.4577.63 Safari/537.36",
67
+ "Referer": "https://webapi.cninfo.com.cn/",
68
+ "User-Agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) "
69
+ "Chrome/93.0.4577.63 Safari/537.36",
69
70
  "X-Requested-With": "XMLHttpRequest",
70
71
  }
71
72
  params = {
@@ -105,7 +106,7 @@ def stock_hold_control_cninfo(symbol: str = "全部") -> pd.DataFrame:
105
106
  def stock_hold_management_detail_cninfo(symbol: str = "增持") -> pd.DataFrame:
106
107
  """
107
108
  巨潮资讯-数据中心-专题统计-股东股本-高管持股变动明细
108
- http://webapi.cninfo.com.cn/#/thematicStatistics
109
+ https://webapi.cninfo.com.cn/#/thematicStatistics
109
110
  :param symbol: choice of {"增持", "减持"}
110
111
  :type symbol: str
111
112
  :return: 高管持股变动明细
@@ -116,7 +117,7 @@ def stock_hold_management_detail_cninfo(symbol: str = "增持") -> pd.DataFrame:
116
117
  "减持": "S",
117
118
  }
118
119
  current_date = datetime.datetime.now().date().isoformat()
119
- url = "http://webapi.cninfo.com.cn/api/sysapi/p_sysapi1030"
120
+ url = "https://webapi.cninfo.com.cn/api/sysapi/p_sysapi1030"
120
121
  js_code = py_mini_racer.MiniRacer()
121
122
  js_content = _get_file_content_cninfo("cninfo.js")
122
123
  js_code.eval(js_content)
@@ -129,11 +130,12 @@ def stock_hold_management_detail_cninfo(symbol: str = "增持") -> pd.DataFrame:
129
130
  "Content-Length": "0",
130
131
  "Host": "webapi.cninfo.com.cn",
131
132
  "Accept-Enckey": mcode,
132
- "Origin": "http://webapi.cninfo.com.cn",
133
+ "Origin": "https://webapi.cninfo.com.cn",
133
134
  "Pragma": "no-cache",
134
135
  "Proxy-Connection": "keep-alive",
135
- "Referer": "http://webapi.cninfo.com.cn/",
136
- "User-Agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/93.0.4577.63 Safari/537.36",
136
+ "Referer": "https://webapi.cninfo.com.cn/",
137
+ "User-Agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) "
138
+ "Chrome/93.0.4577.63 Safari/537.36",
137
139
  "X-Requested-With": "XMLHttpRequest",
138
140
  }
139
141
  params = {
@@ -1,14 +1,14 @@
1
1
  #!/usr/bin/env python
2
2
  # -*- coding:utf-8 -*-
3
3
  """
4
- Date: 2023/5/30 00:19
4
+ Date: 2024/7/24 23:30
5
5
  Desc: 巨潮资讯-数据中心-专题统计-股东股本-股东人数及持股集中度
6
- http://webapi.cninfo.com.cn/#/thematicStatistics
6
+ https://webapi.cninfo.com.cn/#/thematicStatistics
7
7
  """
8
8
 
9
9
  import pandas as pd
10
- import requests
11
10
  import py_mini_racer
11
+ import requests
12
12
 
13
13
  from akshare.datasets import get_ths_js
14
14
 
@@ -22,7 +22,7 @@ def _get_file_content_ths(file: str = "cninfo.js") -> str:
22
22
  :rtype: str
23
23
  """
24
24
  setting_file_path = get_ths_js(file)
25
- with open(setting_file_path) as f:
25
+ with open(setting_file_path, encoding="utf-8") as f:
26
26
  file_data = f.read()
27
27
  return file_data
28
28
 
@@ -30,13 +30,13 @@ def _get_file_content_ths(file: str = "cninfo.js") -> str:
30
30
  def stock_hold_num_cninfo(date: str = "20210630") -> pd.DataFrame:
31
31
  """
32
32
  巨潮资讯-数据中心-专题统计-股东股本-股东人数及持股集中度
33
- http://webapi.cninfo.com.cn/#/thematicStatistics
33
+ https://webapi.cninfo.com.cn/#/thematicStatistics
34
34
  :param date: choice of {"XXXX0331", "XXXX0630", "XXXX0930", "XXXX1231"}; 从 20170331 开始
35
35
  :type date: str
36
36
  :return: 股东人数及持股集中度
37
37
  :rtype: pandas.DataFrame
38
38
  """
39
- url = "http://webapi.cninfo.com.cn/api/sysapi/p_sysapi1034"
39
+ url = "https://webapi.cninfo.com.cn/api/sysapi/p_sysapi1034"
40
40
  js_code = py_mini_racer.MiniRacer()
41
41
  js_content = _get_file_content_ths("cninfo.js")
42
42
  js_code.eval(js_content)
@@ -49,11 +49,12 @@ def stock_hold_num_cninfo(date: str = "20210630") -> pd.DataFrame:
49
49
  "Cache-Control": "no-cache",
50
50
  "Content-Length": "0",
51
51
  "Host": "webapi.cninfo.com.cn",
52
- "Origin": "http://webapi.cninfo.com.cn",
52
+ "Origin": "https://webapi.cninfo.com.cn",
53
53
  "Pragma": "no-cache",
54
54
  "Proxy-Connection": "keep-alive",
55
- "Referer": "http://webapi.cninfo.com.cn/",
56
- "User-Agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/93.0.4577.63 Safari/537.36",
55
+ "Referer": "https://webapi.cninfo.com.cn/",
56
+ "User-Agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) "
57
+ "Chrome/93.0.4577.63 Safari/537.36",
57
58
  "X-Requested-With": "XMLHttpRequest",
58
59
  }
59
60
  params = {
@@ -86,7 +87,7 @@ def stock_hold_num_cninfo(date: str = "20210630") -> pd.DataFrame:
86
87
  "人均持股数量增幅",
87
88
  ]
88
89
  ]
89
- temp_df["变动日期"] = pd.to_datetime(temp_df["变动日期"]).dt.date
90
+ temp_df["变动日期"] = pd.to_datetime(temp_df["变动日期"], errors="coerce").dt.date
90
91
  temp_df["本期人均持股数量"] = pd.to_numeric(
91
92
  temp_df["本期人均持股数量"], errors="coerce"
92
93
  )
@@ -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.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=wa7kk7t3wz4KGFZsDd4wdPRXTY0mRVJw_Q3Az_7hbco,179743
1
+ akshare/__init__.py,sha256=quEKyO6OetuNOrR_wjNwgfHRQWDFi370GayaKLBgHUI,179944
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,9 +95,9 @@ 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
- akshare/fund/fund_report_cninfo.py,sha256=l2YXZCt_lD_qIygeXtpls3amJwSfWp8s3KqbNZOTJhU,8670
100
+ akshare/fund/fund_report_cninfo.py,sha256=rhztaa3J48VdnCEXFAl8wMg-P7MI2iQa0HculkvL8CI,8785
101
101
  akshare/fund/fund_scale_em.py,sha256=8XLZpz9DzsAnJCo1moBmzf3u7mfZNZHsb3cPKJ-gCJM,4237
102
102
  akshare/fund/fund_scale_sina.py,sha256=cQ39Pt6ia3GrVCFWv0GhLMqxyedX3qRrvkDLee7N9R0,8083
103
103
  akshare/fund/fund_xq.py,sha256=qGMKYC0Vi2AXfnjsS0P9B2ITfpkQ85i4ayXA6kJ6a7o,11295
@@ -237,7 +237,7 @@ akshare/stock/stock_allotment_cninfo.py,sha256=qk--nWhskZWnUUOwBvfgiFJEOd1GqmQij
237
237
  akshare/stock/stock_ask_bid_em.py,sha256=ioVkmRMVs7A7Lj_PboxwIoZINNk73nAko80wIJX4RKU,5510
238
238
  akshare/stock/stock_board_concept_em.py,sha256=iajw06K04I-F9VGXbuJf5Vz_digDCgMi4J1vgzkmbFA,14039
239
239
  akshare/stock/stock_board_industry_em.py,sha256=ZyDnlwAFBEtQI2KEThqs7QG6Akl1DBbKFy7qB3tzqN0,16161
240
- akshare/stock/stock_cg_equity_mortgage.py,sha256=LYeemJPIlLLDM-nPhF2RjMwuWmm97ZIMq-Hy4WjGaA8,3375
240
+ akshare/stock/stock_cg_equity_mortgage.py,sha256=Pui5aWKKPwGuKjF_GNpejDzsMGNPrxiaJviLz3x2e9I,3426
241
241
  akshare/stock/stock_cg_guarantee.py,sha256=ts7qcQhhyN1PHB7Q4XlMn38HhfVvubOvky9RZfmUP94,3844
242
242
  akshare/stock/stock_cg_lawsuit.py,sha256=6Y92pPw0JgyrInteqHuU07G1jwmdX2wjaDtrJN8y6Hg,4129
243
243
  akshare/stock/stock_dividend_cninfo.py,sha256=_vipLQu94qBDoPkaIWZKRFA0mFfgroUMnn5EdLcjAc4,3195
@@ -245,12 +245,13 @@ 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
251
- akshare/stock/stock_hold_control_cninfo.py,sha256=AOyd0f9jIj-HvJzkGrsE1e8fTuGRv4ZdI4FTkZBmcw8,7014
252
+ akshare/stock/stock_hold_control_cninfo.py,sha256=NpUDtfYCDQGhqX1ZAL8Uy2yslZ2zc15YBrzOt5_4k6o,7065
252
253
  akshare/stock/stock_hold_control_em.py,sha256=iBgnSEV7aYdsS2Ce7ELIUqVo-polfYdqcd6UmEuVN7g,7349
253
- akshare/stock/stock_hold_num_cninfo.py,sha256=oSRY5WMr7xeMHhMNmmWMG7G6_9bEqgQj2TSjzsEhYxA,3655
254
+ akshare/stock/stock_hold_num_cninfo.py,sha256=JY9LcZMhhTiCHfQJv4pwMrLrpUxTKGLE4oRD6pvflsU,3706
254
255
  akshare/stock/stock_hot_rank_em.py,sha256=F466GuUgtlJbaCdD4v8TDCV-d7PxnetEI-zRz0OTvnA,7331
255
256
  akshare/stock/stock_hot_search_baidu.py,sha256=nEPIgtwe0DmShUQxS6dJWG0UYlRS0zuSJTX_r8KsdEA,1762
256
257
  akshare/stock/stock_hot_up_em.py,sha256=sRwbpAHLzAylobUAIlVKuQo8vbuTA0Jt6gb1oiSgNwA,2509
@@ -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.41.dist-info/LICENSE,sha256=mmSZCPgfHiVw34LXuFArd-SUgQtBJ_QsIlh-kWlDHfs,1073
385
+ akshare-1.14.41.dist-info/METADATA,sha256=Eh8i32MKU0DfY_KhBP7tSKGfsAhSbQtyRuOcqfLZ-t4,13976
386
+ akshare-1.14.41.dist-info/WHEEL,sha256=Wyh-_nZ0DJYolHNn1_hMa4lM7uDedD_RGVwbmTjyItk,91
387
+ akshare-1.14.41.dist-info/top_level.txt,sha256=jsf9ZzZPmHaISTVumQPsAw7vv7Yv-PdEVW70SMEelQQ,14
388
+ akshare-1.14.41.dist-info/RECORD,,