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
@@ -0,0 +1,232 @@
1
+ # -*- coding:utf-8 -*-
2
+ # !/usr/bin/env python
3
+ """
4
+ Date: 2024/8/10 15:30
5
+ Desc: 搜猪-生猪大数据-各省均价实时排行榜
6
+ https://www.soozhu.com/price/data/center/
7
+ """
8
+
9
+ import pandas as pd
10
+ import requests
11
+ from bs4 import BeautifulSoup
12
+
13
+
14
+ def spot_hog_soozhu() -> pd.DataFrame:
15
+ """
16
+ 搜猪-生猪大数据-各省均价实时排行榜
17
+ https://www.soozhu.com/price/data/center/
18
+ :return: 各省均价实时排行榜
19
+ :rtype: pandas.DataFrame
20
+ """
21
+ session = requests.session()
22
+ url = "https://www.soozhu.com/price/data/center/"
23
+ r = session.get(url)
24
+ soup = BeautifulSoup(r.text, features="lxml")
25
+ token = soup.find(name="input", attrs={"name": "csrfmiddlewaretoken"})["value"]
26
+ url = "https://www.soozhu.com/price/data/center/"
27
+ payload = {"act": "mapdata", "csrfmiddlewaretoken": token}
28
+ r = session.post(url, data=payload)
29
+ data_json = r.json()
30
+ temp_df = pd.DataFrame(data_json["vlist"])
31
+ price_list = [item[0] for item in temp_df["value"]]
32
+ pct_list = [item[1] for item in temp_df["value"]]
33
+ big_df = pd.DataFrame([temp_df["name"].values, price_list, pct_list]).T
34
+ big_df.columns = ["省份", "价格", "涨跌幅"]
35
+ big_df["价格"] = pd.to_numeric(big_df["价格"], errors="coerce")
36
+ big_df["涨跌幅"] = pd.to_numeric(big_df["涨跌幅"], errors="coerce")
37
+ big_df["涨跌幅"] = round(big_df["涨跌幅"], 2)
38
+ return big_df
39
+
40
+
41
+ def spot_hog_year_trend_soozhu() -> pd.DataFrame:
42
+ """
43
+ 搜猪-生猪大数据-今年以来全国出栏均价走势
44
+ https://www.soozhu.com/price/data/center/
45
+ :return: 今年以来全国出栏均价走势
46
+ :rtype: pandas.DataFrame
47
+ """
48
+ session = requests.session()
49
+ url = "https://www.soozhu.com/price/data/center/"
50
+ r = session.get(url)
51
+ soup = BeautifulSoup(r.text, features="lxml")
52
+ token = soup.find(name="input", attrs={"name": "csrfmiddlewaretoken"})["value"]
53
+ url = "https://www.soozhu.com/price/data/center/"
54
+ payload = {"act": "yeartrend", "csrfmiddlewaretoken": token}
55
+ r = session.post(url, data=payload)
56
+ data_json = r.json()
57
+ temp_df = pd.DataFrame(data_json["nationlist"])
58
+ temp_df.columns = ["日期", "价格"]
59
+ temp_df["日期"] = pd.to_datetime(temp_df["日期"], errors="coerce").dt.date
60
+ temp_df["价格"] = pd.to_numeric(temp_df["价格"], errors="coerce")
61
+ temp_df.sort_values(by=["日期"], ignore_index=True, inplace=True)
62
+ return temp_df
63
+
64
+
65
+ def spot_hog_lean_price_soozhu() -> pd.DataFrame:
66
+ """
67
+ 搜猪-生猪大数据-全国瘦肉型肉猪
68
+ https://www.soozhu.com/price/data/center/
69
+ :return: 全国瘦肉型肉猪
70
+ :rtype: pandas.DataFrame
71
+ """
72
+ session = requests.session()
73
+ url = "https://www.soozhu.com/price/data/center/"
74
+ r = session.get(url)
75
+ soup = BeautifulSoup(r.text, features="lxml")
76
+ token = soup.find(name="input", attrs={"name": "csrfmiddlewaretoken"})["value"]
77
+ url = "https://www.soozhu.com/price/data/center/"
78
+ payload = {"act": "pricetrend", "indid": "", "csrfmiddlewaretoken": token}
79
+ r = session.post(url, data=payload)
80
+ data_json = r.json()
81
+ temp_df = pd.DataFrame(data_json["datalist"])
82
+ temp_df.columns = ["日期", "价格"]
83
+ temp_df["日期"] = pd.to_datetime(temp_df["日期"], errors="coerce").dt.date
84
+ temp_df["价格"] = pd.to_numeric(temp_df["价格"], errors="coerce")
85
+ temp_df.sort_values(by=["日期"], ignore_index=True, inplace=True)
86
+ return temp_df
87
+
88
+
89
+ def spot_hog_three_way_soozhu() -> pd.DataFrame:
90
+ """
91
+ 搜猪-生猪大数据-全国三元仔猪
92
+ https://www.soozhu.com/price/data/center/
93
+ :return: 全国三元仔猪
94
+ :rtype: pandas.DataFrame
95
+ """
96
+ session = requests.session()
97
+ url = "https://www.soozhu.com/price/data/center/"
98
+ r = session.get(url)
99
+ soup = BeautifulSoup(r.text, features="lxml")
100
+ token = soup.find(name="input", attrs={"name": "csrfmiddlewaretoken"})["value"]
101
+ url = "https://www.soozhu.com/price/data/center/"
102
+ payload = {"act": "pricetrend", "indid": "4", "csrfmiddlewaretoken": token}
103
+ r = session.post(url, data=payload)
104
+ data_json = r.json()
105
+ temp_df = pd.DataFrame(data_json["datalist"])
106
+ temp_df.columns = ["日期", "价格"]
107
+ temp_df["日期"] = pd.to_datetime(temp_df["日期"], errors="coerce").dt.date
108
+ temp_df["价格"] = pd.to_numeric(temp_df["价格"], errors="coerce")
109
+ temp_df.sort_values(by=["日期"], ignore_index=True, inplace=True)
110
+ return temp_df
111
+
112
+
113
+ def spot_hog_crossbred_soozhu() -> pd.DataFrame:
114
+ """
115
+ 搜猪-生猪大数据-全国后备二元母猪
116
+ https://www.soozhu.com/price/data/center/
117
+ :return: 全国后备二元母猪
118
+ :rtype: pandas.DataFrame
119
+ """
120
+ session = requests.session()
121
+ url = "https://www.soozhu.com/price/data/center/"
122
+ r = session.get(url)
123
+ soup = BeautifulSoup(r.text, features="lxml")
124
+ token = soup.find(name="input", attrs={"name": "csrfmiddlewaretoken"})["value"]
125
+ url = "https://www.soozhu.com/price/data/center/"
126
+ payload = {"act": "pricetrend", "indid": "6", "csrfmiddlewaretoken": token}
127
+ r = session.post(url, data=payload)
128
+ data_json = r.json()
129
+ temp_df = pd.DataFrame(data_json["datalist"])
130
+ temp_df.columns = ["日期", "价格"]
131
+ temp_df["日期"] = pd.to_datetime(temp_df["日期"], errors="coerce").dt.date
132
+ temp_df["价格"] = pd.to_numeric(temp_df["价格"], errors="coerce")
133
+ temp_df.sort_values(by=["日期"], ignore_index=True, inplace=True)
134
+ return temp_df
135
+
136
+
137
+ def spot_corn_price_soozhu() -> pd.DataFrame:
138
+ """
139
+ 搜猪-生猪大数据-全国玉米价格走势
140
+ https://www.soozhu.com/price/data/center/
141
+ :return: 全国玉米价格走势
142
+ :rtype: pandas.DataFrame
143
+ """
144
+ session = requests.session()
145
+ url = "https://www.soozhu.com/price/data/center/"
146
+ r = session.get(url)
147
+ soup = BeautifulSoup(r.text, features="lxml")
148
+ token = soup.find(name="input", attrs={"name": "csrfmiddlewaretoken"})["value"]
149
+ url = "https://www.soozhu.com/price/data/center/"
150
+ payload = {"act": "pricetrend", "indid": "8", "csrfmiddlewaretoken": token}
151
+ r = session.post(url, data=payload)
152
+ data_json = r.json()
153
+ temp_df = pd.DataFrame(data_json["datalist"])
154
+ temp_df.columns = ["日期", "价格"]
155
+ temp_df["日期"] = pd.to_datetime(temp_df["日期"], errors="coerce").dt.date
156
+ temp_df["价格"] = pd.to_numeric(temp_df["价格"], errors="coerce")
157
+ temp_df.sort_values(by=["日期"], ignore_index=True, inplace=True)
158
+ return temp_df
159
+
160
+
161
+ def spot_soybean_price_soozhu() -> pd.DataFrame:
162
+ """
163
+ 搜猪-生猪大数据-全国豆粕价格走势
164
+ https://www.soozhu.com/price/data/center/
165
+ :return: 全国豆粕价格走势
166
+ :rtype: pandas.DataFrame
167
+ """
168
+ session = requests.session()
169
+ url = "https://www.soozhu.com/price/data/center/"
170
+ r = session.get(url)
171
+ soup = BeautifulSoup(r.text, features="lxml")
172
+ token = soup.find(name="input", attrs={"name": "csrfmiddlewaretoken"})["value"]
173
+ url = "https://www.soozhu.com/price/data/center/"
174
+ payload = {"act": "pricetrend", "indid": "9", "csrfmiddlewaretoken": token}
175
+ r = session.post(url, data=payload)
176
+ data_json = r.json()
177
+ temp_df = pd.DataFrame(data_json["datalist"])
178
+ temp_df.columns = ["日期", "价格"]
179
+ temp_df["日期"] = pd.to_datetime(temp_df["日期"], errors="coerce").dt.date
180
+ temp_df["价格"] = pd.to_numeric(temp_df["价格"], errors="coerce")
181
+ temp_df.sort_values(by=["日期"], ignore_index=True, inplace=True)
182
+ return temp_df
183
+
184
+
185
+ def spot_mixed_feed_soozhu() -> pd.DataFrame:
186
+ """
187
+ 搜猪-生猪大数据-全国育肥猪合料(含自配料)半月走势
188
+ https://www.soozhu.com/price/data/center/
189
+ :return: 全国育肥猪合料(含自配料)半月走势
190
+ :rtype: pandas.DataFrame
191
+ """
192
+ session = requests.session()
193
+ url = "https://www.soozhu.com/price/data/center/"
194
+ r = session.get(url)
195
+ soup = BeautifulSoup(r.text, features="lxml")
196
+ token = soup.find(name="input", attrs={"name": "csrfmiddlewaretoken"})["value"]
197
+ url = "https://www.soozhu.com/price/data/center/"
198
+ payload = {"act": "pricetrend", "indid": "11", "csrfmiddlewaretoken": token}
199
+ r = session.post(url, data=payload)
200
+ data_json = r.json()
201
+ temp_df = pd.DataFrame(data_json["datalist"])
202
+ temp_df.columns = ["日期", "价格"]
203
+ temp_df["日期"] = pd.to_datetime(temp_df["日期"], errors="coerce").dt.date
204
+ temp_df["价格"] = pd.to_numeric(temp_df["价格"], errors="coerce")
205
+ temp_df.sort_values(by=["日期"], ignore_index=True, inplace=True)
206
+ return temp_df
207
+
208
+
209
+ if __name__ == "__main__":
210
+ spot_hog_soozhu_df = spot_hog_soozhu()
211
+ print(spot_hog_soozhu_df)
212
+
213
+ spot_hog_year_trend_soozhu_df = spot_hog_year_trend_soozhu()
214
+ print(spot_hog_year_trend_soozhu_df)
215
+
216
+ spot_hog_lean_price_soozhu_df = spot_hog_lean_price_soozhu()
217
+ print(spot_hog_lean_price_soozhu_df)
218
+
219
+ spot_hog_three_way_soozhu_df = spot_hog_three_way_soozhu()
220
+ print(spot_hog_three_way_soozhu_df)
221
+
222
+ spot_hog_crossbred_soozhu_df = spot_hog_crossbred_soozhu()
223
+ print(spot_hog_crossbred_soozhu_df)
224
+
225
+ spot_corn_price_soozhu_df = spot_corn_price_soozhu()
226
+ print(spot_corn_price_soozhu_df)
227
+
228
+ spot_soybean_price_soozhu_df = spot_soybean_price_soozhu()
229
+ print(spot_soybean_price_soozhu_df)
230
+
231
+ spot_mixed_feed_soozhu_df = spot_mixed_feed_soozhu()
232
+ print(spot_mixed_feed_soozhu_df)
@@ -0,0 +1,121 @@
1
+ # -*- coding:utf-8 -*-
2
+ # !/usr/bin/env python
3
+ """
4
+ Date: 2024/5/16 20:00
5
+ Desc: 99 期货-数据-期现-现货走势
6
+ https://www.99qh.com/data/spotTrend
7
+ """
8
+
9
+ import json
10
+
11
+ import pandas as pd
12
+ import requests
13
+ from bs4 import BeautifulSoup
14
+
15
+
16
+ def __get_item_of_spot_price_qh() -> pd.DataFrame:
17
+ """
18
+ 99 期货-数据-期现-品种和 ID 对应表
19
+ https://www.99qh.com/data/spotTrend
20
+ :return: 品种和 ID 对应表
21
+ :rtype: str
22
+ """
23
+ url = "https://www.99qh.com/data/spotTrend"
24
+ r = requests.get(url)
25
+ soup = BeautifulSoup(r.text, features="lxml")
26
+ data_text = soup.find(name="script", attrs={"id": "__NEXT_DATA__"}).text
27
+ data_json = json.loads(data_text)
28
+ big_list = []
29
+ for item in data_json["props"]["pageProps"]["data"]["varietyListData"]:
30
+ big_list.extend(item["productList"])
31
+ temp_df = pd.DataFrame(big_list)
32
+ temp_df = temp_df[["qhExchangeName", "name", "productId"]]
33
+ return temp_df
34
+
35
+
36
+ def __get_token_of_spot_price_qh() -> str:
37
+ """
38
+ 99 期货-数据-期现-token
39
+ https://www.99qh.com/data/spotTrend
40
+ :return: token
41
+ :rtype: str
42
+ """
43
+ url = "https://centerapi.fx168api.com/app/common/v.js"
44
+ headers = {
45
+ "Origin": "https://www.99qh.com",
46
+ "Referer": "https://www.99qh.com",
47
+ "User-Agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) "
48
+ "Chrome/124.0.0.0 Safari/537.36",
49
+ }
50
+ r = requests.get(url, headers=headers)
51
+ token = r.headers["_pcc"]
52
+ return token
53
+
54
+
55
+ def spot_price_table_qh() -> pd.DataFrame:
56
+ """
57
+ 99 期货-数据-期现-交易所与品种对照表
58
+ https://www.99qh.com/data/spotTrend
59
+ :return: 交易所与品种对照表
60
+ :rtype: pandas.DataFrame
61
+ """
62
+ temp_df = __get_item_of_spot_price_qh()
63
+ temp_df.rename(
64
+ columns={
65
+ "qhExchangeName": "交易所名称",
66
+ "name": "品种名称",
67
+ },
68
+ inplace=True,
69
+ )
70
+ temp_df = temp_df[
71
+ [
72
+ "交易所名称",
73
+ "品种名称",
74
+ ]
75
+ ]
76
+ return temp_df
77
+
78
+
79
+ def spot_price_qh(symbol: str = "螺纹钢") -> pd.DataFrame:
80
+ """
81
+ 99 期货-数据-期现-现货走势
82
+ https://www.99qh.com/data/spotTrend
83
+ :param symbol: 品种名称
84
+ :type symbol: str
85
+ :return: 现货走势
86
+ :rtype: pandas.DataFrame
87
+ """
88
+ inner_df = __get_item_of_spot_price_qh()
89
+ symbol_map = dict(zip(inner_df["name"], inner_df["productId"]))
90
+ url = "https://centerapi.fx168api.com/app/qh/api/spot/trend"
91
+ headers = {
92
+ "User-Agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) "
93
+ "Chrome/124.0.0.0 Safari/537.36",
94
+ "_pcc": __get_token_of_spot_price_qh(),
95
+ "Origin": "https://www.99qh.com",
96
+ "Referer": "https://www.99qh.com",
97
+ }
98
+ params = {
99
+ "productId": symbol_map[symbol],
100
+ "pageNo": "1",
101
+ "pageSize": "50000",
102
+ "startDate": "",
103
+ "endDate": "2050-01-01",
104
+ "appCategory": "web",
105
+ }
106
+ r = requests.get(url, params=params, headers=headers)
107
+ data_json = r.json()
108
+ temp_df = pd.DataFrame(data_json["data"]["list"])
109
+ temp_df.rename(
110
+ columns={"date": "日期", "fp": "期货收盘价", "sp": "现货价格"}, inplace=True
111
+ )
112
+ temp_df.sort_values(by=["日期"], inplace=True, ignore_index=True)
113
+ temp_df["日期"] = pd.to_datetime(temp_df["日期"], errors="coerce").dt.date
114
+ temp_df["期货收盘价"] = pd.to_numeric(temp_df["期货收盘价"], errors="coerce")
115
+ temp_df["现货价格"] = pd.to_numeric(temp_df["现货价格"], errors="coerce")
116
+ return temp_df
117
+
118
+
119
+ if __name__ == "__main__":
120
+ spot_price_qh_df = spot_price_qh(symbol="螺纹钢")
121
+ print(spot_price_qh_df)
akshare/spot/spot_sge.py CHANGED
@@ -1,15 +1,18 @@
1
1
  # -*- coding:utf-8 -*-
