akshare 1.14.49__py3-none-any.whl → 1.17.99__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 (343) hide show
  1. akshare/__init__.py +595 -129
  2. akshare/air/air_hebei.py +77 -54
  3. akshare/air/air_zhenqi.py +0 -4
  4. akshare/air/cons.py +1 -0
  5. akshare/air/crypto.js +1 -1
  6. akshare/air/outcrypto.js +1 -1
  7. akshare/article/cons.py +1 -0
  8. akshare/article/epu_index.py +4 -3
  9. akshare/article/ff_factor.py +19 -8
  10. akshare/article/fred_md.py +4 -1
  11. akshare/article/risk_rv.py +3 -8
  12. akshare/bank/bank_cbirc_2020.py +11 -11
  13. akshare/bank/cons.py +7 -6
  14. akshare/bond/bond_buy_back_em.py +228 -0
  15. akshare/bond/bond_cb_sina.py +1 -0
  16. akshare/bond/bond_cb_ths.py +17 -9
  17. akshare/bond/bond_cbond.py +19 -14
  18. akshare/bond/bond_china.py +38 -39
  19. akshare/bond/bond_china_money.py +1 -1
  20. akshare/bond/bond_convert.py +10 -9
  21. akshare/bond/bond_em.py +37 -17
  22. akshare/bond/bond_summary.py +38 -37
  23. akshare/bond/bond_zh_cov.py +31 -40
  24. akshare/bond/bond_zh_sina.py +4 -0
  25. akshare/bond/cons.py +14 -11
  26. akshare/cal/__init__.py +0 -0
  27. akshare/cal/rv.py +170 -0
  28. akshare/cost/cost_living.py +7 -5
  29. akshare/crypto/__init__.py +1 -1
  30. akshare/crypto/crypto_bitcoin_cme.py +9 -7
  31. akshare/crypto/crypto_hold.py +4 -2
  32. akshare/currency/currency.py +1 -0
  33. akshare/currency/currency_china_bank_sina.py +11 -6
  34. akshare/data/__init__.py +1 -1
  35. akshare/data/cninfo.js +1 -1
  36. akshare/datasets.py +10 -21
  37. akshare/economic/cons.py +10 -3
  38. akshare/economic/macro_australia.py +74 -69
  39. akshare/economic/macro_bank.py +95 -653
  40. akshare/economic/macro_canada.py +92 -81
  41. akshare/economic/macro_china.py +97 -105
  42. akshare/economic/macro_china_hk.py +0 -1
  43. akshare/economic/macro_euro.py +103 -56
  44. akshare/economic/macro_finance_ths.py +7 -5
  45. akshare/economic/macro_germany.py +1 -1
  46. akshare/economic/macro_japan.py +0 -1
  47. akshare/economic/macro_other.py +1 -6
  48. akshare/economic/macro_swiss.py +2 -3
  49. akshare/economic/macro_uk.py +1 -1
  50. akshare/economic/macro_usa.py +7 -9
  51. akshare/economic/marco_cnbs.py +11 -6
  52. akshare/energy/energy_carbon.py +0 -1
  53. akshare/energy/energy_oil_em.py +1 -2
  54. akshare/event/cons.py +1 -0
  55. akshare/exceptions.py +43 -0
  56. akshare/file_fold/calendar.json +245 -2
  57. akshare/forex/__init__.py +0 -0
  58. akshare/forex/cons.py +192 -0
  59. akshare/forex/forex_em.py +149 -0
  60. akshare/fortune/fortune_500.py +1 -37
  61. akshare/fortune/fortune_bloomberg.py +6 -3
  62. akshare/fortune/fortune_forbes_500.py +3 -6
  63. akshare/fortune/fortune_hurun.py +2 -1
  64. akshare/fortune/fortune_xincaifu_500.py +17 -14
  65. akshare/fund/fund_announcement_em.py +145 -0
  66. akshare/fund/fund_aum_em.py +49 -35
  67. akshare/fund/fund_em.py +251 -220
  68. akshare/fund/fund_etf_em.py +44 -35
  69. akshare/fund/fund_etf_sina.py +75 -27
  70. akshare/fund/fund_etf_ths.py +2 -0
  71. akshare/fund/fund_fee_em.py +172 -0
  72. akshare/fund/fund_fhsp_em.py +42 -32
  73. akshare/fund/fund_init_em.py +8 -5
  74. akshare/fund/fund_lof_em.py +12 -19
  75. akshare/fund/fund_manager.py +25 -11
  76. akshare/fund/fund_overview_em.py +42 -0
  77. akshare/fund/fund_portfolio_em.py +23 -21
  78. akshare/fund/fund_position_lg.py +19 -8
  79. akshare/fund/fund_rank_em.py +2 -5
  80. akshare/fund/fund_rating.py +33 -12
  81. akshare/fund/fund_scale_em.py +24 -13
  82. akshare/fund/fund_scale_sina.py +20 -10
  83. akshare/fund/fund_xq.py +3 -2
  84. akshare/futures/cons.py +135 -39
  85. akshare/futures/cot.py +55 -56
  86. akshare/futures/futures_basis.py +49 -11
  87. akshare/futures/futures_comex_em.py +1 -0
  88. akshare/futures/futures_comm_ctp.py +1 -1
  89. akshare/futures/futures_contract_detail.py +59 -9
  90. akshare/futures/futures_daily_bar.py +66 -59
  91. akshare/futures/futures_foreign.py +14 -8
  92. akshare/futures/futures_hf_em.py +215 -61
  93. akshare/futures/futures_hist_em.py +191 -0
  94. akshare/futures/futures_hq_sina.py +5 -3
  95. akshare/futures/futures_index_ccidx.py +24 -82
  96. akshare/futures/futures_inventory_99.py +70 -272
  97. akshare/futures/futures_inventory_em.py +14 -11
  98. akshare/futures/futures_news_shmet.py +2 -2
  99. akshare/futures/futures_roll_yield.py +11 -24
  100. akshare/futures/futures_rule.py +7 -3
  101. akshare/futures/futures_rule_em.py +38 -0
  102. akshare/futures/futures_settlement_price_sgx.py +21 -6
  103. akshare/futures/futures_stock_js.py +0 -1
  104. akshare/futures/futures_to_spot.py +5 -6
  105. akshare/futures/futures_warehouse_receipt.py +48 -47
  106. akshare/futures/futures_zh_sina.py +3 -3
  107. akshare/futures/receipt.py +298 -165
  108. akshare/futures/requests_fun.py +16 -3
  109. akshare/futures/symbol_var.py +32 -13
  110. akshare/futures_derivative/cons.py +100 -103
  111. akshare/futures_derivative/futures_contract_info_cffex.py +55 -39
  112. akshare/futures_derivative/futures_contract_info_czce.py +2 -0
  113. akshare/futures_derivative/futures_contract_info_dce.py +43 -17
  114. akshare/futures_derivative/futures_contract_info_gfex.py +43 -31
  115. akshare/futures_derivative/futures_contract_info_ine.py +43 -34
  116. akshare/futures_derivative/futures_contract_info_shfe.py +3 -4
  117. akshare/futures_derivative/futures_cot_sina.py +8 -6
  118. akshare/futures_derivative/futures_index_sina.py +25 -13
  119. akshare/fx/cons.py +12 -7
  120. akshare/fx/fx_c_swap_cm.py +62 -0
  121. akshare/fx/fx_quote.py +3 -2
  122. akshare/fx/fx_quote_baidu.py +2 -1
  123. akshare/hf/__init__.py +1 -1
  124. akshare/hf/hf_sp500.py +8 -7
  125. akshare/index/cons.py +132 -28
  126. akshare/index/index_cni.py +7 -7
  127. akshare/index/index_cons.py +2 -2
  128. akshare/index/index_csindex.py +68 -0
  129. akshare/index/index_cx.py +20 -20
  130. akshare/index/index_drewry.py +17 -16
  131. akshare/index/index_eri.py +1 -0
  132. akshare/index/index_global_em.py +167 -0
  133. akshare/index/index_global_sina.py +82 -0
  134. akshare/index/index_kq_fz.py +17 -14
  135. akshare/index/index_kq_ss.py +1 -0
  136. akshare/index/index_option_qvix.py +351 -16
  137. akshare/index/index_research_sw.py +21 -21
  138. akshare/index/index_spot.py +9 -5
  139. akshare/index/index_stock_hk.py +5 -9
  140. akshare/index/index_stock_zh.py +111 -24
  141. akshare/index/index_stock_zh_csindex.py +3 -367
  142. akshare/index/index_sugar.py +18 -4
  143. akshare/index/index_sw.py +10 -2
  144. akshare/index/index_yw.py +53 -75
  145. akshare/index/index_zh_em.py +15 -82
  146. akshare/interest_rate/interbank_rate_em.py +0 -1
  147. akshare/movie/jm.js +0 -1
  148. akshare/news/__init__.py +1 -1
  149. akshare/news/news_baidu.py +395 -222
  150. akshare/news/news_stock.py +49 -16
  151. akshare/option/cons.py +2 -2
  152. akshare/option/option_commodity.py +341 -220
  153. akshare/option/option_commodity_sina.py +22 -26
  154. akshare/option/option_contract_info_ctp.py +63 -0
  155. akshare/option/option_current_sse.py +61 -0
  156. akshare/option/option_current_szse.py +84 -0
  157. akshare/option/option_czce.py +37 -9
  158. akshare/option/option_daily_stats_sse_szse.py +0 -1
  159. akshare/option/option_em.py +4 -8
  160. akshare/option/option_finance.py +60 -12
  161. akshare/option/option_finance_sina.py +7 -7
  162. akshare/option/option_lhb_em.py +0 -1
  163. akshare/option/option_margin.py +62 -0
  164. akshare/option/option_premium_analysis_em.py +58 -53
  165. akshare/option/option_risk_analysis_em.py +11 -8
  166. akshare/option/option_risk_indicator_sse.py +3 -4
  167. akshare/option/option_value_analysis_em.py +62 -55
  168. akshare/other/__init__.py +1 -1
  169. akshare/pro/__init__.py +0 -1
  170. akshare/pro/client.py +6 -4
  171. akshare/pro/cons.py +3 -2
  172. akshare/pro/data_pro.py +6 -5
  173. akshare/qdii/__init__.py +0 -0
  174. akshare/qdii/qdii_jsl.py +233 -0
  175. akshare/qhkc/__init__.py +1 -6
  176. akshare/qhkc/qhkc_api.py +64 -22
  177. akshare/qhkc_web/__init__.py +1 -6
  178. akshare/qhkc_web/qhkc_fund.py +10 -6
  179. akshare/qhkc_web/qhkc_index.py +28 -14
  180. akshare/qhkc_web/qhkc_tool.py +62 -59
  181. akshare/rate/__init__.py +1 -1
  182. akshare/rate/repo_rate.py +36 -32
  183. akshare/reits/__init__.py +1 -1
  184. akshare/reits/reits_basic.py +149 -13
  185. akshare/request.py +117 -0
  186. akshare/spot/__init__.py +1 -1
  187. akshare/spot/spot_hog_soozhu.py +165 -3
  188. akshare/spot/spot_sge.py +70 -9
  189. akshare/stock/cons.py +60 -23
  190. akshare/stock/stock_allotment_cninfo.py +8 -8
  191. akshare/stock/stock_ask_bid_em.py +3 -78
  192. akshare/stock/stock_board_concept_em.py +160 -35
  193. akshare/stock/stock_board_industry_em.py +163 -70
  194. akshare/stock/stock_dividend_cninfo.py +31 -17
  195. akshare/stock/stock_dzjy_em.py +347 -260
  196. akshare/stock/stock_fund_em.py +72 -64
  197. akshare/stock/stock_fund_hold.py +1 -2
  198. akshare/stock/stock_gsrl_em.py +1 -0
  199. akshare/stock/stock_hk_comparison_em.py +175 -0
  200. akshare/stock/stock_hk_famous.py +4 -5
  201. akshare/stock/stock_hk_fhpx_ths.py +2 -1
  202. akshare/stock/stock_hk_hot_rank_em.py +1 -0
  203. akshare/stock/stock_hk_sina.py +84 -36
  204. akshare/stock/stock_hold_control_cninfo.py +82 -0
  205. akshare/stock/stock_hold_control_em.py +0 -2
  206. akshare/stock/stock_hot_rank_em.py +4 -1
  207. akshare/stock/stock_hot_search_baidu.py +32 -19
  208. akshare/stock/stock_hot_up_em.py +4 -1
  209. akshare/stock/stock_hsgt_em.py +155 -0
  210. akshare/stock/stock_industry.py +1 -0
  211. akshare/stock/stock_industry_cninfo.py +1 -2
  212. akshare/stock/stock_info.py +6 -4
  213. akshare/stock/stock_info_em.py +17 -11
  214. akshare/stock/stock_intraday_em.py +4 -78
  215. akshare/stock/stock_intraday_sina.py +2 -2
  216. akshare/stock/stock_news_cx.py +39 -0
  217. akshare/stock/stock_profile_cninfo.py +7 -7
  218. akshare/stock/stock_profile_em.py +302 -0
  219. akshare/stock/stock_rank_forecast.py +6 -5
  220. akshare/stock/stock_repurchase_em.py +7 -2
  221. akshare/stock/stock_share_changes_cninfo.py +7 -5
  222. akshare/stock/stock_share_hold.py +24 -20
  223. akshare/stock/stock_stop.py +6 -6
  224. akshare/stock/stock_summary.py +153 -417
  225. akshare/stock/stock_us_famous.py +5 -6
  226. akshare/stock/stock_us_js.py +3 -2
  227. akshare/stock/stock_us_pink.py +38 -27
  228. akshare/stock/stock_us_sina.py +7 -3
  229. akshare/stock/stock_weibo_nlp.py +18 -20
  230. akshare/stock/stock_xq.py +24 -22
  231. akshare/stock/stock_zh_a_sina.py +8 -5
  232. akshare/stock/stock_zh_a_special.py +240 -243
  233. akshare/stock/stock_zh_a_tick_tx.py +11 -3
  234. akshare/stock/stock_zh_ah_tx.py +23 -26
  235. akshare/stock/stock_zh_b_sina.py +2 -2
  236. akshare/stock/stock_zh_comparison_em.py +250 -0
  237. akshare/stock/stock_zh_kcb_sina.py +67 -64
  238. akshare/stock_a/__init__.py +0 -0
  239. akshare/stock_a/stock_board_concept_name_em.py +170 -0
  240. akshare/stock_a/stock_individual_fund_flow_rank.py +258 -0
  241. akshare/stock_a/stock_zh_a_spot.py +212 -0
  242. akshare/stock_feature/cons.py +1 -0
  243. akshare/stock_feature/stock_a_indicator.py +9 -54
  244. akshare/stock_feature/stock_a_pe_and_pb.py +23 -5
  245. akshare/stock_feature/stock_account_em.py +0 -1
  246. akshare/stock_feature/stock_all_pb.py +2 -1
  247. akshare/stock_feature/stock_analyst_em.py +36 -30
  248. akshare/stock_feature/stock_board_concept_ths.py +328 -0
  249. akshare/stock_feature/stock_board_industry_ths.py +57 -2
  250. akshare/stock_feature/stock_buffett_index_lg.py +10 -8
  251. akshare/stock_feature/stock_classify_sina.py +3 -6
  252. akshare/stock_feature/stock_comment_em.py +81 -144
  253. akshare/stock_feature/stock_congestion_lg.py +2 -1
  254. akshare/stock_feature/stock_cyq_em.py +5 -11
  255. akshare/stock_feature/stock_disclosure_cninfo.py +6 -6
  256. akshare/stock_feature/stock_dxsyl_em.py +121 -74
  257. akshare/stock_feature/stock_ebs_lg.py +5 -4
  258. akshare/stock_feature/stock_esg_sina.py +29 -7
  259. akshare/stock_feature/stock_fhps_em.py +2 -1
  260. akshare/stock_feature/stock_fhps_ths.py +15 -7
  261. akshare/stock_feature/stock_fund_flow.py +30 -22
  262. akshare/stock_feature/stock_gddh_em.py +19 -11
  263. akshare/stock_feature/stock_gdfx_em.py +226 -113
  264. akshare/stock_feature/stock_gdhs.py +75 -50
  265. akshare/stock_feature/stock_gdzjc_em.py +21 -10
  266. akshare/stock_feature/stock_gpzy_em.py +78 -46
  267. akshare/stock_feature/stock_gxl_lg.py +3 -2
  268. akshare/stock_feature/stock_hist_em.py +137 -234
  269. akshare/stock_feature/stock_hist_tx.py +13 -10
  270. akshare/stock_feature/stock_hk_valuation_baidu.py +20 -8
  271. akshare/stock_feature/stock_hot_xq.py +4 -6
  272. akshare/stock_feature/stock_hsgt_em.py +269 -97
  273. akshare/stock_feature/stock_hsgt_exchange_rate.py +115 -87
  274. akshare/stock_feature/stock_hsgt_min_em.py +13 -16
  275. akshare/stock_feature/stock_info.py +7 -80
  276. akshare/stock_feature/stock_inner_trade_xq.py +38 -31
  277. akshare/stock_feature/stock_jgdy_em.py +43 -40
  278. akshare/stock_feature/stock_lhb_em.py +119 -3
  279. akshare/stock_feature/stock_margin_em.py +0 -1
  280. akshare/stock_feature/stock_margin_sse.py +0 -2
  281. akshare/stock_feature/stock_pankou_em.py +71 -35
  282. akshare/stock_feature/stock_qsjy_em.py +13 -4
  283. akshare/stock_feature/stock_report_em.py +151 -7
  284. akshare/stock_feature/stock_research_report_em.py +55 -20
  285. akshare/stock_feature/stock_sy_em.py +20 -15
  286. akshare/stock_feature/stock_technology_ths.py +122 -77
  287. akshare/stock_feature/stock_tfp_em.py +2 -1
  288. akshare/stock_feature/stock_three_report_em.py +21 -5
  289. akshare/stock_feature/stock_ttm_lyr.py +18 -9
  290. akshare/stock_feature/stock_value_em.py +83 -0
  291. akshare/stock_feature/stock_yjbb_em.py +58 -32
  292. akshare/stock_feature/stock_yjyg_cninfo.py +6 -2
  293. akshare/stock_feature/stock_yjyg_em.py +1 -1
  294. akshare/stock_feature/stock_yzxdr_em.py +24 -22
  295. akshare/stock_feature/stock_zdhtmx_em.py +20 -6
  296. akshare/stock_feature/stock_zh_vote_baidu.py +4 -1
  297. akshare/stock_feature/stock_ztb_em.py +39 -24
  298. akshare/stock_fundamental/__init__.py +1 -1
  299. akshare/stock_fundamental/stock_basic_info_xq.py +119 -0
  300. akshare/stock_fundamental/{stock_finance_hk.py → stock_finance_hk_em.py} +23 -16
  301. akshare/stock_fundamental/{stock_finance.py → stock_finance_sina.py} +60 -7
  302. akshare/stock_fundamental/stock_finance_ths.py +524 -57
  303. akshare/stock_fundamental/stock_finance_us_em.py +268 -0
  304. akshare/stock_fundamental/stock_gbjg_em.py +80 -0
  305. akshare/stock_fundamental/stock_hold.py +26 -17
  306. akshare/stock_fundamental/stock_ipo_declare.py +1 -0
  307. akshare/stock_fundamental/stock_kcb_detail_sse.py +10 -10
  308. akshare/stock_fundamental/stock_kcb_sse.py +26 -25
  309. akshare/stock_fundamental/stock_notice.py +12 -3
  310. akshare/stock_fundamental/stock_profit_forecast_em.py +31 -13
  311. akshare/stock_fundamental/stock_profit_forecast_hk_etnet.py +64 -41
  312. akshare/stock_fundamental/stock_profit_forecast_ths.py +86 -35
  313. akshare/stock_fundamental/stock_recommend.py +20 -4
  314. akshare/stock_fundamental/stock_zygc.py +5 -62
  315. akshare/utils/context.py +43 -0
  316. akshare/utils/demjson.py +2009 -1338
  317. akshare/utils/func.py +49 -2
  318. akshare/utils/multi_decrypt.py +53 -0
  319. akshare/utils/token_process.py +6 -5
  320. {akshare-1.14.49.dist-info → akshare-1.17.99.dist-info}/METADATA +54 -80
  321. akshare-1.17.99.dist-info/RECORD +409 -0
  322. {akshare-1.14.49.dist-info → akshare-1.17.99.dist-info}/WHEEL +1 -1
  323. {akshare-1.14.49.dist-info → akshare-1.17.99.dist-info/licenses}/LICENSE +1 -1
  324. tests/test_func.py +3 -5
  325. akshare/bond/bond_futures.py +0 -50
  326. akshare/bond/bond_investing.py +0 -139
  327. akshare/crypto/crypto_hist_investing.py +0 -249
  328. akshare/fund/fund_announcement.py +0 -56
  329. akshare/futures/futures_international.py +0 -170
  330. akshare/futures/futures_news_baidu.py +0 -54
  331. akshare/futures/inventory_data.py +0 -100
  332. akshare/futures_derivative/futures_index_price_nh.py +0 -61
  333. akshare/futures_derivative/futures_index_return_nh.py +0 -47
  334. akshare/futures_derivative/futures_index_volatility_nh.py +0 -53
  335. akshare/futures_derivative/futures_other_index_nh.py +0 -145
  336. akshare/index/index_fear_greed_funddb.py +0 -78
  337. akshare/index/index_investing.py +0 -232
  338. akshare/sport/__init__.py +0 -6
  339. akshare/sport/sport_olympic.py +0 -27
  340. akshare/stock_feature/stock_wencai.py +0 -104
  341. akshare/stock_fundamental/stock_mda_ym.py +0 -40
  342. akshare-1.14.49.dist-info/RECORD +0 -387
  343. {akshare-1.14.49.dist-info → akshare-1.17.99.dist-info}/top_level.txt +0 -0
