akshare 1.12.99__py3-none-any.whl → 1.15.73__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.

Files changed (236) hide show
  1. akshare/__init__.py +442 -138
  2. akshare/air/air_hebei.py +79 -53
  3. akshare/air/air_zhenqi.py +29 -43
  4. akshare/air/sunrise_tad.py +32 -17
  5. akshare/bank/bank_cbirc_2020.py +12 -9
  6. akshare/bond/bond_cb_ths.py +17 -9
  7. akshare/bond/bond_china.py +38 -39
  8. akshare/bond/bond_china_money.py +75 -48
  9. akshare/bond/bond_info_cm.py +28 -8
  10. akshare/bond/bond_issue_cninfo.py +73 -30
  11. akshare/bond/bond_zh_cov.py +1 -1
  12. akshare/bond/bond_zh_sina.py +57 -51
  13. akshare/cal/__init__.py +0 -0
  14. akshare/cal/rv.py +170 -0
  15. akshare/cost/cost_living.py +7 -5
  16. akshare/currency/currency_safe.py +7 -6
  17. akshare/data/cninfo.js +15 -0
  18. akshare/datasets.py +10 -21
  19. akshare/economic/macro_bank.py +95 -653
  20. akshare/economic/macro_china.py +772 -1024
  21. akshare/economic/macro_china_hk.py +65 -243
  22. akshare/economic/macro_china_nbs.py +24 -7
  23. akshare/economic/macro_constitute.py +17 -12
  24. akshare/economic/macro_euro.py +13 -6
  25. akshare/economic/macro_finance_ths.py +133 -0
  26. akshare/economic/macro_info_ws.py +100 -0
  27. akshare/economic/macro_japan.py +5 -4
  28. akshare/economic/macro_other.py +12 -9
  29. akshare/economic/macro_usa.py +376 -1940
  30. akshare/economic/marco_cnbs.py +11 -6
  31. akshare/energy/energy_carbon.py +94 -125
  32. akshare/event/migration.py +3 -2
  33. akshare/exceptions.py +43 -0
  34. akshare/file_fold/calendar.json +245 -2
  35. akshare/fortune/fortune_500.py +15 -48
  36. akshare/fund/fund_amac.py +157 -75
  37. akshare/fund/fund_em.py +191 -184
  38. akshare/fund/fund_etf_em.py +16 -15
  39. akshare/fund/fund_etf_sina.py +71 -23
  40. akshare/fund/fund_etf_ths.py +93 -0
  41. akshare/fund/fund_fee_em.py +98 -0
  42. akshare/fund/fund_portfolio_em.py +60 -50
  43. akshare/fund/fund_rank_em.py +91 -82
  44. akshare/fund/fund_report_cninfo.py +63 -48
  45. akshare/fund/fund_scale_sina.py +20 -10
  46. akshare/fund/fund_xq.py +139 -109
  47. akshare/futures/cons.py +8 -31
  48. akshare/futures/cot.py +185 -137
  49. akshare/futures/futures_basis.py +97 -32
  50. akshare/futures/futures_comm_ctp.py +37 -0
  51. akshare/futures/futures_comm_qihuo.py +74 -45
  52. akshare/futures/futures_daily_bar.py +121 -184
  53. akshare/futures/futures_hf_em.py +66 -61
  54. akshare/futures/futures_hq_sina.py +79 -61
  55. akshare/futures/futures_index_ccidx.py +6 -3
  56. akshare/futures/futures_inventory_99.py +61 -272
  57. akshare/futures/futures_news_shmet.py +4 -2
  58. akshare/futures/futures_roll_yield.py +12 -25
  59. akshare/futures/futures_spot_stock_em.py +19 -13
  60. akshare/futures/futures_stock_js.py +14 -12
  61. akshare/futures/futures_to_spot.py +38 -33
  62. akshare/futures/futures_warehouse_receipt.py +75 -71
  63. akshare/futures/futures_zh_sina.py +5 -5
  64. akshare/futures/symbol_var.py +18 -13
  65. akshare/futures_derivative/futures_contract_info_czce.py +60 -52
  66. akshare/futures_derivative/futures_contract_info_ine.py +43 -34
  67. akshare/futures_derivative/futures_contract_info_shfe.py +46 -35
  68. akshare/futures_derivative/futures_cot_sina.py +26 -19
  69. akshare/futures_derivative/futures_spot_sys.py +21 -8
  70. akshare/fx/currency_investing.py +19 -285
  71. akshare/index/index_cflp.py +29 -26
  72. akshare/index/index_cni.py +86 -88
  73. akshare/index/index_cons.py +26 -10
  74. akshare/index/index_cx.py +248 -47
  75. akshare/index/index_drewry.py +17 -16
  76. akshare/index/index_option_qvix.py +329 -0
  77. akshare/index/index_research_fund_sw.py +134 -0
  78. akshare/index/{index_sw_research.py → index_research_sw.py} +122 -58
  79. akshare/index/index_spot.py +9 -5
  80. akshare/index/index_stock_hk.py +35 -16
  81. akshare/index/index_stock_us_sina.py +1 -1
  82. akshare/index/index_stock_zh.py +180 -89
  83. akshare/index/index_stock_zh_csindex.py +15 -369
  84. akshare/index/index_sw.py +62 -34
  85. akshare/index/index_yw.py +46 -23
  86. akshare/index/index_zh_a_scope.py +48 -0
  87. akshare/index/index_zh_em.py +6 -4
  88. akshare/interest_rate/interbank_rate_em.py +14 -9
  89. akshare/movie/artist_yien.py +32 -5
  90. akshare/movie/movie_yien.py +92 -18
  91. akshare/movie/video_yien.py +28 -5
  92. akshare/news/news_baidu.py +78 -44
  93. akshare/news/news_cctv.py +38 -38
  94. akshare/news/news_stock.py +6 -3
  95. akshare/nlp/nlp_interface.py +7 -8
  96. akshare/option/cons.py +11 -11
  97. akshare/option/option_comm_qihuo.py +86 -0
  98. akshare/option/option_commodity.py +178 -51
  99. akshare/option/option_daily_stats_sse_szse.py +146 -0
  100. akshare/option/option_em.py +147 -138
  101. akshare/option/option_finance_sina.py +160 -137
  102. akshare/option/option_lhb_em.py +62 -56
  103. akshare/option/option_risk_indicator_sse.py +17 -14
  104. akshare/other/other_car_cpca.py +934 -0
  105. akshare/other/{other_car.py → other_car_gasgoo.py} +15 -54
  106. akshare/qdii/__init__.py +0 -0
  107. akshare/qdii/qdii_jsl.py +233 -0
  108. akshare/request.py +117 -0
  109. akshare/spot/spot_hog_soozhu.py +232 -0
  110. akshare/spot/spot_price_qh.py +121 -0
  111. akshare/spot/spot_sge.py +63 -10
  112. akshare/stock/stock_allotment_cninfo.py +10 -9
  113. akshare/stock/stock_board_concept_em.py +23 -14
  114. akshare/stock/stock_board_industry_em.py +40 -34
  115. akshare/stock/stock_cg_equity_mortgage.py +15 -11
  116. akshare/stock/stock_cg_guarantee.py +41 -51
  117. akshare/stock/stock_cg_lawsuit.py +36 -35
  118. akshare/stock/stock_dividend_cninfo.py +12 -6
  119. akshare/stock/stock_dzjy_em.py +347 -260
  120. akshare/stock/stock_fund_em.py +332 -84
  121. akshare/stock/stock_hk_famous.py +108 -0
  122. akshare/stock/stock_hk_sina.py +8 -7
  123. akshare/stock/stock_hold_control_cninfo.py +100 -15
  124. akshare/stock/stock_hold_control_em.py +4 -3
  125. akshare/stock/stock_hold_num_cninfo.py +18 -12
  126. akshare/stock/stock_hot_rank_em.py +2 -1
  127. akshare/stock/stock_hot_search_baidu.py +5 -2
  128. akshare/stock/stock_industry_cninfo.py +24 -18
  129. akshare/stock/stock_industry_pe_cninfo.py +45 -31
  130. akshare/stock/stock_industry_sw.py +9 -10
  131. akshare/stock/stock_info.py +25 -15
  132. akshare/stock/stock_info_em.py +5 -2
  133. akshare/stock/stock_intraday_em.py +5 -2
  134. akshare/stock/stock_intraday_sina.py +22 -18
  135. akshare/stock/stock_ipo_summary_cninfo.py +25 -10
  136. akshare/stock/stock_new_cninfo.py +32 -19
  137. akshare/stock/stock_news_cx.py +39 -0
  138. akshare/stock/stock_profile_cninfo.py +9 -8
  139. akshare/stock/stock_rank_forecast.py +8 -6
  140. akshare/stock/stock_share_changes_cninfo.py +18 -14
  141. akshare/stock/stock_share_hold.py +24 -19
  142. akshare/stock/stock_summary.py +54 -26
  143. akshare/stock/stock_us_famous.py +15 -6
  144. akshare/stock/stock_us_pink.py +7 -5
  145. akshare/stock/stock_us_sina.py +15 -12
  146. akshare/stock/stock_xq.py +38 -12
  147. akshare/stock/stock_zh_a_sina.py +53 -78
  148. akshare/stock/stock_zh_b_sina.py +32 -55
  149. akshare/stock/stock_zh_kcb_report.py +11 -9
  150. akshare/stock/stock_zh_kcb_sina.py +67 -64
  151. akshare/stock_feature/stock_a_below_net_asset_statistics.py +5 -2
  152. akshare/stock_feature/stock_a_high_low.py +5 -2
  153. akshare/stock_feature/stock_a_indicator.py +12 -9
  154. akshare/stock_feature/stock_a_pe_and_pb.py +27 -6
  155. akshare/stock_feature/stock_account_em.py +58 -40
  156. akshare/stock_feature/stock_analyst_em.py +36 -27
  157. akshare/stock_feature/stock_board_industry_ths.py +136 -400
  158. akshare/stock_feature/stock_comment_em.py +118 -85
  159. akshare/stock_feature/stock_concept_futu.py +183 -0
  160. akshare/stock_feature/stock_cyq_em.py +58 -54
  161. akshare/stock_feature/stock_disclosure_cninfo.py +147 -102
  162. akshare/stock_feature/stock_esg_sina.py +216 -11
  163. akshare/stock_feature/stock_fhps_em.py +60 -25
  164. akshare/stock_feature/stock_fhps_ths.py +25 -6
  165. akshare/stock_feature/stock_fund_flow.py +38 -25
  166. akshare/stock_feature/stock_gdfx_em.py +180 -95
  167. akshare/stock_feature/stock_gdhs.py +73 -49
  168. akshare/stock_feature/stock_gpzy_em.py +78 -46
  169. akshare/stock_feature/stock_hist_em.py +55 -23
  170. akshare/stock_feature/stock_hk_valuation_baidu.py +20 -8
  171. akshare/stock_feature/stock_hsgt_em.py +184 -452
  172. akshare/stock_feature/stock_info.py +52 -29
  173. akshare/stock_feature/stock_inner_trade_xq.py +39 -31
  174. akshare/stock_feature/stock_irm_cninfo.py +32 -9
  175. akshare/stock_feature/stock_jgdy_em.py +41 -38
  176. akshare/stock_feature/stock_lh_yybpm.py +36 -37
  177. akshare/stock_feature/stock_lhb_em.py +135 -71
  178. akshare/stock_feature/stock_lhb_sina.py +93 -46
  179. akshare/stock_feature/stock_margin_em.py +102 -0
  180. akshare/stock_feature/{stock_sse_margin.py → stock_margin_sse.py} +21 -15
  181. akshare/stock_feature/{stock_szse_margin.py → stock_margin_szse.py} +23 -19
  182. akshare/stock_feature/stock_market_legu.py +13 -8
  183. akshare/stock_feature/stock_pankou_em.py +72 -34
  184. akshare/stock_feature/stock_report_em.py +244 -54
  185. akshare/stock_feature/stock_research_report_em.py +48 -19
  186. akshare/stock_feature/stock_sns_sseinfo.py +15 -12
  187. akshare/stock_feature/stock_sy_em.py +86 -33
  188. akshare/stock_feature/stock_technology_ths.py +152 -120
  189. akshare/stock_feature/stock_tfp_em.py +35 -13
  190. akshare/stock_feature/stock_three_report_em.py +119 -77
  191. akshare/stock_feature/stock_ttm_lyr.py +4 -7
  192. akshare/stock_feature/stock_value_em.py +83 -0
  193. akshare/stock_feature/stock_wencai.py +21 -9
  194. akshare/stock_feature/stock_yjyg_em.py +63 -28
  195. akshare/stock_feature/stock_zf_pg.py +61 -38
  196. akshare/stock_feature/stock_zh_valuation_baidu.py +3 -2
  197. akshare/stock_feature/stock_ztb_em.py +62 -40
  198. akshare/stock_fundamental/stock_finance.py +150 -58
  199. akshare/stock_fundamental/stock_finance_ths.py +116 -31
  200. akshare/stock_fundamental/stock_mda_ym.py +5 -3
  201. akshare/stock_fundamental/stock_notice.py +29 -15
  202. akshare/stock_fundamental/stock_profit_forecast_em.py +31 -13
  203. akshare/stock_fundamental/stock_profit_forecast_ths.py +19 -10
  204. akshare/stock_fundamental/stock_register_em.py +448 -0
  205. akshare/stock_fundamental/stock_restricted_em.py +79 -32
  206. akshare/stock_fundamental/stock_zygc.py +10 -8
  207. akshare/stock_fundamental/stock_zyjs_ths.py +5 -3
  208. akshare/tool/trade_date_hist.py +4 -3
  209. akshare/utils/cons.py +10 -0
  210. akshare/utils/context.py +43 -0
  211. akshare/utils/demjson.py +2 -2
  212. akshare/utils/func.py +26 -0
  213. akshare/utils/tqdm.py +13 -3
  214. {akshare-1.12.99.dist-info → akshare-1.15.73.dist-info}/METADATA +52 -69
  215. akshare-1.15.73.dist-info/RECORD +385 -0
  216. {akshare-1.12.99.dist-info → akshare-1.15.73.dist-info}/WHEEL +1 -1
  217. tests/test_func.py +3 -5
  218. akshare/bond/bond_futures.py +0 -50
  219. akshare/bond/bond_investing.py +0 -139
  220. akshare/crypto/crypto_hist_investing.py +0 -249
  221. akshare/fortune/fortune_it_juzi.py +0 -123
  222. akshare/futures/futures_international.py +0 -170
  223. akshare/futures/futures_news_baidu.py +0 -54
  224. akshare/futures/inventory_data.py +0 -100
  225. akshare/futures_derivative/futures_index_price_nh.py +0 -61
  226. akshare/futures_derivative/futures_index_return_nh.py +0 -47
  227. akshare/futures_derivative/futures_index_volatility_nh.py +0 -51
  228. akshare/futures_derivative/futures_other_index_nh.py +0 -145
  229. akshare/index/index_fear_greed_funddb.py +0 -71
  230. akshare/index/index_investing.py +0 -232
  231. akshare/sport/sport_olympic_winter.py +0 -39
  232. akshare/stock_feature/stock_board_concept_ths.py +0 -422
  233. akshare/stock_fundamental/stock_register.py +0 -292
  234. akshare-1.12.99.dist-info/RECORD +0 -374
  235. {akshare-1.12.99.dist-info → akshare-1.15.73.dist-info}/LICENSE +0 -0
  236. {akshare-1.12.99.dist-info → akshare-1.15.73.dist-info}/top_level.txt +0 -0