2
2
  # !/usr/bin/env python
3
3
  """
4
- Date: 2023/9/19 8:00
4
+ Date: 2024/8/22 10:00
5
5
  Desc: 上海黄金交易所-数据资讯-行情走势
6
6
  https://www.sge.com.cn/sjzx/mrhq
7
7
  上海黄金交易所-数据资讯-上海金基准价-历史数据
8
8
  上海黄金交易所-数据资讯-上海银基准价-历史数据
9
9
  """
10
+
10
11
  import pandas as pd
11
12
  import requests
12
13
 
14
+ from akshare.utils.cons import headers
15
+
13
16
 
14
17
  def spot_symbol_table_sge() -> pd.DataFrame:
15
18
  """
@@ -44,11 +47,63 @@ def spot_symbol_table_sge() -> pd.DataFrame:
44
47
  return temp_df
45
48
 
46
49
 
50
+ def spot_quotations_sge(symbol: str = "Au99.99") -> pd.DataFrame:
51
+ """
52
+ 上海黄金交易所-实时行情数据
53
+ https://www.sge.com.cn/
54
+ https://www.sge.com.cn/graph/quotations
55
+ :param symbol: choice of {'Au99.99', 'Au99.95', 'Au100g', 'Pt99.95', 'Ag(T+D)', 'Au(T+D)',
56
+ 'mAu(T+D)', 'Au(T+N1)', 'Au(T+N2)', 'Ag99.99', 'iAu99.99', 'Au99.5', 'iAu100g',
57
+ 'iAu99.5', 'PGC30g', 'NYAuTN06', 'NYAuTN12'}; 可以通过 ak.spot_symbol_table_sge() 获取品种表
58
+ :type symbol: str
59
+ :return: 行情数据
60
+ :rtype: pandas.DataFrame
61
+ """
62
+ url = "https://www.sge.com.cn/graph/quotations"
63
+ payload = {"instid": symbol}
64
+ headers = {
65
+ "Accept": "application/json, text/javascript, */*; q=0.01",
66
+ "Accept-Encoding": "gzip, deflate, br, zstd",
67
+ "Accept-Language": "zh-CN,zh;q=0.9,en;q=0.8",
68
+ "Cache-Control": "no-cache",
69
+ "Connection": "keep-alive",
70
+ "Content-Length": "15",
71
+ "Content-Type": "application/x-www-form-urlencoded; charset=UTF-8",
72
+ "Host": "www.sge.com.cn",
73
+ "Origin": "https://www.sge.com.cn",
74
+ "Pragma": "no-cache",
75
+ "Referer": "https://www.sge.com.cn/",
76
+ "sec-ch-ua": '"Google Chrome";v="107", "Chromium";v="107", "Not=A?Brand";v="24"',
77
+ "sec-ch-ua-mobile": "?0",
78
+ "sec-ch-ua-platform": '"Windows"',
79
+ "Sec-Fetch-Dest": "empty",
80
+ "Sec-Fetch-Mode": "cors",
81
+ "Sec-Fetch-Site": "same-origin",
82
+ "User-Agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) "
83
+ "Chrome/107.0.0.0 Safari/537.36",
84
+ "X-Requested-With": "XMLHttpRequest",
85
+ }
86
+ r = requests.get(url, data=payload, headers=headers)
87
+ data_json = r.json()
88
+ temp_df = pd.DataFrame(
89
+ {
90
+ "品种": data_json["heyue"],
91
+ "时间": data_json["times"],
92
+ "现价": data_json["data"],
93
+ "更新时间": data_json["delaystr"],
94
+ }
95
+ )
96
+ temp_df["现价"] = pd.to_numeric(temp_df["现价"], errors="coerce")
97
+ return temp_df
98
+
99
+
47
100
  def spot_hist_sge(symbol: str = "Au99.99") -> pd.DataFrame:
48
101
  """
