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
@@ -0,0 +1,228 @@
1
+ #!/usr/bin/env python
2
+ # -*- coding:utf-8 -*-
3
+ """
4
+ Date: 2025/4/5 17:30
5
+ Desc: 东方财富网-行情中心-债券市场-质押式回购
6
+ https://quote.eastmoney.com/center/gridlist.html#bond_sz_buyback
7
+ """
8
+
9
+ import pandas as pd
10
+
11
+ import requests
12
+
13
+
14
+ def bond_sh_buy_back_em() -> pd.DataFrame:
15
+ """
16
+ 东方财富网-行情中心-债券市场-上证质押式回购
17
+ https://quote.eastmoney.com/center/gridlist.html#bond_sh_buyback
18
+ :return: 上证质押式回购
19
+ :rtype: pandas.DataFrame
20
+ """
21
+ url = "https://push2.eastmoney.com/api/qt/clist/get"
22
+ params = {
23
+ "np": "1",
24
+ "fltt": "1",
25
+ "invt": "2",
26
+ "fs": "m:1+b:MK0356",
27
+ "fields": "f12,f13,f14,f1,f2,f4,f3,f152,f17,f18,f15,f16,f5,f6",
28
+ "fid": "f6",
29
+ "pn": "1",
30
+ "pz": "20",
31
+ "po": "1",
32
+ "dect": "1",
33
+ "wbp2u": "|0|0|0|web",
34
+ }
35
+ r = requests.get(url, params=params)
36
+ data_json = r.json()
37
+ temp_df = pd.DataFrame(data_json['data']['diff'])
38
+ temp_df.reset_index(inplace=True)
39
+ temp_df['index'] = temp_df['index'] + 1
40
+ temp_df.rename(
41
+ columns={
42
+ "index": "序号",
43
+ "f2": "最新价",
44
+ "f3": "涨跌幅",
45
+ "f4": "涨跌额",
46
+ "f5": "成交量",
47
+ "f6": "成交额",
48
+ "f12": "代码",
49
+ "f14": "名称",
50
+ "f15": "最高",
51
+ "f16": "最低",
52
+ "f17": "今开",
53
+ "f18": "昨收",
54
+ },
55
+ inplace=True,
56
+ )
57
+
58
+ temp_df = temp_df[[
59
+ "序号",
60
+ "代码",
61
+ "名称",
62
+ "最新价",
63
+ "涨跌额",
64
+ "涨跌幅",
65
+ "今开",
66
+ "最高",
67
+ "最低",
68
+ "昨收",
69
+ "成交量",
70
+ "成交额",
71
+ ]]
72
+ temp_df["最新价"] = pd.to_numeric(temp_df["最新价"], errors="coerce") / 1000
73
+ temp_df["涨跌幅"] = pd.to_numeric(temp_df["涨跌幅"], errors="coerce") / 100
74
+ temp_df["涨跌额"] = pd.to_numeric(temp_df["涨跌额"], errors="coerce") / 1000
75
+ temp_df["今开"] = pd.to_numeric(temp_df["今开"], errors="coerce") / 1000
76
+ temp_df["最高"] = pd.to_numeric(temp_df["最高"], errors="coerce") / 1000
77
+ temp_df["最低"] = pd.to_numeric(temp_df["最低"], errors="coerce") / 1000
78
+ temp_df["昨收"] = pd.to_numeric(temp_df["昨收"], errors="coerce") / 1000
79
+ temp_df["成交量"] = pd.to_numeric(temp_df["成交量"], errors="coerce")
80
+ temp_df["成交额"] = pd.to_numeric(temp_df["成交额"], errors="coerce")
81
+ return temp_df
82
+
83
+
84
+ def bond_sz_buy_back_em() -> pd.DataFrame:
85
+ """
86
+ 东方财富网-行情中心-债券市场-深证质押式回购
87
+ https://quote.eastmoney.com/center/gridlist.html#bond_sz_buyback
88
+ :return: 深证质押式回购
89
+ :rtype: pandas.DataFrame
90
+ """
91
+ url = "https://push2.eastmoney.com/api/qt/clist/get"
92
+ params = {
93
+ "np": "1",
94
+ "fltt": "1",
95
+ "invt": "2",
96
+ "fs": "m:0+b:MK0356",
97
+ "fields": "f12,f13,f14,f1,f2,f4,f3,f152,f17,f18,f15,f16,f5,f6",
98
+ "fid": "f6",
99
+ "pn": "1",
100
+ "pz": "20",
101
+ "po": "1",
102
+ "dect": "1",
103
+ "wbp2u": "|0|0|0|web",
104
+ }
105
+ r = requests.get(url, params=params)
106
+ data_json = r.json()
107
+ temp_df = pd.DataFrame(data_json['data']['diff'])
108
+ temp_df.reset_index(inplace=True)
109
+ temp_df['index'] = temp_df['index'] + 1
110
+ temp_df.rename(
111
+ columns={
112
+ "index": "序号",
113
+ "f2": "最新价",
114
+ "f3": "涨跌幅",
115
+ "f4": "涨跌额",
116
+ "f5": "成交量",
117
+ "f6": "成交额",
118
+ "f12": "代码",
119
+ "f14": "名称",
120
+ "f15": "最高",
121
+ "f16": "最低",
122
+ "f17": "今开",
123
+ "f18": "昨收",
124
+ },
125
+ inplace=True,
126
+ )
127
+
128
+ temp_df = temp_df[[
129
+ "序号",
130
+ "代码",
131
+ "名称",
132
+ "最新价",
133
+ "涨跌额",
134
+ "涨跌幅",
135
+ "今开",
136
+ "最高",
137
+ "最低",
138
+ "昨收",
139
+ "成交量",
140
+ "成交额",
141
+ ]]
142
+ temp_df["最新价"] = pd.to_numeric(temp_df["最新价"], errors="coerce") / 1000
143
+ temp_df["涨跌幅"] = pd.to_numeric(temp_df["涨跌幅"], errors="coerce") / 100
144
+ temp_df["涨跌额"] = pd.to_numeric(temp_df["涨跌额"], errors="coerce") / 1000
145
+ temp_df["今开"] = pd.to_numeric(temp_df["今开"], errors="coerce") / 1000
146
+ temp_df["最高"] = pd.to_numeric(temp_df["最高"], errors="coerce") / 1000
147
+ temp_df["最低"] = pd.to_numeric(temp_df["最低"], errors="coerce") / 1000
148
+ temp_df["昨收"] = pd.to_numeric(temp_df["昨收"], errors="coerce") / 1000
149
+ temp_df["成交量"] = pd.to_numeric(temp_df["成交量"], errors="coerce")
150
+ temp_df["成交额"] = pd.to_numeric(temp_df["成交额"], errors="coerce")
151
+ return temp_df
152
+
153
+
154
+ def bond_buy_back_hist_em(symbol: str = "204001"):
155
+ """
156
+ 东方财富网-行情中心-债券市场-质押式回购-历史数据
157
+ https://quote.eastmoney.com/center/gridlist.html#bond_sh_buyback
158
+ :param symbol: 质押式回购代码
159
+ :type symbol: str
160
+ :return: 历史数据
161
+ :rtype: pandas.DataFrame
162
+ """
163
+ if symbol.startswith("1"):
164
+ market_id = "0"
165
+ else:
166
+ market_id = "1"
167
+ url = "https://push2his.eastmoney.com/api/qt/stock/kline/get"
168
+ params = {
169
+ "secid": f"{market_id}.{symbol}",
170
+ "klt": "101",
171
+ "fqt": "1",
172
+ "lmt": "10000",
173
+ "end": "20500000",
174
+ "iscca": "1",
175
+ "fields1": "f1,f2,f3,f4,f5,f6,f7,f8",
176
+ "fields2": "f51,f52,f53,f54,f55,f56,f57,f58,f59,f60,f61,f62,f63,f64",
177
+ "forcect": "1"
178
+ }
179
+ r = requests.get(url, params=params)
180
+ data_json = r.json()
181
+ temp_df = pd.DataFrame([item.split(',') for item in data_json['data']['klines']])
182
+ temp_df.columns = [
183
+ "日期",
184
+ "开盘",
185
+ "收盘",
186
+ "最高",
187
+ "最低",
188
+ "成交量",
189
+ "成交额",
190
+ "-",
191
+ "-",
192
+ "-",
193
+ "-",
194
+ "-",
195
+ "-",
196
+ "-",
197
+ ]
198
+ temp_df = temp_df[[
199
+ "日期",
200
+ "开盘",
201
+ "收盘",
202
+ "最高",
203
+ "最低",
204
+ "成交量",
205
+ "成交额",
206
+ ]]
207
+ temp_df["日期"] = pd.to_datetime(temp_df["日期"], errors="coerce").dt.date
208
+ temp_df["开盘"] = pd.to_numeric(temp_df["开盘"], errors="coerce")
209
+ temp_df["收盘"] = pd.to_numeric(temp_df["收盘"], errors="coerce")
210
+ temp_df["最高"] = pd.to_numeric(temp_df["最高"], errors="coerce")
211
+ temp_df["最低"] = pd.to_numeric(temp_df["最低"], errors="coerce")
212
+ temp_df["成交量"] = pd.to_numeric(temp_df["成交量"], errors="coerce")
213
+ temp_df["成交额"] = pd.to_numeric(temp_df["成交额"], errors="coerce")
214
+ return temp_df
215
+
216
+
217
+ if __name__ == "__main__":
218
+ bond_sh_buy_back_em_df = bond_sh_buy_back_em()
219
+ print(bond_sh_buy_back_em_df)
220
+
221
+ bond_sz_buy_back_em_df = bond_sz_buy_back_em()
222
+ print(bond_sz_buy_back_em_df)
223
+
224
+ bond_buy_back_hist_em_df = bond_buy_back_hist_em(symbol="204001")
225
+ print(bond_buy_back_hist_em_df)
226
+
227
+ bond_buy_back_hist_em_df = bond_buy_back_hist_em(symbol="131810")
228
+ print(bond_buy_back_hist_em_df)
@@ -5,6 +5,7 @@ Date: 2023/9/12 16:50
5
5
  Desc: 新浪财经-债券-可转债