@@ -1,10 +1,11 @@
1
1
  #!/usr/bin/env python
2
2
  # -*- coding:utf-8 -*-
3
3
  """
4
- Date: 2024/3/7 22:30
4
+ Date: 2024/3/25 12:30
5
5
  Desc: 东方财富网-数据中心-资金流向
6
6
  https://data.eastmoney.com/zjlx/detail.html
7
7
  """
8
+
8
9
  import json
9
10
  import time
10
11
  from functools import lru_cache
@@ -14,7 +15,7 @@ import requests
14
15
 
15
16
 
16
17
  def stock_individual_fund_flow(
17
- stock: str = "600094", market: str = "sh"
18
+ stock: str = "600094", market: str = "sh"
18
19
  ) -> pd.DataFrame:
19
20
  """
20
21
  东方财富网-数据中心-资金流向-个股
@@ -29,7 +30,8 @@ def stock_individual_fund_flow(
29
30
  market_map = {"sh": 1, "sz": 0, "bj": 0}
30
31
  url = "https://push2his.eastmoney.com/api/qt/stock/fflow/daykline/get"
31
32
  headers = {
32
- "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",
33
+ "User-Agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 "
34
+ "(KHTML, like Gecko) Chrome/81.0.4044.138 Safari/537.36",
33
35
  }
34
36
  params = {
35
37
  "lmt": "0",
@@ -78,16 +80,37 @@ def stock_individual_fund_flow(
78
80
  "小单净流入-净占比",
79
81
  ]
80
82
  ]
81
- temp_df["主力净流入-净额"] = pd.to_numeric(temp_df["主力净流入-净额"], errors="coerce")
82
- temp_df["小单净流入-净额"] = pd.to_numeric(temp_df["小单净流入-净额"], errors="coerce")
83
- temp_df["中单净流入-净额"] = pd.to_numeric(temp_df["中单净流入-净额"], errors="coerce")
84
- temp_df["大单净流入-净额"] = pd.to_numeric(temp_df["大单净流入-净额"], errors="coerce")
85
- temp_df["超大单净流入-净额"] = pd.to_numeric(temp_df["超大单净流入-净额"], errors="coerce")
86
- temp_df["主力净流入-净占比"] = pd.to_numeric(temp_df["主力净流入-净占比"], errors="coerce")
87
- temp_df["小单净流入-净占比"] = pd.to_numeric(temp_df["小单净流入-净占比"], errors="coerce")
88
- temp_df["中单净流入-净占比"] = pd.to_numeric(temp_df["中单净流入-净占比"], errors="coerce")
89
- temp_df["大单净流入-净占比"] = pd.to_numeric(temp_df["大单净流入-净占比"], errors="coerce")
90
- temp_df["超大单净流入-净占比"] = pd.to_numeric(temp_df["超大单净流入-净占比"], errors="coerce")
83
+ temp_df["日期"] = pd.to_datetime(temp_df["日期"], errors="coerce").dt.date
84
+ temp_df["主力净流入-净额"] = pd.to_numeric(
85
+ temp_df["主力净流入-净额"], errors="coerce"
86
+ )
87
+ temp_df["小单净流入-净额"] = pd.to_numeric(
88
+ temp_df["小单净流入-净额"], errors="coerce"
89
+ )
90
+ temp_df["中单净流入-净额"] = pd.to_numeric(
91
+ temp_df["中单净流入-净额"], errors="coerce"
92
+ )
93
+ temp_df["大单净流入-净额"] = pd.to_numeric(
94
+ temp_df["大单净流入-净额"], errors="coerce"
95
+ )
96
+ temp_df["超大单净流入-净额"] = pd.to_numeric(
97
+ temp_df["超大单净流入-净额"], errors="coerce"
98
+ )
99
+ temp_df["主力净流入-净占比"] = pd.to_numeric(
100
+ temp_df["主力净流入-净占比"], errors="coerce"
101
+ )
102
+ temp_df["小单净流入-净占比"] = pd.to_numeric(
103
+ temp_df["小单净流入-净占比"], errors="coerce"
104
+ )
105
+ temp_df["中单净流入-净占比"] = pd.to_numeric(
106
+ temp_df["中单净流入-净占比"], errors="coerce"
107
+ )
108
+ temp_df["大单净流入-净占比"] = pd.to_numeric(
109
+ temp_df["大单净流入-净占比"], errors="coerce"
110
+ )
111
+ temp_df["超大单净流入-净占比"] = pd.to_numeric(
112
+ temp_df["超大单净流入-净占比"], errors="coerce"
113
+ )
91
114
  temp_df["收盘价"] = pd.to_numeric(temp_df["收盘价"], errors="coerce")
92
115
  temp_df["涨跌幅"] = pd.to_numeric(temp_df["涨跌幅"], errors="coerce")
93
116
  return temp_df
@@ -314,7 +337,8 @@ def stock_market_fund_flow() -> pd.DataFrame:
314
337
  """