49
102
  上海黄金交易所-数据资讯-行情走势-历史数据
50
103
  https://www.sge.com.cn/sjzx/mrhq
51
- :param symbol: choice of {'Au99.99', 'Au99.95', 'Au100g', 'Pt99.95', 'Ag(T+D)', 'Au(T+D)', 'mAu(T+D)', 'Au(T+N1)', 'Au(T+N2)', 'Ag99.99', 'iAu99.99', 'Au99.5', 'iAu100g', 'iAu99.5', 'PGC30g', 'NYAuTN06', 'NYAuTN12'}; 可以通过 ak.spot_symbol_table_sge() 获取品种表
104
+ :param symbol: choice of {'Au99.99', 'Au99.95', 'Au100g', 'Pt99.95', 'Ag(T+D)', 'Au(T+D)',
105
+ 'mAu(T+D)', 'Au(T+N1)', 'Au(T+N2)', 'Ag99.99', 'iAu99.99', 'Au99.5', 'iAu100g', 'iAu99.5',
106
+ 'PGC30g', 'NYAuTN06', 'NYAuTN12'}; 可以通过 ak.spot_symbol_table_sge() 获取品种表
52
107
  :type symbol: str
53
108
  :return: 历史数据
54
109
  :rtype: pandas.DataFrame