6
6
  https://money.finance.sina.com.cn/bond/info/sz128039.html
7
7
  """
8
+
8
9
  from io import StringIO
9
10
 
10
11
  import pandas as pd
@@ -1,24 +1,26 @@
1
1
  # -*- coding:utf-8 -*-
2
2
  # !/usr/bin/env python
3
3
  """
4
- Date: 2023/5/4 22:46
4
+ Date: 2024/8/14 11:30
5
5
  Desc: 同花顺-数据中心-可转债
6
- http://data.10jqka.com.cn/ipo/bond/
6
+ https://data.10jqka.com.cn/ipo/bond/
7
7
  """
8
- import requests
8
+
9
9
  import pandas as pd
10
+ import requests
10
11
 
11
12
 
12
13
  def bond_zh_cov_info_ths() -> pd.DataFrame:
13
14
  """
14
15
  同花顺-数据中心-可转债
15
- http://data.10jqka.com.cn/ipo/bond/
16
+ https://data.10jqka.com.cn/ipo/bond/
16
17
  :return: 可转债行情
17
18
  :rtype: pandas.DataFrame
18
19
  """
19
- url = "http://data.10jqka.com.cn/ipo/kzz/"
20
+ url = "https://data.10jqka.com.cn/ipo/kzz/"
20
21
  headers = {
21
- "User-Agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/89.0.4389.90 Safari/537.36",
22
+ "User-Agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) "
23
+ "Chrome/89.0.4389.90 Safari/537.36",
22
24
  }
23
25
  r = requests.get(url, headers=headers)
24
26
  data_json = r.json()
@@ -67,12 +69,18 @@ def bond_zh_cov_info_ths() -> pd.DataFrame:
67
69
  "中签率",
68
70
  ]
69
71
  ]
70
- temp_df["申购日期"] = pd.to_datetime(temp_df["申购日期"], format="%Y-%m-%d").dt.date
71
- temp_df["中签公布日"] = pd.to_datetime(temp_df["中签公布日"], format="%Y-%m-%d").dt.date
72
+ temp_df["申购日期"] = pd.to_datetime(
73
+ temp_df["申购日期"], format="%Y-%m-%d", errors="coerce"
74
+ ).dt.date
75
+ temp_df["中签公布日"] = pd.to_datetime(
76
+ temp_df["中签公布日"], format="%Y-%m-%d", errors="coerce"
77
+ ).dt.date
72
78
  temp_df["上市日期"] = pd.to_datetime(
73
79
  temp_df["上市日期"], format="%Y-%m-%d", errors="coerce"
74
80
  ).dt.date
75
- temp_df["到期时间"] = pd.to_datetime(temp_df["到期时间"], format="%Y-%m-%d").dt.date
81
+ temp_df["到期时间"] = pd.to_datetime(
82
+ temp_df["到期时间"], format="%Y-%m-%d", errors="coerce"
83
+ ).dt.date
76
84
  temp_df["每股获配额"] = pd.to_numeric(temp_df["每股获配额"], errors="coerce")
77
85
  temp_df["计划发行量"] = pd.to_numeric(temp_df["计划发行量"], errors="coerce")
78
86
  temp_df["实际发行量"] = pd.to_numeric(temp_df["实际发行量"], errors="coerce")
@@ -4,6 +4,7 @@
4
4
  Date: 2022/9/20 17:46
5
5
  Desc: 中国债券信息网-中债指数-中债指数族系-总指数-综合类指数
6
6
  """