315
338
  url = "https://push2his.eastmoney.com/api/qt/stock/fflow/daykline/get"
316
339
  headers = {
317
- "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",
340
+ "User-Agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 "
341
+ "(KHTML, like Gecko) Chrome/81.0.4044.138 Safari/537.36",
318
342
  }
319
343
  params = {
320
344
  "lmt": "0",
@@ -329,7 +353,7 @@ def stock_market_fund_flow() -> pd.DataFrame:
329
353
  }
330
354
  r = requests.get(url, params=params, headers=headers)
331
355
  text_data = r.text
332
- json_data = json.loads(text_data[text_data.find("{"): -2])
356
+ json_data = json.loads(text_data[text_data.find("{") : -2])
333
357
  content_list = json_data["data"]["klines"]
334
358
  temp_df = pd.DataFrame([item.split(",") for item in content_list])
335
359
  temp_df.columns = [
@@ -373,21 +397,41 @@ def stock_market_fund_flow() -> pd.DataFrame:
373
397
  temp_df["上证-涨跌幅"] = pd.to_numeric(temp_df["上证-涨跌幅"], errors="coerce")
374
398
  temp_df["深证-收盘价"] = pd.to_numeric(temp_df["深证-收盘价"], errors="coerce")
375
399
  temp_df["深证-涨跌幅"] = pd.to_numeric(temp_df["深证-涨跌幅"], errors="coerce")
376
- temp_df["主力净流入-净额"] = pd.to_numeric(temp_df["主力净流入-净额"], errors="coerce")
377
- temp_df["主力净流入-净占比"] = pd.to_numeric(temp_df["主力净流入-净占比"], errors="coerce")
378
- temp_df["超大单净流入-净额"] = pd.to_numeric(temp_df["超大单净流入-净额"], errors="coerce")
379
- temp_df["超大单净流入-净占比"] = pd.to_numeric(temp_df["超大单净流入-净占比"], errors="coerce")
380
- temp_df["大单净流入-净额"] = pd.to_numeric(temp_df["大单净流入-净额"], errors="coerce")
381
- temp_df["大单净流入-净占比"] = pd.to_numeric(temp_df["大单净流入-净占比"], errors="coerce")
382
- temp_df["中单净流入-净额"] = pd.to_numeric(temp_df["中单净流入-净额"], errors="coerce")
383
- temp_df["中单净流入-净占比"] = pd.to_numeric(temp_df["中单净流入-净占比"], errors="coerce")
384
- temp_df["小单净流入-净额"] = pd.to_numeric(temp_df["小单净流入-净额"], errors="coerce")
385
- temp_df["小单净流入-净占比"] = pd.to_numeric(temp_df["小单净流入-净占比"], errors="coerce")
400
+ temp_df["主力净流入-净额"] = pd.to_numeric(
401
+ temp_df["主力净流入-净额"], errors="coerce"
402
+ )
403
+ temp_df["主力净流入-净占比"] = pd.to_numeric(
404
+ temp_df["主力净流入-净占比"], errors="coerce"
405
+ )
406
+ temp_df["超大单净流入-净额"] = pd.to_numeric(
407
+ temp_df["超大单净流入-净额"], errors="coerce"
408
+ )
409
+ temp_df["超大单净流入-净占比"] = pd.to_numeric(
410
+ temp_df["超大单净流入-净占比"], errors="coerce"
411
+ )
412
+ temp_df["大单净流入-净额"] = pd.to_numeric(
413
+ temp_df["大单净流入-净额"], errors="coerce"
414
+ )
415
+ temp_df["大单净流入-净占比"] = pd.to_numeric(
416
+ temp_df["大单净流入-净占比"], errors="coerce"
417
+ )
418
+ temp_df["中单净流入-净额"] = pd.to_numeric(
419
+ temp_df["中单净流入-净额"], errors="coerce"
420
+ )
421
+ temp_df["中单净流入-净占比"] = pd.to_numeric(
422
+ temp_df["中单净流入-净占比"], errors="coerce"
423
+ )
424
+ temp_df["小单净流入-净额"] = pd.to_numeric(
425
+ temp_df["小单净流入-净额"], errors="coerce"
426
+ )
427
+ temp_df["小单净流入-净占比"] = pd.to_numeric(
428
+ temp_df["小单净流入-净占比"], errors="coerce"
429
+ )
386
430
  return temp_df
387
431
 
388
432
 
389
433
  def stock_sector_fund_flow_rank(
390
- indicator: str = "今日", sector_type: str = "行业资金流"
434
+ indicator: str = "今日", sector_type: str = "行业资金流"
391
435
  ) -> pd.DataFrame:
392
436
  """
393
437
  东方财富网-数据中心-资金流向-板块资金流-排名
@@ -419,7 +463,8 @@ def stock_sector_fund_flow_rank(
419
463
  }
420
464
  url = "https://push2.eastmoney.com/api/qt/clist/get"
421
465
  headers = {
422
- "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",
466
+ "User-Agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 "
467
+ "(KHTML, like Gecko) Chrome/81.0.4044.138 Safari/537.36",
423
468
  }
424
469
  params = {
425
470
  "pn": "1",
@@ -439,7 +484,7 @@ def stock_sector_fund_flow_rank(
439
484
  }
440
485
  r = requests.get(url, params=params, headers=headers)
441
486
  text_data = r.text
442
- json_data = json.loads(text_data[text_data.find("{"): -2])
487
+ json_data = json.loads(text_data[text_data.find("{") : -2])
443
488
  temp_df = pd.DataFrame(json_data["data"]["diff"])
444
489
  if indicator == "今日":
445
490
  temp_df.columns = [
@@ -480,7 +525,9 @@ def stock_sector_fund_flow_rank(
480
525
  "今日主力净流入最大股",
481
526
  ]
482
527
  ]
483
- temp_df["今日主力净流入-净额"] = pd.to_numeric(temp_df["今日主力净流入-净额"], errors="coerce")
528
+ temp_df["今日主力净流入-净额"] = pd.to_numeric(
529
+ temp_df["今日主力净流入-净额"], errors="coerce"
530
+ )
484
531
  temp_df.sort_values(["今日主力净流入-净额"], ascending=False, inplace=True)
485
532
  temp_df.reset_index(inplace=True)
486
533
  temp_df["index"] = range(1, len(temp_df) + 1)
@@ -584,7 +631,8 @@ def _get_stock_sector_fund_flow_summary_code() -> dict:
584
631
  """
585
632
  url = "https://push2.eastmoney.com/api/qt/clist/get"
586
633
  headers = {
587
- "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",
634
+ "User-Agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 "
635
+ "(KHTML, like Gecko) Chrome/81.0.4044.138 Safari/537.36",
588
636
  }
589
637
  params = {
590
638
  "pn": "1",
@@ -595,7 +643,7 @@ def _get_stock_sector_fund_flow_summary_code() -> dict:
595
643
  "fltt": "2",
596
644
  "invt": "2",
597
645
  "fid0": "f62",
598
- "fs": f"m:90 t:2",
646
+ "fs": "m:90 t:2",
599
647
  "stat": "1",
600
648
  "fields": "f12,f14,f2,f3,f62,f184,f66,f69,f72,f75,f78,f81,f84,f87,f204,f205,f124",
601
649
  "rt": "52975239",
@@ -609,7 +657,7 @@ def _get_stock_sector_fund_flow_summary_code() -> dict:
609
657
 
610
658
 
611
659
  def stock_sector_fund_flow_summary(
612
- symbol: str = "电源设备", indicator: str = "今日"
660
+ symbol: str = "电源设备", indicator: str = "今日"
613
661
  ) -> pd.DataFrame:
614
662
  """
615
663
  东方财富网-数据中心-资金流向-行业资金流-xx行业个股资金流
@@ -627,7 +675,7 @@ def stock_sector_fund_flow_summary(
627
675
  params = {
628
676
  "fid": "f62",
629
677
  "po": "1",
630
- "pz": "50",
678
+ "pz": "500",
631
679
  "pn": "1",
632
680
  "np": "1",
633
681
  "fltt": "2",
@@ -681,24 +729,42 @@ def stock_sector_fund_flow_summary(
681
729
  ]
682
730
  temp_df["最新价"] = pd.to_numeric(temp_df["最新价"], errors="coerce")
683
731
  temp_df["今天涨跌幅"] = pd.to_numeric(temp_df["今天涨跌幅"], errors="coerce")
684
- temp_df["今日主力净流入-净额"] = pd.to_numeric(temp_df["今日主力净流入-净额"], errors="coerce")
685
- temp_df["今日主力净流入-净占比"] = pd.to_numeric(temp_df["今日主力净流入-净占比"], errors="coerce")
686
- temp_df["今日超大单净流入-净额"] = pd.to_numeric(temp_df["今日超大单净流入-净额"], errors="coerce")
732
+ temp_df["今日主力净流入-净额"] = pd.to_numeric(
733
+ temp_df["今日主力净流入-净额"], errors="coerce"
734
+ )
735
+ temp_df["今日主力净流入-净占比"] = pd.to_numeric(
736
+ temp_df["今日主力净流入-净占比"], errors="coerce"
737
+ )
738
+ temp_df["今日超大单净流入-净额"] = pd.to_numeric(
739
+ temp_df["今日超大单净流入-净额"], errors="coerce"
740
+ )
687
741
  temp_df["今日超大单净流入-净占比"] = pd.to_numeric(
688
742
  temp_df["今日超大单净流入-净占比"], errors="coerce"
689
743
  )
690
- temp_df["今日大单净流入-净额"] = pd.to_numeric(temp_df["今日大单净流入-净额"], errors="coerce")
691
- temp_df["今日大单净流入-净占比"] = pd.to_numeric(temp_df["今日大单净流入-净占比"], errors="coerce")
692
- temp_df["今日中单净流入-净额"] = pd.to_numeric(temp_df["今日中单净流入-净额"], errors="coerce")
693
- temp_df["今日中单净流入-净占比"] = pd.to_numeric(temp_df["今日中单净流入-净占比"], errors="coerce")
694
- temp_df["今日小单净流入-净额"] = pd.to_numeric(temp_df["今日小单净流入-净额"], errors="coerce")
695
- temp_df["今日小单净流入-净占比"] = pd.to_numeric(temp_df["今日小单净流入-净占比"], errors="coerce")
744
+ temp_df["今日大单净流入-净额"] = pd.to_numeric(
745
+ temp_df["今日大单净流入-净额"], errors="coerce"
746
+ )
747
+ temp_df["今日大单净流入-净占比"] = pd.to_numeric(
748
+ temp_df["今日大单净流入-净占比"], errors="coerce"
749
+ )
750
+ temp_df["今日中单净流入-净额"] = pd.to_numeric(
751
+ temp_df["今日中单净流入-净额"], errors="coerce"
752
+ )
753
+ temp_df["今日中单净流入-净占比"] = pd.to_numeric(
754
+ temp_df["今日中单净流入-净占比"], errors="coerce"
755
+ )
756
+ temp_df["今日小单净流入-净额"] = pd.to_numeric(
757
+ temp_df["今日小单净流入-净额"], errors="coerce"
758
+ )
759
+ temp_df["今日小单净流入-净占比"] = pd.to_numeric(
760
+ temp_df["今日小单净流入-净占比"], errors="coerce"
761
+ )
696
762
  return temp_df
697
763
  if indicator == "5日":
698
764
  params = {
699
765
  "fid": "f164",
700
766
  "po": "1",
701
- "pz": "50",
767
+ "pz": "500",
702
768
  "pn": "1",
703
769
  "np": "1",
704
770
  "fltt": "2",
@@ -752,24 +818,42 @@ def stock_sector_fund_flow_summary(
752
818
  ]
753
819
  temp_df["最新价"] = pd.to_numeric(temp_df["最新价"], errors="coerce")
754
820
  temp_df["5日涨跌幅"] = pd.to_numeric(temp_df["5日涨跌幅"], errors="coerce")
755
- temp_df["5日主力净流入-净额"] = pd.to_numeric(temp_df["5日主力净流入-净额"], errors="coerce")
756
- temp_df["5日主力净流入-净占比"] = pd.to_numeric(temp_df["5日主力净流入-净占比"], errors="coerce")
757
- temp_df["5日超大单净流入-净额"] = pd.to_numeric(temp_df["5日超大单净流入-净额"], errors="coerce")
821
+ temp_df["5日主力净流入-净额"] = pd.to_numeric(
822
+ temp_df["5日主力净流入-净额"], errors="coerce"
823
+ )
824
+ temp_df["5日主力净流入-净占比"] = pd.to_numeric(
825
+ temp_df["5日主力净流入-净占比"], errors="coerce"
826
+ )
827
+ temp_df["5日超大单净流入-净额"] = pd.to_numeric(
828
+ temp_df["5日超大单净流入-净额"], errors="coerce"
829
+ )
758
830
  temp_df["5日超大单净流入-净占比"] = pd.to_numeric(
759
831
  temp_df["5日超大单净流入-净占比"], errors="coerce"
760
832
  )
761
- temp_df["5日大单净流入-净额"] = pd.to_numeric(temp_df["5日大单净流入-净额"], errors="coerce")
762
- temp_df["5日大单净流入-净占比"] = pd.to_numeric(temp_df["5日大单净流入-净占比"], errors="coerce")
763
- temp_df["5日中单净流入-净额"] = pd.to_numeric(temp_df["5日中单净流入-净额"], errors="coerce")
764
- temp_df["5日中单净流入-净占比"] = pd.to_numeric(temp_df["5日中单净流入-净占比"], errors="coerce")
765
- temp_df["5日小单净流入-净额"] = pd.to_numeric(temp_df["5日小单净流入-净额"], errors="coerce")
766
- temp_df["5日小单净流入-净占比"] = pd.to_numeric(temp_df["5日小单净流入-净占比"], errors="coerce")
833
+ temp_df["5日大单净流入-净额"] = pd.to_numeric(
834
+ temp_df["5日大单净流入-净额"], errors="coerce"
835
+ )
836
+ temp_df["5日大单净流入-净占比"] = pd.to_numeric(
837
+ temp_df["5日大单净流入-净占比"], errors="coerce"
838
+ )
839
+ temp_df["5日中单净流入-净额"] = pd.to_numeric(
840
+ temp_df["5日中单净流入-净额"], errors="coerce"
841
+ )
842
+ temp_df["5日中单净流入-净占比"] = pd.to_numeric(
843
+ temp_df["5日中单净流入-净占比"], errors="coerce"
844
+ )
845
+ temp_df["5日小单净流入-净额"] = pd.to_numeric(
846
+ temp_df["5日小单净流入-净额"], errors="coerce"
847
+ )
848
+ temp_df["5日小单净流入-净占比"] = pd.to_numeric(
849
+ temp_df["5日小单净流入-净占比"], errors="coerce"
850
+ )
767
851
  return temp_df
768
852
  if indicator == "10日":
769
853
  params = {
770
854
  "fid": "f174",
771
855
  "po": "1",
772
- "pz": "50",
856
+ "pz": "500",
773
857
  "pn": "1",
774
858
  "np": "1",
775
859
  "fltt": "2",
@@ -823,7 +907,9 @@ def stock_sector_fund_flow_summary(
823
907
  ]
824
908
  temp_df["最新价"] = pd.to_numeric(temp_df["最新价"], errors="coerce")
825
909
  temp_df["10日涨跌幅"] = pd.to_numeric(temp_df["10日涨跌幅"], errors="coerce")
826
- temp_df["10日主力净流入-净额"] = pd.to_numeric(temp_df["10日主力净流入-净额"], errors="coerce")
910
+ temp_df["10日主力净流入-净额"] = pd.to_numeric(
911
+ temp_df["10日主力净流入-净额"], errors="coerce"
912
+ )
827
913
  temp_df["10日主力净流入-净占比"] = pd.to_numeric(
828
914
  temp_df["10日主力净流入-净占比"], errors="coerce"
829
915
  )
@@ -833,15 +919,21 @@ def stock_sector_fund_flow_summary(
833
919
  temp_df["10日超大单净流入-净占比"] = pd.to_numeric(
834
920
  temp_df["10日超大单净流入-净占比"], errors="coerce"
835
921
  )
836
- temp_df["10日大单净流入-净额"] = pd.to_numeric(temp_df["10日大单净流入-净额"], errors="coerce")
922
+ temp_df["10日大单净流入-净额"] = pd.to_numeric(
923
+ temp_df["10日大单净流入-净额"], errors="coerce"
924
+ )
837
925
  temp_df["10日大单净流入-净占比"] = pd.to_numeric(
838
926
  temp_df["10日大单净流入-净占比"], errors="coerce"
839
927
  )
840
- temp_df["10日中单净流入-净额"] = pd.to_numeric(temp_df["10日中单净流入-净额"], errors="coerce")
928
+ temp_df["10日中单净流入-净额"] = pd.to_numeric(
929
+ temp_df["10日中单净流入-净额"], errors="coerce"
930
+ )
841
931
  temp_df["10日中单净流入-净占比"] = pd.to_numeric(
842
932
  temp_df["10日中单净流入-净占比"], errors="coerce"
843
933
  )
844
- temp_df["10日小单净流入-净额"] = pd.to_numeric(temp_df["10日小单净流入-净额"], errors="coerce")
934
+ temp_df["10日小单净流入-净额"] = pd.to_numeric(
935
+ temp_df["10日小单净流入-净额"], errors="coerce"
936
+ )
845
937
  temp_df["10日小单净流入-净占比"] = pd.to_numeric(
846
938
  temp_df["10日小单净流入-净占比"], errors="coerce"
847
939
  )
@@ -902,17 +994,37 @@ def stock_sector_fund_flow_hist(symbol: str = "电源设备") -> pd.DataFrame:
902
994
  "小单净流入-净占比",
903
995
  ]
904
996
  ]
905
- temp_df["主力净流入-净额"] = pd.to_numeric(temp_df["主力净流入-净额"], errors="coerce")
906
- temp_df["主力净流入-净占比"] = pd.to_numeric(temp_df["主力净流入-净占比"], errors="coerce")
907
- temp_df["超大单净流入-净额"] = pd.to_numeric(temp_df["超大单净流入-净额"], errors="coerce")
908
- temp_df["超大单净流入-净占比"] = pd.to_numeric(temp_df["超大单净流入-净占比"], errors="coerce")
909
- temp_df["大单净流入-净额"] = pd.to_numeric(temp_df["大单净流入-净额"], errors="coerce")
910
- temp_df["大单净流入-净占比"] = pd.to_numeric(temp_df["大单净流入-净占比"], errors="coerce")
911
- temp_df["中单净流入-净额"] = pd.to_numeric(temp_df["中单净流入-净额"], errors="coerce")
912
- temp_df["中单净流入-净占比"] = pd.to_numeric(temp_df["中单净流入-净占比"], errors="coerce")
913
- temp_df["小单净流入-净额"] = pd.to_numeric(temp_df["小单净流入-净额"], errors="coerce")
914
- temp_df["小单净流入-净占比"] = pd.to_numeric(temp_df["小单净流入-净占比"], errors="coerce")
915
- temp_df['日期'] = pd.to_datetime(temp_df['日期']).dt.date
997
+ temp_df["主力净流入-净额"] = pd.to_numeric(
998
+ temp_df["主力净流入-净额"], errors="coerce"
999
+ )
1000
+ temp_df["主力净流入-净占比"] = pd.to_numeric(
1001
+ temp_df["主力净流入-净占比"], errors="coerce"
1002
+ )
1003
+ temp_df["超大单净流入-净额"] = pd.to_numeric(
1004
+ temp_df["超大单净流入-净额"], errors="coerce"
1005
+ )
1006
+ temp_df["超大单净流入-净占比"] = pd.to_numeric(
1007
+ temp_df["超大单净流入-净占比"], errors="coerce"
1008
+ )
1009
+ temp_df["大单净流入-净额"] = pd.to_numeric(
1010
+ temp_df["大单净流入-净额"], errors="coerce"
1011
+ )
1012
+ temp_df["大单净流入-净占比"] = pd.to_numeric(
1013
+ temp_df["大单净流入-净占比"], errors="coerce"
1014
+ )
1015
+ temp_df["中单净流入-净额"] = pd.to_numeric(
1016
+ temp_df["中单净流入-净额"], errors="coerce"
1017
+ )
1018
+ temp_df["中单净流入-净占比"] = pd.to_numeric(
1019
+ temp_df["中单净流入-净占比"], errors="coerce"
1020
+ )
1021
+ temp_df["小单净流入-净额"] = pd.to_numeric(
1022
+ temp_df["小单净流入-净额"], errors="coerce"
1023
+ )
1024
+ temp_df["小单净流入-净占比"] = pd.to_numeric(
1025
+ temp_df["小单净流入-净占比"], errors="coerce"
1026
+ )
1027
+ temp_df["日期"] = pd.to_datetime(temp_df["日期"]).dt.date
916
1028
  return temp_df
917
1029
 
918
1030
 
@@ -926,7 +1038,8 @@ def _get_stock_concept_fund_flow_summary_code() -> dict:
926
1038
  """
927
1039
  url = "https://push2.eastmoney.com/api/qt/clist/get"
928
1040
  headers = {
929
- "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",
1041
+ "User-Agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 "
1042
+ "(KHTML, like Gecko) Chrome/81.0.4044.138 Safari/537.36",
930
1043
  }
931
1044
  params = {
932
1045
  "pn": "1",
@@ -1000,17 +1113,141 @@ def stock_concept_fund_flow_hist(symbol: str = "锂电池") -> pd.DataFrame:
1000
1113
  "小单净流入-净占比",
1001
1114
  ]
1002
1115
  ]
1003
- temp_df["主力净流入-净额"] = pd.to_numeric(temp_df["主力净流入-净额"], errors="coerce")
1004
- temp_df["主力净流入-净占比"] = pd.to_numeric(temp_df["主力净流入-净占比"], errors="coerce")
1005
- temp_df["超大单净流入-净额"] = pd.to_numeric(temp_df["超大单净流入-净额"], errors="coerce")
1006
- temp_df["超大单净流入-净占比"] = pd.to_numeric(temp_df["超大单净流入-净占比"], errors="coerce")
1007
- temp_df["大单净流入-净额"] = pd.to_numeric(temp_df["大单净流入-净额"], errors="coerce")
1008
- temp_df["大单净流入-净占比"] = pd.to_numeric(temp_df["大单净流入-净占比"], errors="coerce")
1009
- temp_df["中单净流入-净额"] = pd.to_numeric(temp_df["中单净流入-净额"], errors="coerce")
1010
- temp_df["中单净流入-净占比"] = pd.to_numeric(temp_df["中单净流入-净占比"], errors="coerce")
1011
- temp_df["小单净流入-净额"] = pd.to_numeric(temp_df["小单净流入-净额"], errors="coerce")
1012
- temp_df["小单净流入-净占比"] = pd.to_numeric(temp_df["小单净流入-净占比"], errors="coerce")
1013
- temp_df['日期'] = pd.to_datetime(temp_df['日期']).dt.date
1116
+ temp_df["主力净流入-净额"] = pd.to_numeric(
1117
+ temp_df["主力净流入-净额"], errors="coerce"
1118
+ )
1119
+ temp_df["主力净流入-净占比"] = pd.to_numeric(
1120
+ temp_df["主力净流入-净占比"], errors="coerce"
1121
+ )
1122
+ temp_df["超大单净流入-净额"] = pd.to_numeric(
1123
+ temp_df["超大单净流入-净额"], errors="coerce"
1124
+ )
1125
+ temp_df["超大单净流入-净占比"] = pd.to_numeric(
1126
+ temp_df["超大单净流入-净占比"], errors="coerce"
1127
+ )
1128
+ temp_df["大单净流入-净额"] = pd.to_numeric(
1129
+ temp_df["大单净流入-净额"], errors="coerce"
1130
+ )
1131
+ temp_df["大单净流入-净占比"] = pd.to_numeric(
1132
+ temp_df["大单净流入-净占比"], errors="coerce"
1133
+ )
1134
+ temp_df["中单净流入-净额"] = pd.to_numeric(
1135
+ temp_df["中单净流入-净额"], errors="coerce"
1136
+ )
1137
+ temp_df["中单净流入-净占比"] = pd.to_numeric(
1138
+ temp_df["中单净流入-净占比"], errors="coerce"
1139
+ )
1140
+ temp_df["小单净流入-净额"] = pd.to_numeric(
1141
+ temp_df["小单净流入-净额"], errors="coerce"
1142
+ )
1143
+ temp_df["小单净流入-净占比"] = pd.to_numeric(
1144
+ temp_df["小单净流入-净占比"], errors="coerce"
1145
+ )
1146
+ temp_df["日期"] = pd.to_datetime(temp_df["日期"]).dt.date
1147
+ return temp_df
1148
+
1149
+
1150
+ def stock_main_fund_flow(symbol: str = "全部股票") -> pd.DataFrame:
1151
+ """
1152
+ 东方财富网-数据中心-资金流向-主力净流入排名
1153
+ https://data.eastmoney.com/zjlx/list.html
1154
+ :param symbol: 全部股票; choice of {"全部股票", "沪深A股", "沪市A股", "科创板", "深市A股", "创业板", "沪市B股", "深市B股"}
1155
+ :type symbol: str
1156
+ :return: 主力净流入排名
1157
+ :rtype: pandas.DataFrame
1158
+ """
1159
+ symbol_map = {
1160
+ "全部股票": "m:0+t:6+f:!2,m:0+t:13+f:!2,m:0+t:80+f:!2,m:1+t:2+f:!2,m:1+t:23+f:!2,m:0+t:7+f:!2,m:1+t:3+f:!2",
1161
+ "沪深A股": "m:0+t:6+f:!2,m:0+t:13+f:!2,m:0+t:80+f:!2,m:1+t:2+f:!2,m:1+t:23+f:!2",
1162
+ "沪市A股": "m:1+t:2+f:!2,m:1+t:23+f:!2",
1163
+ "科创板": "m:1+t:23+f:!2",
1164
+ "深市A股": "m:0+t:6+f:!2,m:0+t:13+f:!2,m:0+t:80+f:!2",
1165
+ "创业板": "m:0+t:80+f:!2",
1166
+ "沪市B股": "m:1+t:3+f:!2",
1167
+ "深市B股": "m:0+t:7+f:!2",
1168
+ }
1169
+ url = "https://push2.eastmoney.com/api/qt/clist/get"
1170
+ params = {
1171
+ "fid": "f184",
1172
+ "po": "1",
1173
+ "pz": "50000",
1174
+ "pn": "1",
1175
+ "np": "1",
1176
+ "fltt": "2",
1177
+ "invt": "2",
1178
+ "fields": "f2,f3,f12,f13,f14,f62,f184,f225,f165,f263,f109,f175,f264,f160,f100,f124,f265,f1",
1179
+ "ut": "b2884a393a59ad64002292a3e90d46a5",
1180
+ "fs": symbol_map[symbol],
1181
+ }
1182
+ r = requests.get(url, params=params, timeout=15)
1183
+ data_json = r.json()
1184
+ temp_df = pd.DataFrame(data_json["data"]["diff"])
1185
+ temp_df.reset_index(inplace=True)
1186
+ temp_df.rename(
1187
+ columns={
1188
+ "index": "序号",
1189
+ "f12": "代码",
1190
+ "f14": "名称",
1191
+ "f2": "最新价",
1192
+ "f184": "今日排行榜-主力净占比",
1193
+ "f225": "今日排行榜-今日排名",
1194
+ "f3": "今日排行榜-今日涨跌",
1195
+ "f165": "5日排行榜-主力净占比",
1196
+ "f263": "5日排行榜-5日排名",
1197
+ "f109": "5日排行榜-5日涨跌",
1198
+ "f175": "10日排行榜-主力净占比",
1199
+ "f264": "10日排行榜-10日排名",
1200
+ "f160": "10日排行榜-10日涨跌",
1201
+ "f100": "所属板块",
1202
+ },
1203
+ inplace=True,
1204
+ )
1205
+ temp_df = temp_df[
1206
+ [
1207
+ "序号",
1208
+ "代码",
1209
+ "名称",
1210
+ "最新价",
1211
+ "今日排行榜-主力净占比",
1212
+ "今日排行榜-今日排名",
1213
+ "今日排行榜-今日涨跌",
1214
+ "5日排行榜-主力净占比",
1215
+ "5日排行榜-5日排名",
1216
+ "5日排行榜-5日涨跌",
1217
+ "10日排行榜-主力净占比",
1218
+ "10日排行榜-10日排名",
1219
+ "10日排行榜-10日涨跌",
1220
+ "所属板块",
1221
+ ]
1222
+ ]
1223
+ temp_df["最新价"] = pd.to_numeric(temp_df["最新价"], errors="coerce")
1224
+ temp_df["今日排行榜-主力净占比"] = pd.to_numeric(
1225
+ temp_df["今日排行榜-主力净占比"], errors="coerce"
1226
+ )
1227
+ temp_df["今日排行榜-今日排名"] = pd.to_numeric(
1228
+ temp_df["今日排行榜-今日排名"], errors="coerce"
1229
+ )
1230
+ temp_df["今日排行榜-今日涨跌"] = pd.to_numeric(
1231
+ temp_df["今日排行榜-今日涨跌"], errors="coerce"
1232
+ )
1233
+ temp_df["5日排行榜-主力净占比"] = pd.to_numeric(
1234
+ temp_df["5日排行榜-主力净占比"], errors="coerce"
1235
+ )
1236
+ temp_df["5日排行榜-5日排名"] = pd.to_numeric(
1237
+ temp_df["5日排行榜-5日排名"], errors="coerce"
1238
+ )
1239
+ temp_df["5日排行榜-5日涨跌"] = pd.to_numeric(
1240
+ temp_df["5日排行榜-5日涨跌"], errors="coerce"
1241
+ )
1242
+ temp_df["10日排行榜-主力净占比"] = pd.to_numeric(
1243
+ temp_df["10日排行榜-主力净占比"], errors="coerce"
1244
+ )
1245
+ temp_df["10日排行榜-10日排名"] = pd.to_numeric(
1246
+ temp_df["10日排行榜-10日排名"], errors="coerce"
1247
+ )
1248
+ temp_df["10日排行榜-10日涨跌"] = pd.to_numeric(
1249
+ temp_df["10日排行榜-10日涨跌"], errors="coerce"
1250
+ )
1014
1251
  return temp_df
1015
1252
 
1016
1253
 
@@ -1020,13 +1257,19 @@ if __name__ == "__main__":
1020
1257
  )