@@ -1,7 +1,7 @@
1
1
  #!/usr/bin/env python
2
2
  # -*- coding:utf-8 -*-
3
3
  """
4
- Date: 2024/4/14 16:00
4
+ Date: 2025/3/15 22:30
5
5
  Desc: 港股股票指数数据-新浪-东财
6
6
  所有指数-实时行情数据和历史行情数据
7
7
  https://finance.sina.com.cn/realstock/company/sz399552/nc.shtml
@@ -17,6 +17,7 @@ import py_mini_racer
17
17
  from functools import lru_cache
18
18
 
19
19
  from akshare.stock.cons import hk_js_decode
20
+ from akshare.utils.func import fetch_paginated_data
20
21
 
21
22
 
22
23
  def _replace_comma(x) -> str:
@@ -154,7 +155,7 @@ def stock_hk_index_spot_em() -> pd.DataFrame:
154
155
  url = "https://15.push2.eastmoney.com/api/qt/clist/get"
155
156
  params = {
156
157
  "pn": "1",
157
- "pz": "20000",
158
+ "pz": "100",
158
159
  "po": "1",
159
160
  "np": "1",
160
161
  "ut": "bd1d9ddb04089700cf9c27f6f7426281",
@@ -165,13 +166,8 @@ def stock_hk_index_spot_em() -> pd.DataFrame:
165
166
  "fs": "m:124,m:125,m:305",
166
167
  "fields": "f1,f2,f3,f4,f5,f6,f7,f8,f9,f10,f12,f13,f14,f15,f16,f17,f18,f20,f21,f23,f24,f25,"
167
168
  "f26,f22,f33,f11,f62,f128,f136,f115,f152",
168
- "_": "1683800547682",
169
169
  }
170
- r = requests.get(url, params=params)
171
- data_json = r.json()
172
- temp_df = pd.DataFrame(data_json["data"]["diff"])
173
- temp_df.reset_index(inplace=True)
174
- temp_df["index"] = temp_df["index"] + 1
170
+ temp_df = fetch_paginated_data(url, params)
175
171
  temp_df.rename(
176
172
  columns={
177
173
  "index": "序号",
@@ -302,5 +298,5 @@ if __name__ == "__main__":
302
298
  stock_hk_index_spot_em_df = stock_hk_index_spot_em()
303
299
  print(stock_hk_index_spot_em_df)
304
300
 
305
- stock_hk_index_daily_em_df = stock_hk_index_daily_em(symbol="HSAHP")
301
+ stock_hk_index_daily_em_df = stock_hk_index_daily_em(symbol="HSTECH")
306
302
  print(stock_hk_index_daily_em_df)
@@ -1,7 +1,7 @@
1
1
  #!/usr/bin/env python
2
2
  # -*- coding:utf-8 -*-
3
3
  """
