akshare 1.16.63__py3-none-any.whl → 1.16.65__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.
Files changed (175) hide show
  1. akshare/__init__.py +4 -2
  2. akshare/air/cons.py +1 -0
  3. akshare/air/crypto.js +1 -1
  4. akshare/air/outcrypto.js +1 -1
  5. akshare/article/cons.py +1 -0
  6. akshare/article/epu_index.py +4 -3
  7. akshare/article/ff_factor.py +19 -8
  8. akshare/article/fred_md.py +4 -1
  9. akshare/article/risk_rv.py +3 -8
  10. akshare/bond/bond_cb_sina.py +1 -0
  11. akshare/bond/bond_cbond.py +19 -14
  12. akshare/bond/bond_em.py +34 -15
  13. akshare/bond/bond_summary.py +38 -37
  14. akshare/bond/bond_zh_cov.py +0 -6
  15. akshare/bond/cons.py +14 -11
  16. akshare/crypto/__init__.py +1 -1
  17. akshare/crypto/crypto_bitcoin_cme.py +7 -7
  18. akshare/crypto/crypto_hold.py +4 -1
  19. akshare/currency/currency.py +1 -0
  20. akshare/currency/currency_china_bank_sina.py +6 -3
  21. akshare/data/__init__.py +1 -1
  22. akshare/data/cninfo.js +1 -1
  23. akshare/economic/cons.py +10 -3
  24. akshare/economic/macro_australia.py +0 -7
  25. akshare/economic/macro_canada.py +92 -81
  26. akshare/economic/macro_china.py +0 -34
  27. akshare/economic/macro_china_hk.py +0 -1
  28. akshare/economic/macro_euro.py +103 -56
  29. akshare/economic/macro_germany.py +1 -1
  30. akshare/economic/macro_japan.py +0 -1
  31. akshare/economic/macro_other.py +1 -6
  32. akshare/economic/macro_swiss.py +2 -3
  33. akshare/economic/macro_uk.py +1 -1
  34. akshare/economic/macro_usa.py +0 -2
  35. akshare/energy/energy_carbon.py +0 -1
  36. akshare/energy/energy_oil_em.py +1 -2
  37. akshare/event/cons.py +1 -0
  38. akshare/forex/forex_em.py +0 -1
  39. akshare/fortune/fortune_bloomberg.py +6 -3
  40. akshare/fortune/fortune_forbes_500.py +3 -6
  41. akshare/fortune/fortune_hurun.py +2 -1
  42. akshare/fortune/fortune_xincaifu_500.py +17 -14
  43. akshare/fund/fund_announcement.py +1 -0
  44. akshare/fund/fund_aum_em.py +47 -35
  45. akshare/fund/fund_em.py +0 -7
  46. akshare/fund/fund_etf_em.py +0 -5
  47. akshare/fund/fund_fhsp_em.py +27 -20
  48. akshare/fund/fund_init_em.py +8 -5
  49. akshare/fund/fund_lof_em.py +0 -5
  50. akshare/fund/fund_manager.py +18 -7
  51. akshare/fund/fund_portfolio_em.py +0 -1
  52. akshare/fund/fund_position_lg.py +19 -8
  53. akshare/fund/fund_rank_em.py +0 -3
  54. akshare/fund/fund_rating.py +28 -9
  55. akshare/fund/fund_scale_em.py +24 -13
  56. akshare/futures/futures_comex_em.py +1 -0
  57. akshare/futures/futures_contract_detail.py +11 -8
  58. akshare/futures/futures_inventory_em.py +0 -2
  59. akshare/futures/futures_rule.py +5 -1
  60. akshare/futures/futures_settlement_price_sgx.py +21 -6
  61. akshare/futures/futures_stock_js.py +0 -1
  62. akshare/futures/receipt.py +279 -153
  63. akshare/futures/requests_fun.py +16 -3
  64. akshare/futures_derivative/cons.py +100 -103
  65. akshare/futures_derivative/futures_contract_info_cffex.py +53 -39
  66. akshare/futures_derivative/futures_contract_info_dce.py +16 -9
  67. akshare/futures_derivative/futures_contract_info_gfex.py +43 -31
  68. akshare/futures_derivative/futures_index_sina.py +25 -13
  69. akshare/fx/cons.py +12 -7
  70. akshare/fx/fx_quote.py +1 -0
  71. akshare/fx/fx_quote_baidu.py +2 -1
  72. akshare/hf/__init__.py +1 -1
  73. akshare/hf/hf_sp500.py +8 -7
  74. akshare/index/index_eri.py +1 -0
  75. akshare/index/index_global_em.py +0 -1
  76. akshare/index/index_kq_fz.py +17 -14
  77. akshare/index/index_kq_ss.py +1 -0
  78. akshare/index/index_stock_hk.py +0 -1
  79. akshare/index/index_stock_zh.py +0 -3
  80. akshare/index/index_sugar.py +18 -4
  81. akshare/index/index_zh_em.py +0 -15
  82. akshare/interest_rate/interbank_rate_em.py +0 -1
  83. akshare/movie/jm.js +0 -1
  84. akshare/news/__init__.py +1 -1
  85. akshare/news/news_stock.py +0 -1
  86. akshare/option/option_commodity_sina.py +22 -26
  87. akshare/option/option_daily_stats_sse_szse.py +0 -1
  88. akshare/option/option_em.py +0 -1
  89. akshare/option/option_lhb_em.py +0 -1
  90. akshare/option/option_risk_indicator_sse.py +0 -1
  91. akshare/other/__init__.py +1 -1
  92. akshare/pro/__init__.py +0 -1
  93. akshare/pro/client.py +6 -4
  94. akshare/pro/cons.py +3 -2
  95. akshare/pro/data_pro.py +6 -5
  96. akshare/qhkc/qhkc_api.py +63 -21
  97. akshare/qhkc_web/qhkc_fund.py +1 -0
  98. akshare/qhkc_web/qhkc_index.py +1 -0
  99. akshare/qhkc_web/qhkc_tool.py +55 -54
  100. akshare/rate/__init__.py +1 -1
  101. akshare/rate/repo_rate.py +36 -32
  102. akshare/reits/__init__.py +1 -1
  103. akshare/reits/reits_basic.py +139 -5
  104. akshare/sport/__init__.py +1 -1
  105. akshare/sport/sport_olympic.py +1 -0
  106. akshare/spot/__init__.py +1 -1
  107. akshare/stock/cons.py +19 -12
  108. akshare/stock/stock_board_concept_em.py +0 -6
  109. akshare/stock/stock_board_industry_em.py +0 -6
  110. akshare/stock/stock_dzjy_em.py +1 -1
  111. akshare/stock/stock_fund_em.py +0 -2
  112. akshare/stock/stock_fund_hold.py +1 -2
  113. akshare/stock/stock_gsrl_em.py +1 -0
  114. akshare/stock/stock_hk_famous.py +0 -1
  115. akshare/stock/stock_hk_fhpx_ths.py +2 -1
  116. akshare/stock/stock_hk_hot_rank_em.py +1 -0
  117. akshare/stock/stock_hold_control_em.py +0 -2
  118. akshare/stock/stock_hot_up_em.py +4 -1
  119. akshare/stock/stock_hsgt_em.py +0 -2
  120. akshare/stock/stock_industry.py +1 -0
  121. akshare/stock/stock_info.py +0 -2
  122. akshare/stock/stock_info_em.py +0 -1
  123. akshare/stock/stock_repurchase_em.py +7 -2
  124. akshare/stock/stock_share_hold.py +0 -1
  125. akshare/stock/stock_stop.py +0 -1
  126. akshare/stock/stock_summary.py +0 -2
  127. akshare/stock/stock_us_famous.py +0 -1
  128. akshare/stock/stock_us_js.py +3 -2
  129. akshare/stock/stock_us_pink.py +0 -1
  130. akshare/stock/stock_weibo_nlp.py +18 -20
  131. akshare/stock/stock_zh_a_special.py +0 -3
  132. akshare/stock/stock_zh_a_tick_tx.py +11 -3
  133. akshare/stock_a/stock_board_concept_name_em.py +0 -1
  134. akshare/stock_a/stock_zh_a_spot.py +0 -1
  135. akshare/stock_feature/cons.py +1 -0
  136. akshare/stock_feature/stock_account_em.py +0 -1
  137. akshare/stock_feature/stock_all_pb.py +2 -1
  138. akshare/stock_feature/stock_analyst_em.py +0 -3
  139. akshare/stock_feature/stock_buffett_index_lg.py +7 -6
  140. akshare/stock_feature/stock_classify_sina.py +3 -6
  141. akshare/stock_feature/stock_comment_em.py +0 -2
  142. akshare/stock_feature/stock_congestion_lg.py +2 -1
  143. akshare/stock_feature/stock_dxsyl_em.py +116 -71
  144. akshare/stock_feature/stock_gdzjc_em.py +16 -5
  145. akshare/stock_feature/stock_gxl_lg.py +3 -2
  146. akshare/stock_feature/stock_hist_em.py +0 -20
  147. akshare/stock_feature/stock_hist_tx.py +10 -8
  148. akshare/stock_feature/stock_hot_xq.py +4 -6
  149. akshare/stock_feature/stock_hsgt_em.py +0 -2
  150. akshare/stock_feature/stock_hsgt_exchange_rate.py +0 -2
  151. akshare/stock_feature/stock_hsgt_min_em.py +13 -16
  152. akshare/stock_feature/stock_inner_trade_xq.py +0 -1
  153. akshare/stock_feature/stock_lhb_em.py +0 -1
  154. akshare/stock_feature/stock_margin_em.py +0 -1
  155. akshare/stock_feature/stock_margin_sse.py +0 -2
  156. akshare/stock_feature/stock_pankou_em.py +0 -2
  157. akshare/stock_feature/stock_qsjy_em.py +13 -4
  158. akshare/stock_feature/stock_research_report_em.py +0 -1
  159. akshare/stock_feature/stock_yjyg_cninfo.py +4 -1
  160. akshare/stock_feature/stock_zh_vote_baidu.py +4 -1
  161. akshare/stock_feature/stock_ztb_em.py +0 -6
  162. akshare/stock_fundamental/__init__.py +1 -1
  163. akshare/stock_fundamental/stock_hold.py +26 -17
  164. akshare/stock_fundamental/stock_ipo_declare.py +1 -0
  165. akshare/stock_fundamental/stock_kcb_detail_sse.py +10 -10
  166. akshare/stock_fundamental/stock_kcb_sse.py +26 -25
  167. akshare/stock_fundamental/stock_profit_forecast_hk_etnet.py +64 -41
  168. akshare/stock_fundamental/stock_recommend.py +20 -4
  169. akshare/utils/demjson.py +2005 -1334
  170. akshare/utils/token_process.py +6 -5
  171. {akshare-1.16.63.dist-info → akshare-1.16.65.dist-info}/METADATA +3 -8
  172. {akshare-1.16.63.dist-info → akshare-1.16.65.dist-info}/RECORD +175 -175
  173. {akshare-1.16.63.dist-info → akshare-1.16.65.dist-info}/WHEEL +0 -0
  174. {akshare-1.16.63.dist-info → akshare-1.16.65.dist-info}/licenses/LICENSE +0 -0
  175. {akshare-1.16.63.dist-info → akshare-1.16.65.dist-info}/top_level.txt +0 -0