@@ -73,7 +128,8 @@ def spot_hist_sge(symbol: str = "Au99.99") -> pd.DataFrame:
73
128
  "Sec-Fetch-Dest": "empty",
74
129
  "Sec-Fetch-Mode": "cors",
75
130
  "Sec-Fetch-Site": "same-origin",
76
- "User-Agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/107.0.0.0 Safari/537.36",
131
+ "User-Agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) "
132
+ "Chrome/107.0.0.0 Safari/537.36",
77
133
  "X-Requested-With": "XMLHttpRequest",
78
134
  }
79
135
  r = requests.post(url, data=payload, headers=headers)
@@ -83,8 +139,8 @@ def spot_hist_sge(symbol: str = "Au99.99") -> pd.DataFrame:
83
139
  "date",
84
140
  "open",
85
141
  "close",
86
- "high",
87
142
  "low",
143
+ "high",
88
144
  ]
89
145
 
90
146
  temp_df["date"] = pd.to_datetime(temp_df["date"], errors="coerce").dt.date
@@ -104,9 +160,6 @@ def spot_golden_benchmark_sge() -> pd.DataFrame:
104
160
  """
105
161
  url = "https://www.sge.com.cn/graph/DayilyJzj"
106
162
  payload = {}
107
- headers = {
108
- "User-Agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/107.0.0.0 Safari/537.36",
109
- }
110
163
  r = requests.post(url, data=payload, headers=headers)
111
164
  data_json = r.json()
112
165
  temp_df = pd.DataFrame(data_json["wp"])
@@ -138,9 +191,6 @@ def spot_silver_benchmark_sge() -> pd.DataFrame:
138
191
  """