4
- Date: 2024/5/28 15:30
4
+ Date: 2025/3/10 18:30
5
5
  Desc: 股票指数数据-新浪-东财-腾讯
6
6
  所有指数-实时行情数据和历史行情数据
7
7
  https://finance.sina.com.cn/realstock/company/sz399552/nc.shtml
@@ -11,8 +11,8 @@ import datetime
11
11
  import re
12
12
 
13
13
  import pandas as pd
14
- import requests
15
14
  import py_mini_racer
15
+ import requests
16
16
 
17
17
  from akshare.index.cons import (
18
18
  zh_sina_index_stock_payload,
@@ -22,6 +22,7 @@ from akshare.index.cons import (
22
22
  )
23
23
  from akshare.stock.cons import hk_js_decode
24
24
  from akshare.utils import demjson
25
+ from akshare.utils.func import fetch_paginated_data
25
26
  from akshare.utils.tqdm import get_tqdm
26
27
 
27
28
 
@@ -125,42 +126,119 @@ def stock_zh_index_spot_sina() -> pd.DataFrame:
125
126
  return big_df
126
127
 
127
128
 
129
+ def __stock_zh_main_spot_em() -> pd.DataFrame:
130
+ """
131
+ 东方财富网-行情中心-沪深重要指数
132
+ https://quote.eastmoney.com/center/hszs.html
133
+ :return: 指数的实时行情数据
134
+ :rtype: pandas.DataFrame
135
+ """
136
+ url = "https://33.push2.eastmoney.com/api/qt/clist/get"
137
+ params = {
138
+ "pn": "1",
139
+ "pz": "100",
140
+ "po": "1",
141
+ "np": "1",
142
+ "ut": "bd1d9ddb04089700cf9c27f6f7426281",
143
+ "fltt": "2",
144
+ "invt": "2",
145
+ "dect": "1",
146
+ "wbp2u": "|0|0|0|web",
147
+ "fid": "",
148
+ "fs": "b:MK0010",
149
+ "fields": "f1,f2,f3,f4,f5,f6,f7,f8,f9,f10,f12,f13,f14,f15,f16,f17,f18,f20,f21,"
150
+ "f23,f24,f25,f26,f22,f11,f62,f128,f136,f115,f152",
151
+ }
152
+ r = requests.get(url, params=params)
153
+ data_json = r.json()
154
+ temp_df = pd.DataFrame(data_json["data"]["diff"])
155
+ temp_df.reset_index(inplace=True)
156
+ temp_df["index"] = temp_df["index"].astype(int) + 1
157
+ temp_df.rename(
158
+ columns={
159
+ "index": "序号",
160
+ "f2": "最新价",
161
+ "f3": "涨跌幅",
162
+ "f4": "涨跌额",
163
+ "f5": "成交量",
164
+ "f6": "成交额",
165
+ "f7": "振幅",
166
+ "f10": "量比",
167
+ "f12": "代码",
168
+ "f14": "名称",
169
+ "f15": "最高",
170
+ "f16": "最低",
171
+ "f17": "今开",
172
+ "f18": "昨收",
173
+ },
174
+ inplace=True,
175
+ )
176
+ temp_df = temp_df[
177
+ [
178
+ "序号",
179
+ "代码",
180
+ "名称",
181
+ "最新价",
182
+ "涨跌幅",
183
+ "涨跌额",
184
+ "成交量",
185
+ "成交额",
186
+ "振幅",
187
+ "最高",
188
+ "最低",
189
+ "今开",
190
+ "昨收",
191
+ "量比",
192
+ ]
193
+ ]
194
+ temp_df["最新价"] = pd.to_numeric(temp_df["最新价"], errors="coerce")
195
+ temp_df["涨跌幅"] = pd.to_numeric(temp_df["涨跌幅"], errors="coerce")
196
+ temp_df["涨跌额"] = pd.to_numeric(temp_df["涨跌额"], errors="coerce")
197
+ temp_df["成交量"] = pd.to_numeric(temp_df["成交量"], errors="coerce")
198
+ temp_df["成交额"] = pd.to_numeric(temp_df["成交额"], errors="coerce")
199
+ temp_df["振幅"] = pd.to_numeric(temp_df["振幅"], errors="coerce")
200
+ temp_df["最高"] = pd.to_numeric(temp_df["最高"], errors="coerce")
201
+ temp_df["最低"] = pd.to_numeric(temp_df["最低"], errors="coerce")
202
+ temp_df["今开"] = pd.to_numeric(temp_df["今开"], errors="coerce")
203
+ temp_df["昨收"] = pd.to_numeric(temp_df["昨收"], errors="coerce")
204
+ temp_df["量比"] = pd.to_numeric(temp_df["量比"], errors="coerce")
205
+ return temp_df
206
+
207
+
128
208
  def stock_zh_index_spot_em(symbol: str = "上证系列指数") -> pd.DataFrame:
129
209
  """
130
210
  东方财富网-行情中心-沪深京指数
131
211
  https://quote.eastmoney.com/center/gridlist.html#index_sz
132
- :param symbol: "上证系列指数"; choice of {"上证系列指数", "深证系列指数", "指数成份", "中证系列指数"}
212
+ :param symbol: "上证系列指数"; choice of {"沪深重要指数", "上证系列指数", "深证系列指数", "指数成份", "中证系列指数"}
133
213
  :type symbol: str
134
214
  :return: 指数的实时行情数据
135
215
  :rtype: pandas.DataFrame
136
216
  """
217
+ if symbol == "沪深重要指数":
218
+ return __stock_zh_main_spot_em()
219
+
137
220
  url = "https://48.push2.eastmoney.com/api/qt/clist/get"
138
221
  symbol_map = {
139
- "上证系列指数": "m:1 s:2",
222
+ "上证系列指数": "m:1+t:1",
140
223
  "深证系列指数": "m:0 t:5",
141
- "指数成份": "m:1 s:3,m:0 t:5",
224
+ "指数成份": "m:1+s:3,m:0+t:5",
142
225
  "中证系列指数": "m:2",
143
226
  }
144
227
  params = {
145
228
  "pn": "1",
146
- "pz": "5000",
229
+ "pz": "100",
147
230
  "po": "1",
148
231
  "np": "1",
149
232
  "ut": "bd1d9ddb04089700cf9c27f6f7426281",
150
233
  "fltt": "2",
151
234
  "invt": "2",
152
235
  "wbp2u": "|0|0|0|web",
153
- "fid": "f3",
236
+ "fid": "f12",
154
237
  "fs": symbol_map[symbol],
155
238
  "fields": "f1,f2,f3,f4,f5,f6,f7,f8,f9,f10,f12,f13,f14,f15,f16,f17,f18,f20,f21,f23,f24,f25,"
156
239
  "f26,f22,f33,f11,f62,f128,f136,f115,f152",
157
- "_": "1704327268532",
158
240
  }
159
- r = requests.get(url, params=params)
160
- data_json = r.json()
161
- temp_df = pd.DataFrame(data_json["data"]["diff"])
162
- temp_df.reset_index(inplace=True)
163
- temp_df["index"] = temp_df["index"] + 1
241
+ temp_df = fetch_paginated_data(url, params)
164
242
  temp_df.rename(
165
243
  columns={
166
244
  "index": "序号",
@@ -238,14 +316,14 @@ def stock_zh_index_daily(symbol: str = "sh000922") -> pd.DataFrame:
238
316
  return temp_df
239
317
 
240
318
 
241
- def get_tx_start_year(symbol: str = "sh000919") -> pd.DataFrame:
319
+ def get_tx_start_year(symbol: str = "sh000919") -> str:
242
320
  """
243
321
  腾讯证券-获取所有股票数据的第一天, 注意这个数据是腾讯证券的历史数据第一天
244
322
  https://gu.qq.com/sh000919/zs
245
323
  :param symbol: 带市场标识的股票代码
246
324
  :type symbol: str
247
325
  :return: 开始日期
248
- :rtype: pandas.DataFrame
326
+ :rtype: str
249
327
  """
250
328
  url = "https://web.ifzq.gtimg.cn/other/klineweb/klineWeb/weekTrends"
251
329
  params = {
@@ -339,10 +417,12 @@ def stock_zh_index_daily_em(
339
417
  :return: 指数数据
340
418
  :rtype: pandas.DataFrame
341
419
  """
342
- market_map = {"sz": "0", "sh": "1", "csi": "2"}
420
+ market_map = {"sz": "0", "sh": "1", "csi": "2", "bj": "0"}
343
421
  url = "https://push2his.eastmoney.com/api/qt/stock/kline/get"
344
422
  if symbol.find("sz") != -1:
345
423
  secid = "{}.{}".format(market_map["sz"], symbol.replace("sz", ""))
424
+ elif symbol.find("bj") != -1:
425
+ secid = "{}.{}".format(market_map["bj"], symbol.replace("bj", ""))
346
426
  elif symbol.find("sh") != -1:
347
427
  secid = "{}.{}".format(market_map["sh"], symbol.replace("sh", ""))
348
428
  elif symbol.find("csi") != -1:
@@ -350,22 +430,17 @@ def stock_zh_index_daily_em(
350
430
  else:
351
431
  return pd.DataFrame()
352
432
  params = {
353
- "cb": "jQuery1124033485574041163946_1596700547000",
354
433
  "secid": secid,
355
- "ut": "fa5fd1943c7b386f172d6893dbfba10b",
356
434
  "fields1": "f1,f2,f3,f4,f5",
357
435
  "fields2": "f51,f52,f53,f54,f55,f56,f57,f58",
358
436
  "klt": "101", # 日频率
359
437
  "fqt": "0",
360
438
  "beg": start_date,
361
439
  "end": end_date,
362
- "_": "1596700547039",
363
440
  }
364
441
  r = requests.get(url, params=params)
365
- data_text = r.text
366
- data_json = demjson.decode(data_text[data_text.find("{") : -2])
442
+ data_json = r.json()
367
443
  temp_df = pd.DataFrame([item.split(",") for item in data_json["data"]["klines"]])
368
- # check temp_df data availability before further transformations which may raise errors
369
444
  if temp_df.empty:
370
445
  return pd.DataFrame()
371
446
  temp_df.columns = ["date", "open", "close", "high", "low", "volume", "amount", "_"]
@@ -380,17 +455,29 @@ def stock_zh_index_daily_em(
380
455
 
381
456
 
382
457
  if __name__ == "__main__":
383
- stock_zh_index_daily_df = stock_zh_index_daily(symbol="sz399905")
458
+ stock_zh_index_daily_df = stock_zh_index_daily(symbol="sh000510")
384
459
  print(stock_zh_index_daily_df)
385
460
 
386
461
  stock_zh_index_spot_sina_df = stock_zh_index_spot_sina()
387
462
  print(stock_zh_index_spot_sina_df)
388
463
 
464
+ stock_zh_index_spot_em_df = stock_zh_index_spot_em(symbol="沪深重要指数")
465
+ print(stock_zh_index_spot_em_df)
466
+
389
467
  stock_zh_index_spot_em_df = stock_zh_index_spot_em(symbol="上证系列指数")
390
468
  print(stock_zh_index_spot_em_df)
391
469
 
470
+ stock_zh_index_spot_em_df = stock_zh_index_spot_em(symbol="深证系列指数")
471
+ print(stock_zh_index_spot_em_df)
472
+
473
+ stock_zh_index_spot_em_df = stock_zh_index_spot_em(symbol="指数成份")
474
+ print(stock_zh_index_spot_em_df)
475
+
476
+ stock_zh_index_spot_em_df = stock_zh_index_spot_em(symbol="中证系列指数")
477
+ print(stock_zh_index_spot_em_df)
478
+
392
479
  stock_zh_index_daily_tx_df = stock_zh_index_daily_tx(symbol="sh000919")
393
480
  print(stock_zh_index_daily_tx_df)
394
481
 
395
- stock_zh_index_daily_em_df = stock_zh_index_daily_em(symbol="sz399812")
482
+ stock_zh_index_daily_em_df = stock_zh_index_daily_em(symbol="bj899050")
396
483
  print(stock_zh_index_daily_em_df)
@@ -1,203 +1,15 @@
1
1
  # -*- coding:utf-8 -*-
2
2
  # !/usr/bin/env python
3
3
  """
4
- Date: 2023/7/6 17:00
4
+ Date: 2024/12/23 17:00
5
5
  Desc: 中证指数-所有指数-历史行情数据
6
6
  https://www.csindex.com.cn/zh-CN/indices/index-detail/H30374#/indices/family/list?index_series=1
7
7
  """
8
8
 
9
- import hashlib
10
- import time
11
- from functools import lru_cache
12
-
13
9
  import pandas as pd
14
10
  import requests
15
11
 
16
12
 
17
- def __get_current_timestamp_ms() -> int:
18
- """
19
- 生成时间戳
20
- :return: 时间戳
21
- :rtype: int
22
- """
23
- timestamp_seconds = time.time()
24
- timestamp_ms = int(timestamp_seconds * 1000)
25
- return timestamp_ms
26
-
27
-
28
- def __md5_hash(input_string) -> str:
29
- """
30
- 生成 md5 加密后的值
31
- :return: 生成 md5 加密后的值
32
- :rtype: str
33
- """
34
- md5 = hashlib.md5()
35
- md5.update(input_string.encode("utf-8"))
36
- return md5.hexdigest()
37
-
38
-
39
- def __create_encode(
40
- act_time="1688635494326",
41
- authtoken="",
42
- gu_code="399808.SZ",
43
- pe_category="pb",
44
- type="pc",
45
- ver="new",
46
- version="2.2.7",
47
- year=-1,
48
- ) -> dict:
49
- """
50
- 生成 post 密文,需要 JS 观察如下文件:
51
- https://funddb.cn/static/js/app.1c429c670c72542fb4fd.js
52
- :return: 生成 post 密文
53
- :rtype: str
54
- """
55
- input_string = f"{act_time}{authtoken}{gu_code}{pe_category}{type}{ver}{version}{year}EWf45rlv#kfsr@k#gfksgkr"
56
- hash_value = __md5_hash(input_string)
57
- l = hash_value # noqa: E741
58
- c = l[29:31]
59
- d = l[2:4]
60
- f = l[5:6]
61
- h = l[26:27]
62
- m = l[6:8]
63
- v = l[1:2]
64
- y = l[0:2]
65
- k = l[6:8]
66
- w = l[8:9]
67
- x = l[30:31]
68
- P = l[11:14]
69
- z = l[11:12]
70
- j = l[2:5]
71
- q = l[9:11]
72
- H = l[23:25]
73
- O = l[31:32] # noqa: E741
74
- C = l[25:27]
75
- E = l[9:11]
76
- A = l[27:29]
77
- T = l[17:19]
78
- F = l[26:27]
79
- U = l[12:14]
80
- S = l[25:26]
81
- R = l[16:19]
82
- K = l[17:21]
83
- I = l[18:19] # noqa: E741
84
- D = l[21:23]
85
- _ = l[
86
- 14:16
87
- ] # $ is not a valid variable name in Python, so I replaced it with an underscore
88
- B = l[29:32]
89
- N = l[21:23]
90
- V = l[24:26]
91
- Y = l[16:17]
92
-
93
- def b(
94
- t,
95
- e,
96
- n,
97
- i,
98
- a,
99
- r,
100
- o,
101
- l, # noqa: E741
102
- u,
103
- c,
104
- s,
105
- d,
106
- _,
107
- f,
108
- h,
109
- p,
110
- m,
111
- g,
112
- v,
113
- y,
114
- b,
115
- k,
116
- w,
117
- x,
118
- P,
119
- z,
120
- j,
121
- q,
122
- H,
123
- O, # noqa: E741
124
- C,
125
- E,
126
- A,
127
- ):
128
- t["data"]["tirgkjfs"] = f
129
- t["data"]["abiokytke"] = _
130
- t["data"]["u54rg5d"] = e
131
- t["data"]["kf54ge7"] = q
132
- t["data"]["tiklsktr4"] = d
133
- t["data"]["lksytkjh"] = z
134
- t["data"]["sbnoywr"] = j
135
- t["data"]["bgd7h8tyu54"] = w
136
- t["data"]["y654b5fs3tr"] = C
137
- t["data"]["bioduytlw"] = n
138
- t["data"]["bd4uy742"] = P
139
- t["data"]["h67456y"] = o
140
- t["data"]["bvytikwqjk"] = s
141
- t["data"]["ngd4uy551"] = b
142
- t["data"]["bgiuytkw"] = v
143
- t["data"]["nd354uy4752"] = g
144
- t["data"]["ghtoiutkmlg"] = x
145
- t["data"]["bd24y6421f"] = i
146
- t["data"]["tbvdiuytk"] = l
147
- t["data"]["ibvytiqjek"] = p
148
- t["data"]["jnhf8u5231"] = A
149
- t["data"]["fjlkatj"] = E
150
- t["data"]["hy5641d321t"] = H
151
- t["data"]["iogojti"] = r
152
- t["data"]["ngd4yut78"] = a
153
- t["data"]["nkjhrew"] = c
154
- t["data"]["yt447e13f"] = O
155
- t["data"]["n3bf4uj7y7"] = k
156
- t["data"]["nbf4uj7y432"] = h
157
- t["data"]["yi854tew"] = u
158
- t["data"]["h13ey474"] = m
159
- t["data"]["quikgdky"] = y
160
-
161
- t = {"data": {}}
162
-
163
- b(
164
- t,
165
- d,
166
- f,
167
- V,
168
- U,
169
- S,
170
- R,
171
- Y,
172
- c,
173
- h,
174
- m,
175
- v,
176
- N,
177
- y,
178
- D,
179
- _,
180
- B,
181
- x,
182
- E,
183
- A,
184
- T,
185
- I,
186
- k,
187
- P,
188
- F,
189
- K,
190
- H,
191
- O,
192
- C,
193
- w,
194
- z,
195
- j,
196
- q,
197
- )
198
- return t["data"]
199
-
200
-
201
13
  def stock_zh_index_hist_csindex(
202
14
  symbol: str = "000928",
203
15
  start_date: str = "20180526",
@@ -243,7 +55,7 @@ def stock_zh_index_hist_csindex(
243
55
  "样本数量",
244
56
  "滚动市盈率",
245
57
  ]
246
- temp_df["日期"] = pd.to_datetime(temp_df["日期"]).dt.date
58
+ temp_df["日期"] = pd.to_datetime(temp_df["日期"], errors="coerce").dt.date
247
59
  temp_df["开盘"] = pd.to_numeric(temp_df["开盘"], errors="coerce")
248
60
  temp_df["最高"] = pd.to_numeric(temp_df["最高"], errors="coerce")
249
61
  temp_df["最低"] = pd.to_numeric(temp_df["最低"], errors="coerce")
@@ -267,7 +79,7 @@ def stock_zh_index_value_csindex(symbol: str = "H30374") -> pd.DataFrame:
267
79
  :rtype: pandas.DataFrame
268
80
  """
269
81
  url = (
270
- f"https://csi-web-dev.oss-cn-shanghai-finance-1-pub.aliyuncs.com/static/"
82
+ f"https://oss-ch.csindex.com.cn/static/"
271
83
  f"html/csindex/public/uploads/file/autofile/indicator/{symbol}indicator.xls"
272
84
  )
273
85
  temp_df = pd.read_excel(url)
@@ -293,174 +105,6 @@ def stock_zh_index_value_csindex(symbol: str = "H30374") -> pd.DataFrame:
293
105
  return temp_df
294
106
 
295
107
 
296
- @lru_cache()
297
- def index_value_name_funddb() -> pd.DataFrame:
298
- """
299
- funddb-指数估值-指数代码
300
- https://funddb.cn/site/index
301
- :return: pandas.DataFrame
302
- :rtype: 指数代码
303
- """
304
- url = "https://api.jiucaishuo.com/v2/guzhi/showcategory"
305
- get_current_timestamp_ms_str = __get_current_timestamp_ms()
306
- encode_params = __create_encode(
307
- act_time=str(get_current_timestamp_ms_str),
308
- authtoken="",
309
- gu_code="",
310
- pe_category="",
311
- type="pc",
312
- ver="",
313
- version="2.2.7",
314
- year="",
315
- )
316
- payload = {
317
- "type": "pc",
318
- "version": "2.2.7",
319
- "authtoken": "",
320
- "act_time": str(get_current_timestamp_ms_str),
321
- }
322
- payload.update(encode_params)
323
- r = requests.post(url, json=payload)
324
- data_json = r.json()
325
- temp_df = pd.DataFrame(data_json["data"]["right_list"])
326
- temp_df.columns = [
327
- "指数开始时间",
328
- "-",
329
- "指数名称",
330
- "指数代码",
331
- "最新PE",
332
- "最新PB",
333
- "PE分位",
334
- "PB分位",
335
- "股息率",
336
- "-",
337
- "-",
338
- "-",
339
- "更新时间",
340
- "股息率分位",
341
- "-",
342
- "-",
343
- "-",
344
- "-",
345
- "-",
346
- "-",
347
- "-",
348
- "-",
349
- "-",
350
- "-",
351
- "-",
352
- "-",
353
- "-",
354
- "-",
355
- "-",
356
- "-",
357
- ]
358
- temp_df = temp_df[
359
- [
360
- "指数名称",
361
- "最新PE",
362
- "PE分位",
363
- "最新PB",
364
- "PB分位",
365
- "股息率",
366
- "股息率分位",
367
- "指数代码",
368
- "指数开始时间",
369
- "更新时间",
370
- ]
371
- ]
372
- temp_df["指数开始时间"] = pd.to_datetime(
373
- temp_df["指数开始时间"], errors="coerce"
374
- ).dt.date
375
- temp_df["最新PE"] = pd.to_numeric(temp_df["最新PE"], errors="coerce")
376
- temp_df["PE分位"] = pd.to_numeric(temp_df["PE分位"], errors="coerce")
377
- temp_df["最新PB"] = pd.to_numeric(temp_df["最新PB"], errors="coerce")
378
- temp_df["PB分位"] = pd.to_numeric(temp_df["PB分位"], errors="coerce")
379
- temp_df["股息率"] = pd.to_numeric(temp_df["股息率"], errors="coerce")
380
- temp_df["股息率分位"] = pd.to_numeric(temp_df["股息率分位"], errors="coerce")
381
- return temp_df
382
-
383
-
384
- def index_value_hist_funddb(
385
- symbol: str = "大盘成长", indicator: str = "市盈率"
386
- ) -> pd.DataFrame:
387
- """
388
- funddb-指数估值-估值信息
389
- https://funddb.cn/site/index
390
- :param symbol: 指数名称; 通过调用 ak.index_value_name_funddb() 来获取
391
- :type symbol: str
392
- :param indicator: choice of {'市盈率', '市净率', '股息率', '风险溢价'}
393
- :type indicator: str
394
- :return: 估值信息
395
- :rtype: pandas.DataFrame
396
- """
397
- indicator_map = {
398
- "市盈率": "pe",
399
- "市净率": "pb",
400
- "股息率": "xilv",
401
- "风险溢价": "fed",
402
- }
403
- index_value_name_funddb_df = index_value_name_funddb()
404
- name_code_map = dict(
405
- zip(
406
- index_value_name_funddb_df["指数名称"],
407
- index_value_name_funddb_df["指数代码"],
408
- )
409
- )
410
- url = "https://api.jiucaishuo.com/v2/guzhi/newtubiaolinedata"
411
- get_current_timestamp_ms_str = __get_current_timestamp_ms()
412
- encode_params = __create_encode(
413
- act_time=str(get_current_timestamp_ms_str),
414
- authtoken="",
415
- gu_code=name_code_map[symbol],
416
- pe_category=indicator_map[indicator],
417
- type="pc",
418
- ver="new",
419
- version="2.2.7",
420
- year=-1,
421
- )
422
- payload = {
423
- "gu_code": name_code_map[symbol],
424
- "pe_category": indicator_map[indicator],
425
- "year": -1,
426
- "ver": "new",
427
- "type": "pc",
428
- "version": "2.2.7",
429
- "authtoken": "",
430
- "act_time": str(get_current_timestamp_ms_str),
431
- }
432
- payload.update(encode_params)
433
- r = requests.post(url, json=payload)
434
- data_json = r.json()
435
- big_df = pd.DataFrame()
436
- temp_df = pd.DataFrame(
437
- data_json["data"]["tubiao"]["series"][0]["data"],
438
- columns=["timestamp", "value"],
439
- )
440
- big_df["日期"] = (
441
- pd.to_datetime(temp_df["timestamp"], unit="ms", utc=True)
442
- .dt.tz_convert("Asia/Shanghai")
443
- .dt.date
444
- )
445
- big_df["平均值"] = pd.to_numeric(temp_df["value"])
446
- big_df[indicator] = pd.to_numeric(
447
- [item[1] for item in data_json["data"]["tubiao"]["series"][1]["data"]]
448
- )
449
- big_df["最低30"] = pd.to_numeric(
450
- [item[1] for item in data_json["data"]["tubiao"]["series"][2]["data"]]
451
- )
452
- big_df["最低10"] = pd.to_numeric(
453
- [item[1] for item in data_json["data"]["tubiao"]["series"][3]["data"]]
454
- )
455
- big_df["最高30"] = pd.to_numeric(
456
- [item[1] for item in data_json["data"]["tubiao"]["series"][4]["data"]]
457
- )
458
- big_df["最高10"] = pd.to_numeric(
459
- [item[1] for item in data_json["data"]["tubiao"]["series"][5]["data"]]
460
- )
461
- return big_df
462
-
463
-
464
108
  if __name__ == "__main__":
465
109
  stock_zh_index_hist_csindex_df = stock_zh_index_hist_csindex(
466
110
  symbol="000928", start_date="20100101", end_date="20240604"
@@ -469,11 +113,3 @@ if __name__ == "__main__":
469
113
 
470
114
  stock_zh_index_value_csindex_df = stock_zh_index_value_csindex(symbol="H30374")
471
115
  print(stock_zh_index_value_csindex_df)
472
-
473
- index_value_name_funddb_df = index_value_name_funddb()
474
- print(index_value_name_funddb_df)
475
-
476
- index_value_hist_funddb_df = index_value_hist_funddb(
477
- symbol="大盘成长", indicator="市盈率"
478
- )
479
- print(index_value_hist_funddb_df)