7
+
7
8
  import pandas as pd
8
9
  import requests
9
10
 
@@ -58,17 +59,17 @@ def bond_new_composite_index_cbond(
58
59
  url = "https://yield.chinabond.com.cn/cbweb-mn/indices/singleIndexQuery"
59
60
  params = {
60
61
  "indexid": "8a8b2ca0332abed20134ea76d8885831",
61
- "": "",
62
+ "": "", # noqa: F601
62
63
  "qxlxt": period_map[period],
63
- "": "",
64
+ "": "", # noqa: F601
64
65
  "ltcslx": "",
65
- "": "",
66
- "zslxt": indicator_map[indicator],
67
- "": "",
68
- "zslxt": indicator_map[indicator],
69
- "": "",
66
+ "": "", # noqa: F601
67
+ "zslxt": indicator_map[indicator], # noqa: F601
68
+ "": "", # noqa: F601
69
+ "zslxt": indicator_map[indicator], # noqa: F601
70
+ "": "", # noqa: F601
70
71
  "lx": "1",
71
- "": "",
72
+ "": "", # noqa: F601
72
73
  "locale": "",
73
74
  }
74
75
  r = requests.post(url, params=params)
@@ -79,8 +80,12 @@ def bond_new_composite_index_cbond(
79
80
  )
80
81
  temp_df.reset_index(inplace=True)
81
82
  temp_df.columns = ["date", "value"]
82
- temp_df['date'] = temp_df['date'].astype(float)
83
- temp_df["date"] = pd.to_datetime(temp_df["date"], unit="ms", errors="coerce", utc=True).dt.tz_convert("Asia/Shanghai").dt.date
83
+ temp_df["date"] = temp_df["date"].astype(float)
84
+ temp_df["date"] = (
85
+ pd.to_datetime(temp_df["date"], unit="ms", errors="coerce", utc=True)
86
+ .dt.tz_convert("Asia/Shanghai")
87
+ .dt.date
88
+ )
84
89
  temp_df["value"] = pd.to_numeric(temp_df["value"], errors="coerce")
85
90
  return temp_df
86
91
 
@@ -135,13 +140,13 @@ def bond_composite_index_cbond(
135
140
  url = "https://yield.chinabond.com.cn/cbweb-mn/indices/singleIndexQuery"
136
141
  params = {
137
142
  "indexid": "2c90818811afed8d0111c0c672b31578",
138
- "": "",
143
+ "": "", # noqa: F601
139
144
  "qxlxt": period_map[period],
140
- "": "",
145
+ "": "", # noqa: F601
141
146
  "zslxt": indicator_map[indicator],
142
- "": "",
147
+ "": "", # noqa: F601
143
148
  "lx": "1",
144
- "": "",
149
+ "": "", # noqa: F601
145
150
  "locale": "",
146
151
  }
147
152
  r = requests.post(url, params=params)
@@ -1,18 +1,20 @@
1
1
  #!/usr/bin/env python
2
2
  # -*- coding:utf-8 -*-
3
3
  """
4
- Date: 2024/3/12 14:00
4
+ Date: 2024/10/1 17:00
5
5
  Desc: 中国外汇交易中心暨全国银行间同业拆借中心
6
6
  中国外汇交易中心暨全国银行间同业拆借中心-市场数据-债券市场行情-现券市场做市报价
7
7
  中国外汇交易中心暨全国银行间同业拆借中心-市场数据-债券市场行情-现券市场成交行情
8
8
  https://www.chinamoney.com.cn/chinese/mkdatabond/
9
9
  """
10
+
10
11
  from io import StringIO
11
12
 
12
13
  import pandas as pd
13
14
  import requests
14
15
 
15
16
  from akshare.bond.bond_china_money import bond_china_close_return_map
17
+ from akshare.utils.cons import headers
16
18
 
17
19
 
18
20
  def bond_spot_quote() -> pd.DataFrame:
@@ -24,9 +26,6 @@ def bond_spot_quote() -> pd.DataFrame:
24
26
  """
25
27
  bond_china_close_return_map()
26
28
  url = "https://www.chinamoney.com.cn/ags/ms/cm-u-md-bond/CbMktMakQuot"
27
- headers = {
28
- "User-Agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/78.0.3904.108 Safari/537.36",
29
- }
30
29
  payload = {
31
30
  "flag": "1",
32
31
  "lang": "cn",
@@ -61,16 +60,24 @@ def bond_spot_quote() -> pd.DataFrame:
61
60
  "买入/卖出收益率",
62
61
  ]
63
62
  ]
64
- temp_df["买入净价"] = temp_df["买入/卖出净价"].str.split("/", expand=True).iloc[:, 0]
65
- temp_df["卖出净价"] = temp_df["买入/卖出净价"].str.split("/", expand=True).iloc[:, 1]
66
- temp_df["买入收益率"] = temp_df["买入/卖出收益率"].str.split("/", expand=True).iloc[:, 0]
67
- temp_df["卖出收益率"] = temp_df["买入/卖出收益率"].str.split("/", expand=True).iloc[:, 1]
63
+ temp_df["买入净价"] = (
64
+ temp_df["买入/卖出净价"].str.split("/", expand=True).iloc[:, 0]
65
+ )
66
+ temp_df["卖出净价"] = (
67
+ temp_df["买入/卖出净价"].str.split("/", expand=True).iloc[:, 1]
68
+ )
69
+ temp_df["买入收益率"] = (
70
+ temp_df["买入/卖出收益率"].str.split("/", expand=True).iloc[:, 0]
71
+ )
72
+ temp_df["卖出收益率"] = (
73
+ temp_df["买入/卖出收益率"].str.split("/", expand=True).iloc[:, 1]
74
+ )
68
75
  del temp_df["买入/卖出净价"]
69
76
  del temp_df["买入/卖出收益率"]
70
- temp_df['买入净价'] = pd.to_numeric(temp_df['买入净价'], errors="coerce")
71
- temp_df['卖出净价'] = pd.to_numeric(temp_df['卖出净价'], errors="coerce")
72
- temp_df['买入收益率'] = pd.to_numeric(temp_df['买入收益率'], errors="coerce")
73
- temp_df['卖出收益率'] = pd.to_numeric(temp_df['卖出收益率'], errors="coerce")
77
+ temp_df["买入净价"] = pd.to_numeric(temp_df["买入净价"], errors="coerce")
78
+ temp_df["卖出净价"] = pd.to_numeric(temp_df["卖出净价"], errors="coerce")
79
+ temp_df["买入收益率"] = pd.to_numeric(temp_df["买入收益率"], errors="coerce")
80
+ temp_df["卖出收益率"] = pd.to_numeric(temp_df["卖出收益率"], errors="coerce")
74
81
  return temp_df
75
82
 
76
83
 
@@ -82,9 +89,6 @@ def bond_spot_deal() -> pd.DataFrame:
82
89
  :rtype: pandas.DataFrame
83
90
  """
84
91
  url = "https://www.chinamoney.com.cn/ags/ms/cm-u-md-bond/CbtPri"
85
- headers = {
86
- "User-Agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/78.0.3904.108 Safari/537.36",
87
- }
88
92
  payload = {
89
93
  "flag": "1",
90
94
  "lang": "cn",
@@ -127,16 +131,16 @@ def bond_spot_deal() -> pd.DataFrame:
127
131
  "交易量",
128
132
  ]
129
133
  ]
130
- temp_df['成交净价'] = pd.to_numeric(temp_df['成交净价'], errors="coerce")
131
- temp_df['最新收益率'] = pd.to_numeric(temp_df['最新收益率'], errors="coerce")
132
- temp_df['涨跌'] = pd.to_numeric(temp_df['涨跌'], errors="coerce")
133
- temp_df['加权收益率'] = pd.to_numeric(temp_df['加权收益率'], errors="coerce")
134
- temp_df['交易量'] = pd.to_numeric(temp_df['交易量'], errors="coerce")
134
+ temp_df["成交净价"] = pd.to_numeric(temp_df["成交净价"], errors="coerce")
135
+ temp_df["最新收益率"] = pd.to_numeric(temp_df["最新收益率"], errors="coerce")
136
+ temp_df["涨跌"] = pd.to_numeric(temp_df["涨跌"], errors="coerce")
137
+ temp_df["加权收益率"] = pd.to_numeric(temp_df["加权收益率"], errors="coerce")
138
+ temp_df["交易量"] = pd.to_numeric(temp_df["交易量"], errors="coerce")
135
139
  return temp_df
136
140
 
137
141
 
138
142
  def bond_china_yield(
139
- start_date: str = "20200204", end_date: str = "20210124"
143
+ start_date: str = "20200204", end_date: str = "20210124"
140
144
  ) -> pd.DataFrame:
141
145
  """
142
146
  中国债券信息网-国债及其他债券收益率曲线
@@ -152,28 +156,25 @@ def bond_china_yield(
152
156
  """
153
157
  url = "https://yield.chinabond.com.cn/cbweb-pbc-web/pbc/historyQuery"
154
158
  params = {
155
- "startDate": '-'.join([start_date[:4], start_date[4:6], start_date[6:]]),
156
- "endDate": '-'.join([end_date[:4], end_date[4:6], end_date[6:]]),
159
+ "startDate": "-".join([start_date[:4], start_date[4:6], start_date[6:]]),
160
+ "endDate": "-".join([end_date[:4], end_date[4:6], end_date[6:]]),
157
161
  "gjqx": "0",
158
162
  "qxId": "ycqx",
159
163
  "locale": "cn_ZH",
160
164
  }
161
- headers = {
162
- "User-Agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/79.0.3945.130 Safari/537.36",
163
- }
164
165
  res = requests.get(url, params=params, headers=headers)
165
166
  data_text = res.text.replace("&nbsp", "")
166
167
  data_df = pd.read_html(StringIO(data_text), header=0)[1]
167
- data_df['日期'] = pd.to_datetime(data_df['日期'], errors="coerce").dt.date
168
- data_df['3月'] = pd.to_numeric(data_df['3月'], errors="coerce")
169
- data_df['6月'] = pd.to_numeric(data_df['6月'], errors="coerce")
170
- data_df['1年'] = pd.to_numeric(data_df['1年'], errors="coerce")
171
- data_df['3年'] = pd.to_numeric(data_df['3年'], errors="coerce")
172
- data_df['5年'] = pd.to_numeric(data_df['5年'], errors="coerce")
173
- data_df['7年'] = pd.to_numeric(data_df['7年'], errors="coerce")
174
- data_df['10年'] = pd.to_numeric(data_df['10年'], errors="coerce")
175
- data_df['30年'] = pd.to_numeric(data_df['30年'], errors="coerce")
176
- data_df.sort_values(by='日期', inplace=True)
168
+ data_df["日期"] = pd.to_datetime(data_df["日期"], errors="coerce").dt.date
169
+ data_df["3月"] = pd.to_numeric(data_df["3月"], errors="coerce")
170
+ data_df["6月"] = pd.to_numeric(data_df["6月"], errors="coerce")
171
+ data_df["1年"] = pd.to_numeric(data_df["1年"], errors="coerce")
172
+ data_df["3年"] = pd.to_numeric(data_df["3年"], errors="coerce")
173
+ data_df["5年"] = pd.to_numeric(data_df["5年"], errors="coerce")
174
+ data_df["7年"] = pd.to_numeric(data_df["7年"], errors="coerce")
175
+ data_df["10年"] = pd.to_numeric(data_df["10年"], errors="coerce")
176
+ data_df["30年"] = pd.to_numeric(data_df["30年"], errors="coerce")
177
+ data_df.sort_values(by="日期", inplace=True)
177
178
  data_df.reset_index(inplace=True, drop=True)
178
179
  return data_df
179
180
 
@@ -185,7 +186,5 @@ if __name__ == "__main__":
185
186
  bond_spot_deal_df = bond_spot_deal()
186
187
  print(bond_spot_deal_df)
187
188
 
188
- bond_china_yield_df = bond_china_yield(
189
- start_date="20210201", end_date="20220201"
190
- )
189
+ bond_china_yield_df = bond_china_yield(start_date="20210201", end_date="20220201")
191
190
  print(bond_china_yield_df)
@@ -382,7 +382,7 @@ if __name__ == "__main__":
382
382
  print(bond_china_close_return_df)
383
383
 
384
384
  macro_china_swap_rate_df = macro_china_swap_rate(
385
- start_date="20240501", end_date="20240531"
385
+ start_date="20251010", end_date="20251208"
386
386
  )
387
387
  print(macro_china_swap_rate_df)
388
388
 
@@ -1,14 +1,15 @@
1
1
  #!/usr/bin/env python
2
2
  # -*- coding:utf-8 -*-
3
3
  """
4
- Date: 2024/3/20 15:00
4
+ Date: 2025/5/16 19:00
5
5
  Desc: 债券-集思录-可转债
6
- 集思录:https://app.jisilu.cn/data/cbnew/#cb
6
+ 集思录:https://www.jisilu.cn/data/cbnew/#cb
7
7
  """
8
8
 
9
9
  from io import StringIO
10
10
  import pandas as pd
11
11
  import requests
12
+ import time
12
13
 
13
14
  from akshare.utils import demjson
14
15
 
@@ -30,13 +31,13 @@ def bond_cb_index_jsl() -> pd.DataFrame:
30
31
  def bond_cb_jsl(cookie: str = None) -> pd.DataFrame:
31
32
  """
32
33
  集思录可转债
33
- https://app.jisilu.cn/data/cbnew/#cb
34
+ https://www.jisilu.cn/data/cbnew/#cb
34
35
  :param cookie: 输入获取到的游览器 cookie
35
36
  :type cookie: str
36
37
  :return: 集思录可转债
37
38
  :rtype: pandas.DataFrame
38
39
  """
39
- url = "https://app.jisilu.cn/data/cbnew/cb_list_new/"
40
+ url = "https://www.jisilu.cn/data/cbnew/cb_list_new/"
40
41
  headers = {
41
42
  "accept": "application/json, text/javascript, */*; q=0.01",
42
43
  "accept-encoding": "gzip, deflate, br",
@@ -45,9 +46,9 @@ def bond_cb_jsl(cookie: str = None) -> pd.DataFrame:
45
46
  "content-length": "220",
46
47
  "content-type": "application/x-www-form-urlencoded; charset=UTF-8",
47
48
  "cookie": cookie,
48
- "origin": "https://app.jisilu.cn",
49
+ "origin": "https://www.jisilu.cn",
49
50
  "pragma": "no-cache",
50
- "referer": "https://app.jisilu.cn/data/cbnew/",
51
+ "referer": "https://www.jisilu.cn/data/cbnew/",
51
52
  "sec-ch-ua": '" Not;A Brand";v="99", "Google Chrome";v="91", "Chromium";v="91"',
52
53
  "sec-ch-ua-mobile": "?0",
53
54
  "sec-fetch-dest": "empty",
@@ -58,7 +59,7 @@ def bond_cb_jsl(cookie: str = None) -> pd.DataFrame:
58
59
  "x-requested-with": "XMLHttpRequest",
59
60
  }
60
61
  params = {
61
- "___jsl": "LST___t=1627021692978",
62
+ "___jsl": f"LST___t={int(time.time() * 1000)}",
62
63
  }
63
64
  payload = {
64
65
  "fprice": "",
@@ -141,7 +142,7 @@ def bond_cb_jsl(cookie: str = None) -> pd.DataFrame:
141
142
  "双低",
142
143
  ]
143
144
  ]
144
- temp_df["到期时间"] = pd.to_datetime(temp_df["到期时间"]).dt.date
145
+ temp_df["到期时间"] = pd.to_datetime(temp_df["到期时间"], errors="coerce").dt.date
145
146
  temp_df["现价"] = pd.to_numeric(temp_df["现价"], errors="coerce")
146
147
  temp_df["涨跌幅"] = pd.to_numeric(temp_df["涨跌幅"], errors="coerce")
147
148
  temp_df["正股价"] = pd.to_numeric(temp_df["正股价"], errors="coerce")
@@ -296,7 +297,7 @@ def bond_cb_redeem_jsl() -> pd.DataFrame:
296
297
  def bond_cb_adj_logs_jsl(symbol: str = "128013") -> pd.DataFrame:
297
298
  """
298
299
  集思录-可转债转股价-调整记录
299
- https://app.jisilu.cn/data/cbnew/#cb
300
+ https://www.jisilu.cn/data/cbnew/#cb
300
301
  :param symbol: 可转债代码
301
302
  :type symbol: str
302
303
  :return: 转股价调整记录