@@ -5,6 +5,7 @@ Date: 2023/4/10 16:05
5
5
  Desc: 乐咕乐股-股息率-A 股股息率
6
6
  https://legulegu.com/stockdata/guxilv
7
7
  """
8
+
8
9
  import pandas as pd
9
10
  import requests
10
11
 
@@ -32,7 +33,7 @@ def stock_a_gxl_lg(symbol: str = "上证A股") -> pd.DataFrame:
32
33
  r = requests.get(
33
34
  url,
34
35
  params=params,
35
- **get_cookie_csrf(url="https://legulegu.com/stockdata/guxilv")
36
+ **get_cookie_csrf(url="https://legulegu.com/stockdata/guxilv"),
36
37
  )
37
38
  data_json = r.json()
38
39
  temp_df = pd.DataFrame(data_json[symbol_map[symbol]])
@@ -63,7 +64,7 @@ def stock_hk_gxl_lg() -> pd.DataFrame:
63
64
  r = requests.get(
64
65
  url,
65
66
  params=params,
66
- **get_cookie_csrf(url="https://legulegu.com/stockdata/market/hk/dv/hsi")
67
+ **get_cookie_csrf(url="https://legulegu.com/stockdata/market/hk/dv/hsi"),
67
68
  )
68
69
  data_json = r.json()
69
70
  temp_df = pd.DataFrame(data_json)
@@ -32,7 +32,6 @@ def stock_zh_a_spot_em() -> pd.DataFrame:
32
32
  "fs": "m:0 t:6,m:0 t:80,m:1 t:2,m:1 t:23,m:0 t:81 s:2048",
33
33
  "fields": "f1,f2,f3,f4,f5,f6,f7,f8,f9,f10,f12,f13,f14,f15,f16,f17,f18,"
34
34
  "f20,f21,f23,f24,f25,f22,f11,f62,f128,f136,f115,f152",
35
- "_": "1623833739532",
36
35
  }
37
36
  temp_df = fetch_paginated_data(url, params)
38
37
  temp_df.columns = [
@@ -142,7 +141,6 @@ def stock_sh_a_spot_em() -> pd.DataFrame:
142
141
  "fs": "m:1 t:2,m:1 t:23",
143
142
  "fields": "f1,f2,f3,f4,f5,f6,f7,f8,f9,f10,f12,f13,f14,f15,f16,f17,f18,f20,f21,f23,"
144
143
  "f24,f25,f22,f11,f62,f128,f136,f115,f152",
145
- "_": "1623833739532",
146
144
  }
147
145
  temp_df = fetch_paginated_data(url, params)
148
146
  temp_df.columns = [
@@ -251,7 +249,6 @@ def stock_sz_a_spot_em() -> pd.DataFrame:
251
249
  "fs": "m:0 t:6,m:0 t:80",
252
250
  "fields": "f1,f2,f3,f4,f5,f6,f7,f8,f9,f10,f12,f13,f14,f15,f16,f17,f18,f20,f21,f23,f24,"
253
251
  "f25,f22,f11,f62,f128,f136,f115,f152",
254
- "_": "1623833739532",
255
252
  }
256
253
  temp_df = fetch_paginated_data(url, params)
257
254
  temp_df.columns = [
@@ -360,7 +357,6 @@ def stock_bj_a_spot_em() -> pd.DataFrame:
360
357
  "fs": "m:0 t:81 s:2048",
361
358
  "fields": "f1,f2,f3,f4,f5,f6,f7,f8,f9,f10,f12,f13,f14,f15,f16,f17,f18,f20,f21,f23,f24"
362
359
  ",f25,f22,f11,f62,f128,f136,f115,f152",
363
- "_": "1623833739532",
364
360
  }
365
361
  temp_df = fetch_paginated_data(url, params)
366
362
  temp_df.columns = [
@@ -470,7 +466,6 @@ def stock_new_a_spot_em() -> pd.DataFrame:
470
466
  "fs": "m:0 f:8,m:1 f:8",
471
467
  "fields": "f1,f2,f3,f4,f5,f6,f7,f8,f9,f10,f12,f13,f14,f15,f16,f17,f18,f20,f21,f23,f24,"
472
468
  "f25,f26,f22,f11,f62,f128,f136,f115,f152",
473
- "_": "1623833739532",
474
469
  }
475
470
  temp_df = fetch_paginated_data(url, params)
476
471
  temp_df.columns = [
@@ -584,7 +579,6 @@ def stock_cy_a_spot_em() -> pd.DataFrame:
584
579
  "fs": "m:0 t:80",
585
580
  "fields": "f1,f2,f3,f4,f5,f6,f7,f8,f9,f10,f12,f13,f14,f15,f16,f17,f18,f20,f21,"
586
581
  "f23,f24,f25,f22,f11,f62,f128,f136,f115,f152",
587
- "_": "1623833739532",
588
582
  }
589
583
  temp_df = fetch_paginated_data(url, params)
590
584
  temp_df.columns = [
@@ -694,7 +688,6 @@ def stock_kc_a_spot_em() -> pd.DataFrame:
694
688
  "fs": "m:1 t:23",
695
689
  "fields": "f1,f2,f3,f4,f5,f6,f7,f8,f9,f10,f12,f13,f14,f15,f16,f17,f18,f20,"
696
690
  "f21,f23,f24,f25,f22,f11,f62,f128,f136,f115,f152",
697
- "_": "1623833739532",
698
691
  }
699
692
  temp_df = fetch_paginated_data(url, params)
700
693
  temp_df.columns = [
@@ -803,7 +796,6 @@ def stock_zh_b_spot_em() -> pd.DataFrame:
803
796
  "fs": "m:0 t:7,m:1 t:3",
804
797
  "fields": "f1,f2,f3,f4,f5,f6,f7,f8,f9,f10,f12,f13,f14,f15,f16,f17,f18,f20"
805
798
  ",f21,f23,f24,f25,f22,f11,f62,f128,f136,f115,f152",
806
- "_": "1623833739532",
807
799
  }
808
800
  temp_df = fetch_paginated_data(url, params)
809
801
  temp_df.columns = [
@@ -931,7 +923,6 @@ def stock_zh_a_hist(
931
923
  "secid": f"{market_code}.{symbol}",
932
924
  "beg": start_date,
933
925
  "end": end_date,
934
- "_": "1623766962675",
935
926
  }
936
927
  r = requests.get(url, params=params, timeout=timeout)
937
928
  data_json = r.json()
@@ -1021,7 +1012,6 @@ def stock_zh_a_hist_min_em(
1021
1012
  "ndays": "5",
1022
1013
  "iscr": "0",
1023
1014
  "secid": f"{market_code}.{symbol}",
1024
- "_": "1623766962675",
1025
1015
  }
1026
1016
  r = requests.get(url, timeout=15, params=params)
1027
1017
  data_json = r.json()
@@ -1061,7 +1051,6 @@ def stock_zh_a_hist_min_em(
1061
1051
  "secid": f"{market_code}.{symbol}",
1062
1052
  "beg": "0",
1063
1053
  "end": "20500000",
1064
- "_": "1630930917857",
1065
1054
  }
1066
1055
  r = requests.get(url, timeout=15, params=params)
1067
1056
  data_json = r.json()
@@ -1140,7 +1129,6 @@ def stock_zh_a_hist_pre_min_em(
1140
1129
  "iscr": "1",
1141
1130
  "iscca": "0",
1142
1131
  "secid": f"{market_code}.{symbol}",
1143
- "_": "1623766962675",
1144
1132
  }
1145
1133
  r = requests.get(url, timeout=15, params=params)
1146
1134
  data_json = r.json()
@@ -1190,7 +1178,6 @@ def stock_hk_spot_em() -> pd.DataFrame:
1190
1178
  "fs": "m:128 t:3,m:128 t:4,m:128 t:1,m:128 t:2",
1191
1179
  "fields": "f1,f2,f3,f4,f5,f6,f7,f8,f9,f10,f12,f13,f14,f15,f16,f17,f18,f20,"
1192
1180
  "f21,f23,f24,f25,f22,f11,f62,f128,f136,f115,f152",
1193
- "_": "1624010056945",
1194
1181
  }
1195
1182
  temp_df = fetch_paginated_data(url, params)
1196
1183
  temp_df.columns = [
@@ -1276,7 +1263,6 @@ def stock_hk_main_board_spot_em() -> pd.DataFrame:
1276
1263
  "fs": "m:128 t:3",
1277
1264
  "fields": "f1,f2,f3,f4,f5,f6,f7,f8,f9,f10,f12,f13,f14,f15,f16,f17,f18,f20,"
1278
1265
  "f21,f23,f24,f25,f22,f11,f62,f128,f136,f115,f152",
1279
- "_": "1624010056945",
1280
1266
  }
1281
1267
  temp_df = fetch_paginated_data(url, params)
1282
1268
  temp_df.columns = [
@@ -1377,7 +1363,6 @@ def stock_hk_hist(
1377
1363
  "fqt": adjust_dict[adjust],
1378
1364
  "end": "20500000",
1379
1365
  "lmt": "1000000",
1380
- "_": "1623766962675",
1381
1366
  }
1382
1367
  r = requests.get(url, timeout=15, params=params)
1383
1368
  data_json = r.json()
@@ -1453,7 +1438,6 @@ def stock_hk_hist_min_em(
1453
1438
  "iscr": "0",
1454
1439
  "ndays": "5",
1455
1440
  "secid": f"116.{symbol}",
1456
- "_": "1623766962675",
1457
1441
  }
1458
1442
  r = requests.get(url, timeout=15, params=params)
1459
1443
  data_json = r.json()
@@ -1493,7 +1477,6 @@ def stock_hk_hist_min_em(
1493
1477
  "secid": f"116.{symbol}",
1494
1478
  "beg": "0",
1495
1479
  "end": "20500000",
1496
- "_": "1630930917857",
1497
1480
  }
1498
1481
  r = requests.get(url, timeout=15, params=params)
1499
1482
  data_json = r.json()
@@ -1565,7 +1548,6 @@ def stock_us_spot_em() -> pd.DataFrame:
1565
1548
  "fs": "m:105,m:106,m:107",
1566
1549
  "fields": "f1,f2,f3,f4,f5,f6,f7,f8,f9,f10,f12,f13,f14,f15,f16,f17,f18,f20,"
1567
1550
  "f21,f23,f24,f25,f26,f22,f33,f11,f62,f128,f136,f115,f152",
1568
- "_": "1624010056945",
1569
1551
  }
1570
1552
  temp_df = fetch_paginated_data(url, params)
1571
1553
  temp_df.columns = [
@@ -1676,7 +1658,6 @@ def stock_us_hist(
1676
1658
  "fqt": adjust_dict[adjust],
1677
1659
  "end": "20500000",
1678
1660
  "lmt": "1000000",
1679
- "_": "1623766962675",
1680
1661
  }
1681
1662
  r = requests.get(url, timeout=15, params=params)
1682
1663
  data_json = r.json()
@@ -1738,7 +1719,6 @@ def stock_us_hist_min_em(
1738
1719
  "iscr": "0",
1739
1720
  "ndays": "5",
1740
1721
  "secid": f"{symbol.split('.')[0]}.{symbol.split('.')[1]}",
1741
- "_": "1623766962675",
1742
1722
  }
1743
1723
  r = requests.get(url, params=params, timeout=15)
1744
1724
  data_json = r.json()
@@ -5,6 +5,7 @@ Date: 2023/7/25 15:30
5
5
  Desc: 腾讯证券-行情首页-沪深京A股
6
6
  https://quote.eastmoney.com/
7
7
  """