139
192
  url = "https://www.sge.com.cn/graph/DayilyShsilverJzj"
140
193
  payload = {}
141
- headers = {
142
- "User-Agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/107.0.0.0 Safari/537.36",
143
- }
144
194
  r = requests.post(url, data=payload, headers=headers)
145
195
  data_json = r.json()
146
196
  temp_df = pd.DataFrame(data_json["wp"])
@@ -179,3 +229,6 @@ if __name__ == "__main__":
179
229
  for spot in spot_symbol_table_sge_df["品种"].tolist():
180
230
  spot_hist_sge_df = spot_hist_sge(symbol=spot)
181
231
  print(spot_hist_sge_df)
232
+
233
+ spot_quotations_sge_df = spot_quotations_sge(symbol="Au99.99")
234
+ print(spot_quotations_sge_df)
@@ -1,13 +1,14 @@
1
1
  #!/usr/bin/env python
2
2
  # -*- coding:utf-8 -*-
3
3
  """
4
- Date: 2023/6/9 18:11
4
+ Date: 2024/10/22 15:00
5
5
  Desc: 巨潮资讯-数据浏览器-筹资指标-公司配股实施方案
6
- http://webapi.cninfo.com.cn/#/dataBrowse
6
+ https://webapi.cninfo.com.cn/#/dataBrowse
7
7
  """