1021
1258
  print(stock_individual_fund_flow_df)
1022
1259
 
1023
- stock_individual_fund_flow_rank_df = stock_individual_fund_flow_rank(indicator="今日")
1260
+ stock_individual_fund_flow_rank_df = stock_individual_fund_flow_rank(
1261
+ indicator="今日"
1262
+ )
1024
1263
  print(stock_individual_fund_flow_rank_df)
1025
1264
 
1026
- stock_individual_fund_flow_rank_df = stock_individual_fund_flow_rank(indicator="3日")
1265
+ stock_individual_fund_flow_rank_df = stock_individual_fund_flow_rank(
1266
+ indicator="3日"
1267
+ )
1027
1268
  print(stock_individual_fund_flow_rank_df)
1028
1269
 
1029
- stock_individual_fund_flow_rank_df = stock_individual_fund_flow_rank(indicator="5日")
1270
+ stock_individual_fund_flow_rank_df = stock_individual_fund_flow_rank(
1271
+ indicator="5日"
1272
+ )
1030
1273
  print(stock_individual_fund_flow_rank_df)
1031
1274
 
1032
1275
  stock_individual_fund_flow_rank_df = stock_individual_fund_flow_rank(
@@ -1052,7 +1295,9 @@ if __name__ == "__main__":
1052
1295
  )
1053
1296
  print(stock_sector_fund_flow_rank_df)
1054
1297
 
1055
- stock_sector_fund_flow_summary_df = stock_sector_fund_flow_summary(symbol="电源设备", indicator="今日")
1298
+ stock_sector_fund_flow_summary_df = stock_sector_fund_flow_summary(
1299
+ symbol="文化传媒", indicator="今日"
1300
+ )
1056
1301
  print(stock_sector_fund_flow_summary_df)
1057
1302
 
1058
1303
  stock_sector_fund_flow_hist_df = stock_sector_fund_flow_hist(symbol="电源设备")
@@ -1060,3 +1305,6 @@ if __name__ == "__main__":
1060
1305
 
1061
1306
  stock_concept_fund_flow_hist_df = stock_concept_fund_flow_hist(symbol="锂电池")
1062
1307
  print(stock_concept_fund_flow_hist_df)
1308
+
1309
+ stock_main_fund_flow_df = stock_main_fund_flow(symbol="全部股票")
1310
+ print(stock_main_fund_flow_df)