8
+
8
9
  import datetime
9
10
 
10
11
  import pandas as pd
@@ -16,11 +17,11 @@ from akshare.utils.tqdm import get_tqdm
16
17
 
17
18
 
18
19
  def stock_zh_a_hist_tx(
19
- symbol: str = "sz000001",
20
- start_date: str = "19000101",
21
- end_date: str = "20500101",
22
- adjust: str = "",
23
- timeout: float = None,
20
+ symbol: str = "sz000001",
21
+ start_date: str = "19000101",
22
+ end_date: str = "20500101",
23
+ adjust: str = "",
24
+ timeout: float = None,
24
25
  ) -> pd.DataFrame:
25
26
  """
26
27
  腾讯证券-日频-股票历史数据
@@ -57,7 +58,7 @@ def stock_zh_a_hist_tx(
57
58
  }
58
59
  r = requests.get(url, params=params, timeout=timeout)
59
60
  data_text = r.text
60
- data_json = demjson.decode(data_text[data_text.find("={") + 1:])["data"][
61
+ data_json = demjson.decode(data_text[data_text.find("={") + 1 :])["data"][
61
62
  symbol
62
63
  ]
63
64
  if "day" in data_json.keys():
@@ -83,6 +84,7 @@ def stock_zh_a_hist_tx(
83
84
 
84
85
 
85
86
  if __name__ == "__main__":
86
- stock_zh_a_hist_tx_df = stock_zh_a_hist_tx(symbol="sz000001", start_date="20200101", end_date="20231027",
87
- adjust="hfq")
87
+ stock_zh_a_hist_tx_df = stock_zh_a_hist_tx(
88
+ symbol="sz000001", start_date="20200101", end_date="20231027", adjust="hfq"
89
+ )
88
90
  print(stock_zh_a_hist_tx_df)
@@ -5,6 +5,7 @@ Date: 2024/1/7 17:00
5
5
  Desc: 雪球-沪深股市-热度排行榜
6
6
  https://xueqiu.com/hq
7
7
  """