8
+
8
9
  import pandas as pd
10
+ import py_mini_racer
9
11
  import requests
10
- from py_mini_racer import py_mini_racer
11
12
 
12
13
  from akshare.datasets import get_ths_js
13
14
 
@@ -21,7 +22,7 @@ def _get_file_content_cninfo(file: str = "cninfo.js") -> str:
21
22
  :rtype: str
22
23
  """
23
24
  setting_file_path = get_ths_js(file)
24
- with open(setting_file_path) as f:
25
+ with open(setting_file_path, encoding="utf-8") as f:
25
26
  file_data = f.read()
26
27
  return file_data
27
28
 
@@ -31,7 +32,7 @@ def stock_allotment_cninfo(
31
32
  ) -> pd.DataFrame:
32
33
  """
33
34
  巨潮资讯-个股-配股实施方案
34
- http://webapi.cninfo.com.cn/#/dataBrowse
35
+ https://webapi.cninfo.com.cn/#/dataBrowse
35
36
  :param symbol: 股票代码
36
37
  :type symbol: str
37
38
  :param start_date: 开始查询的日期
@@ -41,7 +42,7 @@ def stock_allotment_cninfo(
41
42
  :return: 配股实施方案
42
43
  :rtype: pandas.DataFrame
43
44
  """
44
- url = "http://webapi.cninfo.com.cn/api/stock/p_stock2232"
45
+ url = "https://webapi.cninfo.com.cn/api/stock/p_stock2232"
45
46
  params = {
46
47
  "scode": symbol,
47
48
  "sdate": start_date
@@ -63,10 +64,10 @@ def stock_allotment_cninfo(
63
64
  "Cache-Control": "no-cache",
64
65
  "Content-Length": "0",
65
66
  "Host": "webapi.cninfo.com.cn",
66
- "Origin": "http://webapi.cninfo.com.cn",
67
+ "Origin": "https://webapi.cninfo.com.cn",
67
68
  "Pragma": "no-cache",
68
69
  "Proxy-Connection": "keep-alive",
69
- "Referer": "http://webapi.cninfo.com.cn/",
70
+ "Referer": "https://webapi.cninfo.com.cn/",
70
71
  "X-Requested-With": "XMLHttpRequest",
71
72
  }
72
73
  r = requests.post(url, params=params, headers=headers)
@@ -191,6 +192,6 @@ def stock_allotment_cninfo(
191
192
 
192
193
  if __name__ == "__main__":
193
194
  stock_allotment_cninfo_df = stock_allotment_cninfo(
194
- symbol="600030", start_date="19900101", end_date="20221008"
195
+ symbol="600030", start_date="19900101", end_date="20241022"
195
196
  )
196
197
  print(stock_allotment_cninfo_df)
@@ -5,6 +5,7 @@ Date: 2023/6/29 17:13
5
5
  Desc: 东方财富-沪深板块-概念板块
6
6
  https://quote.eastmoney.com/center/boardlist.html#concept_board
7
7
  """
8
+
8
9
  import requests
9
10
  import pandas as pd
10
11
 
@@ -16,7 +17,7 @@ def stock_board_concept_name_em() -> pd.DataFrame:
16
17
  :return: 概念板块-名称
17
18
  :rtype: pandas.DataFrame
18
19
  """
19
- url = "http://79.push2.eastmoney.com/api/qt/clist/get"
20
+ url = "https://79.push2.eastmoney.com/api/qt/clist/get"
20
21
  params = {
21
22
  "pn": "1",
22
23
  "pz": "2000",
@@ -87,7 +88,9 @@ def stock_board_concept_name_em() -> pd.DataFrame:
87
88
  temp_df["换手率"] = pd.to_numeric(temp_df["换手率"], errors="coerce")
88
89
  temp_df["上涨家数"] = pd.to_numeric(temp_df["上涨家数"], errors="coerce")
89
90
  temp_df["下跌家数"] = pd.to_numeric(temp_df["下跌家数"], errors="coerce")
90
- temp_df["领涨股票-涨跌幅"] = pd.to_numeric(temp_df["领涨股票-涨跌幅"], errors="coerce")
91
+ temp_df["领涨股票-涨跌幅"] = pd.to_numeric(
92
+ temp_df["领涨股票-涨跌幅"], errors="coerce"
93
+ )
91
94
  return temp_df
92
95
 
93
96
 
@@ -124,7 +127,7 @@ def stock_board_concept_hist_em(
124
127
  stock_board_concept_em_map["板块名称"] == symbol
125
128
  ]["板块代码"].values[0]
126
129
  adjust_map = {"": "0", "qfq": "1", "hfq": "2"}
127
- url = "http://91.push2his.eastmoney.com/api/qt/stock/kline/get"
130
+ url = "https://91.push2his.eastmoney.com/api/qt/stock/kline/get"
128
131
  params = {
129
132
  "secid": f"90.{stock_board_code}",
130
133
  "ut": "fa5fd1943c7b386f172d6893dbfba10b",
@@ -204,9 +207,9 @@ def stock_board_concept_hist_min_em(
204
207
  params = {
205
208
  "fields1": "f1,f2,f3,f4,f5,f6,f7,f8,f9,f10,f11,f12,f13",
206
209
  "fields2": "f51,f52,f53,f54,f55,f56,f57,f58",
207
- "ut": 'fa5fd1943c7b386f172d6893dbfba10b',
208
- "iscr": '0',
209
- "ndays": '1',
210
+ "ut": "fa5fd1943c7b386f172d6893dbfba10b",
211
+ "iscr": "0",
212
+ "ndays": "1",
210
213
  "secid": f"90.{stock_board_code}",
211
214
  "_": "1687852931312",
212
215
  }
@@ -234,7 +237,7 @@ def stock_board_concept_hist_min_em(
234
237
  temp_df["最新价"] = pd.to_numeric(temp_df["最新价"], errors="coerce")
235
238
  return temp_df
236
239
  else:
237
- url = "http://91.push2his.eastmoney.com/api/qt/stock/kline/get"
240
+ url = "https://91.push2his.eastmoney.com/api/qt/stock/kline/get"
238
241
  params = {
239
242
  "secid": f"90.{stock_board_code}",
240
243
  "ut": "fa5fd1943c7b386f172d6893dbfba10b",
@@ -248,7 +251,9 @@ def stock_board_concept_hist_min_em(
248
251
  }
249
252
  r = requests.get(url, params=params)
250
253
  data_json = r.json()
251
- temp_df = pd.DataFrame([item.split(",") for item in data_json["data"]["klines"]])
254
+ temp_df = pd.DataFrame(
255
+ [item.split(",") for item in data_json["data"]["klines"]]
256
+ )
252
257
  temp_df.columns = [
253
258
  "日期时间",
254
259
  "开盘",
@@ -303,10 +308,10 @@ def stock_board_concept_cons_em(symbol: str = "车联网") -> pd.DataFrame:
303
308
  stock_board_code = stock_board_concept_em_map[
304
309
  stock_board_concept_em_map["板块名称"] == symbol
305
310
  ]["板块代码"].values[0]
306
- url = "http://29.push2.eastmoney.com/api/qt/clist/get"
311
+ url = "https://29.push2.eastmoney.com/api/qt/clist/get"
307
312
  params = {
308
313
  "pn": "1",
309
- "pz": "2000",
314
+ "pz": "5000",
310
315
  "po": "1",
311
316
  "np": "1",
312
317
  "ut": "bd1d9ddb04089700cf9c27f6f7426281",
@@ -314,12 +319,12 @@ def stock_board_concept_cons_em(symbol: str = "车联网") -> pd.DataFrame:
314
319
  "invt": "2",
315
320
  "fid": "f3",
316
321
  "fs": f"b:{stock_board_code} f:!50",
317
- "fields": "f1,f2,f3,f4,f5,f6,f7,f8,f9,f10,f12,f13,f14,f15,f16,f17,f18,f20,f21,f23,f24,f25,f22,f11,f62,f128,f136,f115,f152,f45",
322
+ "fields": "f1,f2,f3,f4,f5,f6,f7,f8,f9,f10,f12,f13,f14,f15,f16,f17,f18,f20,f21,f23,"
323
+ "f24,f25,f22,f11,f62,f128,f136,f115,f152,f45",
318
324
  "_": "1626081702127",
319
325
  }
320
326
  r = requests.get(url, params=params)
321
327
  data_json = r.json()
322
-
323
328
  temp_df = pd.DataFrame(data_json["data"]["diff"])
324
329
  temp_df.reset_index(inplace=True)
325
330
  temp_df["index"] = range(1, len(temp_df) + 1)
@@ -399,7 +404,11 @@ if __name__ == "__main__":
399
404
  print(stock_board_concept_em_df)
400
405
 
401
406
  stock_board_concept_hist_em_df = stock_board_concept_hist_em(
402
- symbol="绿色电力", period="daily", start_date="20220101", end_date="20230806", adjust=""
407
+ symbol="绿色电力",
408
+ period="daily",
409
+ start_date="20220101",
410
+ end_date="20230806",
411
+ adjust="",
403
412
  )
404
413
  print(stock_board_concept_hist_em_df)
405
414
 
@@ -408,5 +417,5 @@ if __name__ == "__main__":
408
417
  )
409
418
  print(stock_board_concept_hist_min_em_df)
410
419
 
411
- stock_board_concept_cons_em_df = stock_board_concept_cons_em(symbol="网络安全")
420
+ stock_board_concept_cons_em_df = stock_board_concept_cons_em(symbol="融资融券")
412
421
  print(stock_board_concept_cons_em_df)