8
+
8
9
  import math
9
10
 
10
11
  import pandas as pd
@@ -34,7 +35,6 @@ def stock_hot_follow_xq(symbol: str = "最热门") -> pd.DataFrame:
34
35
  "order_by": symbol_map[symbol],
35
36
  "only_count": "0",
36
37
  "page": "1",
37
- "_": "1651050034006",
38
38
  }
39
39
  headers = {
40
40
  "Accept": "*/*",
@@ -56,7 +56,7 @@ def stock_hot_follow_xq(symbol: str = "最热门") -> pd.DataFrame:
56
56
  }
57
57
  r = requests.get(url, params=params, headers=headers)
58
58
  data_json = r.json()
59
- total_num = data_json["data"]['count']
59
+ total_num = data_json["data"]["count"]
60
60
  total_page = math.ceil(total_num / 200)
61
61
  tqdm = get_tqdm()
62
62
  big_df = pd.DataFrame()
@@ -119,7 +119,6 @@ def stock_hot_tweet_xq(symbol: str = "最热门") -> pd.DataFrame:
119
119
  "order_by": symbol_map[symbol],
120
120
  "only_count": "0",
121
121
  "page": "1",
122
- "_": "1651050034006",
123
122
  }
124
123
  headers = {
125
124
  "Accept": "*/*",
@@ -141,7 +140,7 @@ def stock_hot_tweet_xq(symbol: str = "最热门") -> pd.DataFrame:
141
140
  }
142
141
  r = requests.get(url, params=params, headers=headers)
143
142
  data_json = r.json()
144
- total_num = data_json["data"]['count']
143
+ total_num = data_json["data"]["count"]
145
144
  total_page = math.ceil(total_num / 200)
146
145
  tqdm = get_tqdm()
147
146
  big_df = pd.DataFrame()
@@ -204,7 +203,6 @@ def stock_hot_deal_xq(symbol: str = "最热门") -> pd.DataFrame:
204
203
  "order_by": symbol_map[symbol],
205
204
  "only_count": "0",
206
205
  "page": "1",
207
- "_": "1651050034006",
208
206
  }
209
207
  headers = {
210
208
  "Accept": "*/*",
@@ -226,7 +224,7 @@ def stock_hot_deal_xq(symbol: str = "最热门") -> pd.DataFrame:
226
224
  }
227
225
  r = requests.get(url, params=params, headers=headers)
228
226
  data_json = r.json()
229
- total_num = data_json["data"]['count']
227
+ total_num = data_json["data"]["count"]
230
228
  total_page = math.ceil(total_num / 200)
231
229
  tqdm = get_tqdm()
232
230
  big_df = pd.DataFrame()
@@ -37,7 +37,6 @@ def stock_hsgt_fund_flow_summary_em() -> pd.DataFrame:
37
37
  "sortColumns": "MUTUAL_TYPE",
38
38
  "source": "WEB",
39
39
  "client": "WEB",
40
- "_": "1669047266881",
41
40
  }
42
41
  r = requests.get(url, params=params)
43
42
  data_json = r.json()
@@ -111,7 +110,6 @@ def stock_hk_ggt_components_em() -> pd.DataFrame:
111
110
  "fs": "b:DLMK0146,b:DLMK0144",
112
111
  "fields": "f1,f2,f3,f4,f5,f6,f7,f8,f9,f10,f12,f13,f14,f15,f16,f17,f18,f19,f20,f21,f23,f24,"
113
112
  "f25,f26,f22,f33,f11,f62,f128,f136,f115,f152",
114
- "_": "1639974456250",
115
113
  }
116
114
  temp_df = fetch_paginated_data(url=url, base_params=params)
117
115
  temp_df.columns = [
@@ -92,7 +92,6 @@ def stock_sgt_reference_exchange_rate_sse() -> pd.DataFrame:
92
92
  "pageHelp.pageNo": "1",
93
93
  "pageHelp.beginPage": "1",
94
94
  "pageHelp.endPage": "1",
95
- "_": "1664523262778",
96
95
  }
97
96
  headers = {
98
97
  "Host": "query.sse.com.cn",
@@ -151,7 +150,6 @@ def stock_sgt_settlement_exchange_rate_sse() -> pd.DataFrame:
151
150
  "pageHelp.pageNo": "1",
152
151
  "pageHelp.beginPage": "1",
153
152
  "pageHelp.endPage": "1",
154
- "_": "1664523262778",
155
153
  }
156
154
  headers = {
157
155
  "Host": "query.sse.com.cn",
@@ -5,6 +5,7 @@ Date: 2024/2/5 18:00
5
5
  Desc: 东方财富网-数据中心-沪深港通-市场概括
6
6
  https://data.eastmoney.com/hsgt/hsgtDetail/scgk.html
7
7
  """
8
+
8
9
  import pandas as pd
9
10
  import requests
10
11
 
@@ -20,37 +21,33 @@ def stock_hsgt_fund_min_em(symbol: str = "北向资金") -> pd.DataFrame:
20
21
  """
21
22
  url = "https://push2.eastmoney.com/api/qt/kamtbs.rtmin/get"
22
23
  params = {
23
- 'fields1': 'f1,f2,f3,f4',
24
- 'fields2': 'f51,f54,f52,f58,f53,f62,f56,f57,f60,f61',
25
- 'ut': 'b2884a393a59ad64002292a3e90d46a5',
26
- '_': '1707125786160'
24
+ "fields1": "f1,f2,f3,f4",
25
+ "fields2": "f51,f54,f52,f58,f53,f62,f56,f57,f60,f61",
26
+ "ut": "b2884a393a59ad64002292a3e90d46a5",
27
+ "_": "1707125786160",
27
28
  }
28
29
  r = requests.get(url, params=params)
29
30
  data_json = r.json()
30
31
 
31
32
  if symbol == "南向资金":
32
- n2s_str_list = data_json['data']['n2s']
33
+ n2s_str_list = data_json["data"]["n2s"]
33
34
  temp_df = pd.DataFrame([item.split(",") for item in n2s_str_list])
34
- temp_df['date'] = data_json['data']['n2sDate']
35
+ temp_df["date"] = data_json["data"]["n2sDate"]
35
36
  temp_df = temp_df.iloc[:, [0, 1, 3, 5, -1]]
36
- temp_df.columns = ['时间', "港股通(沪)", "港股通(深)", "南向资金", "日期"]
37
- temp_df = temp_df[[
38
- "日期", '时间', "港股通(沪)", "港股通(深)", "南向资金"
39
- ]]
37
+ temp_df.columns = ["时间", "港股通(沪)", "港股通(深)", "南向资金", "日期"]
38
+ temp_df = temp_df[["日期", "时间", "港股通(沪)", "港股通(深)", "南向资金"]]
40
39
  temp_df["日期"] = pd.to_datetime(temp_df["日期"], errors="coerce").dt.date
41
40
  temp_df["港股通(沪)"] = pd.to_numeric(temp_df["港股通(沪)"], errors="coerce")
42
41
  temp_df["港股通(深)"] = pd.to_numeric(temp_df["港股通(深)"], errors="coerce")
43
42
  temp_df["南向资金"] = pd.to_numeric(temp_df["南向资金"], errors="coerce")
44
43
  return temp_df
45
44
  else:
46
- s2n_str_list = data_json['data']['s2n']
45
+ s2n_str_list = data_json["data"]["s2n"]
47
46
  temp_df = pd.DataFrame([item.split(",") for item in s2n_str_list])
48
- temp_df['date'] = data_json['data']['s2nDate']
47
+ temp_df["date"] = data_json["data"]["s2nDate"]
49
48
  temp_df = temp_df.iloc[:, [0, 1, 3, 5, -1]]
50
- temp_df.columns = ['时间', "沪股通", "深股通", "北向资金", "日期"]
51
- temp_df = temp_df[[
52
- "日期", '时间', "沪股通", "深股通", "北向资金"
53
- ]]
49
+ temp_df.columns = ["时间", "沪股通", "深股通", "北向资金", "日期"]
50
+ temp_df = temp_df[["日期", "时间", "沪股通", "深股通", "北向资金"]]
54
51
  temp_df["日期"] = pd.to_datetime(temp_df["日期"], errors="coerce").dt.date
55
52
  temp_df["沪股通"] = pd.to_numeric(temp_df["沪股通"], errors="coerce")
56
53
  temp_df["深股通"] = pd.to_numeric(temp_df["深股通"], errors="coerce")
@@ -22,7 +22,6 @@ def stock_inner_trade_xq() -> pd.DataFrame:
22
22
  "size": "100000",
23
23
  "page": "1",
24
24
  "extend": "true",
25
- "_": "1651223013040",
26
25
  }
27
26
  headers = {
28
27
  "Accept": "*/*",
@@ -796,7 +796,6 @@ def stock_lhb_stock_detail_em(
796
796
  "sortColumns": flag_map[flag],
797
797
  "source": "WEB",
798
798
  "client": "WEB",
799
- "_": "1647338693644",
800
799
  }
801
800
  r = requests.get(url, params=params)
802
801
  data_json = r.json()
@@ -33,7 +33,6 @@ def stock_margin_account_info() -> pd.DataFrame:
33
33
  "p": "1",
34
34
  "pageNo": "1",
35
35
  "pageNum": "1",
36
- "_": "1718357149317",
37
36
  }
38
37
  r = requests.get(url=url, params=params)
39
38
  data_json = r.json()
@@ -83,7 +83,6 @@ def stock_margin_sse(
83
83
  "pageHelp.beginPage": "1",
84
84
  "pageHelp.cacheSize": "1",
85
85
  "pageHelp.endPage": "5",
86
- "_": "1612773448860",
87
86
  }
88
87
  headers = {
89
88
  "Referer": "https://www.sse.com.cn/",
@@ -151,7 +150,6 @@ def stock_margin_detail_sse(date: str = "20230922") -> pd.DataFrame:
151
150
  "pageHelp.beginPage": "1",
152
151
  "pageHelp.cacheSize": "1",
153
152
  "pageHelp.endPage": "21",
154
- "_": "1612773448860",
155
153
  }
156
154
  headers = {
157
155
  "Referer": "https://www.sse.com.cn/",
@@ -53,7 +53,6 @@ def stock_changes_em(symbol: str = "大笔买入") -> pd.DataFrame:
53
53
  "pagesize": "5000",
54
54
  "ut": "7eea3edcaed734bea9cbfc24409ed989",
55
55
  "dpt": "wzchanges",
56
- "_": "1624005264245",
57
56
  }
58
57
  r = requests.get(url, params=params)
59
58
  data_json = r.json()
@@ -94,7 +93,6 @@ def stock_board_change_em() -> pd.DataFrame:
94
93
  "dpt": "wzchanges",
95
94
  "pageindex": "0",
96
95
  "pagesize": "5000",
97
- "_": "1671978840598",
98
96
  }
99
97
  r = requests.get(url, params=params)
100
98
  data_json = r.json()
@@ -5,6 +5,7 @@ Date: 2022/9/21 16:49
5
5
  Desc: 东方财富网-数据中心-特色数据-券商业绩月报
6
6
  http://data.eastmoney.com/other/qsjy.html
7
7
  """
8
+
8
9
  import pandas as pd
9
10
  import requests
10
11
 
@@ -71,13 +72,21 @@ def stock_qsjy_em(date: str = "20200731") -> pd.DataFrame:
71
72
  temp_df["当月净利润-净利润"] = pd.to_numeric(temp_df["当月净利润-净利润"])
72
73
  temp_df["当月净利润-同比增长"] = pd.to_numeric(temp_df["当月净利润-同比增长"])
73
74
  temp_df["当月净利润-环比增长"] = pd.to_numeric(temp_df["当月净利润-环比增长"])
74
- temp_df["当年累计净利润-累计净利润"] = pd.to_numeric(temp_df["当年累计净利润-累计净利润"])
75
- temp_df["当年累计净利润-同比增长"] = pd.to_numeric(temp_df["当年累计净利润-同比增长"])
75
+ temp_df["当年累计净利润-累计净利润"] = pd.to_numeric(
76
+ temp_df["当年累计净利润-累计净利润"]
77
+ )
78
+ temp_df["当年累计净利润-同比增长"] = pd.to_numeric(
79
+ temp_df["当年累计净利润-同比增长"]
80
+ )
76
81
  temp_df["当月营业收入-营业收入"] = pd.to_numeric(temp_df["当月营业收入-营业收入"])
77
82
  temp_df["当月营业收入-环比增长"] = pd.to_numeric(temp_df["当月营业收入-环比增长"])
78
83
  temp_df["当月营业收入-同比增长"] = pd.to_numeric(temp_df["当月营业收入-同比增长"])
79
- temp_df["当年累计营业收入-累计营业收入"] = pd.to_numeric(temp_df["当年累计营业收入-累计营业收入"])
80
- temp_df["当年累计营业收入-同比增长"] = pd.to_numeric(temp_df["当年累计营业收入-同比增长"])
84
+ temp_df["当年累计营业收入-累计营业收入"] = pd.to_numeric(
85
+ temp_df["当年累计营业收入-累计营业收入"]
86
+ )
87
+ temp_df["当年累计营业收入-同比增长"] = pd.to_numeric(
88
+ temp_df["当年累计营业收入-同比增长"]
89
+ )
81
90
  temp_df["净资产-净资产"] = pd.to_numeric(temp_df["净资产-净资产"])
82
91
  temp_df["净资产-同比增长"] = pd.to_numeric(temp_df["净资产-同比增长"])
83
92
  return temp_df
@@ -38,7 +38,6 @@ def stock_research_report_em(symbol: str = "000001") -> pd.DataFrame:
38
38
  "p": "1",
39
39
  "pageNum": "1",
40
40
  "pageNumber": "1",
41
- "_": "1692533168153",
42
41
  }
43
42
  r = requests.get(url, params=params)
44
43
  data_json = r.json()
@@ -5,6 +5,7 @@ Date: 2023/6/8 16:34
5
5
  Desc: 巨潮资讯-首页-数据-预约披露
6
6
  http://www.cninfo.com.cn/new/commonUrl?url=data/yypl
7
7
  """
8
+
8
9
  import pandas as pd
9
10
  import requests
10
11
 
@@ -86,5 +87,7 @@ def stock_report_disclosure(
86
87
 
87
88
 
88
89
  if __name__ == "__main__":
89
- stock_report_disclosure_df = stock_report_disclosure(market="沪深京", period="2022年报")
90
+ stock_report_disclosure_df = stock_report_disclosure(
91
+ market="沪深京", period="2022年报"
92
+ )
90
93
  print(stock_report_disclosure_df)
@@ -5,11 +5,14 @@ Date: 2022/10/10 17:26
5
5
  Desc: 百度股市通- A 股或指数-股评-投票
6
6
  https://gushitong.baidu.com/index/ab-000001
7
7
  """
8
+
8
9
  import requests
9
10
  import pandas as pd
10
11
 
11
12
 
12
- def stock_zh_vote_baidu(symbol: str = "000001", indicator: str = "指数") -> pd.DataFrame:
13
+ def stock_zh_vote_baidu(
14
+ symbol: str = "000001", indicator: str = "指数"
15
+ ) -> pd.DataFrame:
13
16
  """
14
17
  百度股市通- A 股或指数-股评-投票
15
18
  https://gushitong.baidu.com/index/ab-000001
@@ -38,7 +38,6 @@ def stock_zt_pool_em(date: str = "20241008") -> pd.DataFrame:
38
38
  "pagesize": "10000",
39
39
  "sort": "fbt:asc",
40
40
  "date": date,
41
- "_": "1621590489736",
42
41
  }
43
42
  r = requests.get(url, params=params)
44
43
  data_json = r.json()
@@ -125,7 +124,6 @@ def stock_zt_pool_previous_em(date: str = "20240415") -> pd.DataFrame:
125
124
  "pagesize": "5000",
126
125
  "sort": "zs:desc",
127
126
  "date": date,
128
- "_": "1621590489736",
129
127
  }
130
128
  r = requests.get(url, params=params)
131
129
  data_json = r.json()
@@ -203,7 +201,6 @@ def stock_zt_pool_strong_em(date: str = "20241231") -> pd.DataFrame:
203
201
  "pagesize": "5000",
204
202
  "sort": "zdp:desc",
205
203
  "date": date,
206
- "_": "1621590489736",
207
204
  }
208
205
  r = requests.get(url, params=params)
209
206
  data_json = r.json()
@@ -293,7 +290,6 @@ def stock_zt_pool_sub_new_em(date: str = "20241231") -> pd.DataFrame:
293
290
  "pagesize": "5000",
294
291
  "sort": "ods:asc",
295
292
  "date": date,
296
- "_": "1621590489736",
297
293
  }
298
294
  r = requests.get(url, params=params)
299
295
  data_json = r.json()
@@ -380,7 +376,6 @@ def stock_zt_pool_zbgc_em(date: str = "20241011") -> pd.DataFrame:
380
376
  "pagesize": "5000",
381
377
  "sort": "fbt:asc",
382
378
  "date": date,
383
- "_": "1621590489736",
384
379
  }
385
380
  r = requests.get(url, params=params)
386
381
  data_json = r.json()
@@ -463,7 +458,6 @@ def stock_zt_pool_dtgc_em(date: str = "20241011") -> pd.DataFrame:
463
458
  "pagesize": "10000",
464
459
  "sort": "fund:asc",
465
460
  "date": date,
466
- "_": "1621590489736",
467
461
  }
468
462
  r = requests.get(url, params=params)
469
463
  data_json = r.json()
@@ -2,5 +2,5 @@
2
2
  # -*- coding:utf-8 -*-
3
3
  """
4
4
  Date: 2020/5/14 15:34
5
- Desc:
5
+ Desc:
6
6
  """
@@ -5,6 +5,7 @@ Date: 2024/2/21 11:00
5
5
  Desc: 新浪财经-股票-机构持股
6
6
  https://vip.stock.finance.sina.com.cn/q/go.php/vComStockHold/kind/jgcg/index.phtml
7
7
  """
8
+
8
9
  from io import StringIO
9
10
 
10
11
  import pandas as pd
@@ -43,17 +44,19 @@ def stock_institute_hold(symbol: str = "20051") -> pd.DataFrame:
43
44
  "占流通股比例",
44
45
  "占流通股比例增幅",
45
46
  ]
46
- temp_df['机构数'] = pd.to_numeric(temp_df['机构数'], errors="coerce")
47
- temp_df['机构数变化'] = pd.to_numeric(temp_df['机构数变化'], errors="coerce")
48
- temp_df['持股比例'] = pd.to_numeric(temp_df['持股比例'], errors="coerce")
49
- temp_df['持股比例增幅'] = pd.to_numeric(temp_df['持股比例增幅'], errors="coerce")
50
- temp_df['占流通股比例'] = pd.to_numeric(temp_df['占流通股比例'], errors="coerce")
51
- temp_df['占流通股比例增幅'] = pd.to_numeric(temp_df['占流通股比例增幅'], errors="coerce")
47
+ temp_df["机构数"] = pd.to_numeric(temp_df["机构数"], errors="coerce")
48
+ temp_df["机构数变化"] = pd.to_numeric(temp_df["机构数变化"], errors="coerce")
49
+ temp_df["持股比例"] = pd.to_numeric(temp_df["持股比例"], errors="coerce")
50
+ temp_df["持股比例增幅"] = pd.to_numeric(temp_df["持股比例增幅"], errors="coerce")
51
+ temp_df["占流通股比例"] = pd.to_numeric(temp_df["占流通股比例"], errors="coerce")
52
+ temp_df["占流通股比例增幅"] = pd.to_numeric(
53
+ temp_df["占流通股比例增幅"], errors="coerce"
54
+ )
52
55
  return temp_df
53
56
 
54
57
 
55
58
  def stock_institute_hold_detail(
56
- stock: str = "600433", quarter: str = "20201"
59
+ stock: str = "600433", quarter: str = "20201"
57
60
  ) -> pd.DataFrame:
58
61
  """
59
62
  新浪财经-股票-机构持股详情
@@ -72,7 +75,7 @@ def stock_institute_hold_detail(
72
75
  }
73
76
  r = requests.get(url, params=params)
74
77
  text_data = r.text
75
- json_data = demjson.decode(text_data[text_data.find("{"): -2])
78
+ json_data = demjson.decode(text_data[text_data.find("{") : -2])
76
79
  big_df = pd.DataFrame()
77
80
  for item in json_data["data"].keys():
78
81
  inner_temp_df = pd.DataFrame(json_data["data"][item]).T.iloc[:-1, :]
@@ -97,18 +100,24 @@ def stock_institute_hold_detail(
97
100
  "占流通股比例增幅",
98
101
  ]
99
102
  big_df["持股机构类型"] = big_df["持股机构类型"].str.replace("fund", "基金")
100
- big_df["持股机构类型"] = big_df["持股机构类型"].str.replace("socialSecurity", "全国社保")
103
+ big_df["持股机构类型"] = big_df["持股机构类型"].str.replace(
104
+ "socialSecurity", "全国社保"
105
+ )
101
106
  big_df["持股机构类型"] = big_df["持股机构类型"].str.replace("qfii", "QFII")
102
107
  big_df["持股机构类型"] = big_df["持股机构类型"].str.replace("insurance", "保险")
103
108
 
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")
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
+ big_df["占流通股比例"] = pd.to_numeric(big_df["占流通股比例"], errors="coerce")
114
+ big_df["最新占流通股比例"] = pd.to_numeric(
115
+ big_df["最新占流通股比例"], errors="coerce"
116
+ )
117
+ big_df["持股比例增幅"] = pd.to_numeric(big_df["持股比例增幅"], errors="coerce")
118
+ big_df["占流通股比例增幅"] = pd.to_numeric(
119
+ big_df["占流通股比例增幅"], errors="coerce"
120
+ )
112
121
  return big_df
113
122
  else:
114
123
  return pd.DataFrame()