akshare 1.16.64__py3-none-any.whl → 1.16.66__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 (176) hide show
  1. akshare/__init__.py +3 -1
  2. akshare/air/cons.py +1 -0
  3. akshare/air/crypto.js +1 -1
  4. akshare/air/outcrypto.js +1 -1
  5. akshare/article/cons.py +1 -0
  6. akshare/article/epu_index.py +4 -3
  7. akshare/article/ff_factor.py +19 -8
  8. akshare/article/fred_md.py +4 -1
  9. akshare/article/risk_rv.py +3 -8
  10. akshare/bond/bond_cb_sina.py +1 -0
  11. akshare/bond/bond_cbond.py +19 -14
  12. akshare/bond/bond_em.py +34 -15
  13. akshare/bond/bond_summary.py +38 -37
  14. akshare/bond/bond_zh_cov.py +0 -6
  15. akshare/bond/cons.py +14 -11
  16. akshare/crypto/__init__.py +1 -1
  17. akshare/crypto/crypto_bitcoin_cme.py +7 -7
  18. akshare/crypto/crypto_hold.py +4 -1
  19. akshare/currency/currency.py +1 -0
  20. akshare/currency/currency_china_bank_sina.py +6 -3
  21. akshare/data/__init__.py +1 -1
  22. akshare/data/cninfo.js +1 -1
  23. akshare/economic/cons.py +10 -3
  24. akshare/economic/macro_australia.py +0 -7
  25. akshare/economic/macro_canada.py +92 -81
  26. akshare/economic/macro_china.py +0 -34
  27. akshare/economic/macro_china_hk.py +0 -1
  28. akshare/economic/macro_euro.py +103 -56
  29. akshare/economic/macro_germany.py +1 -1
  30. akshare/economic/macro_japan.py +0 -1
  31. akshare/economic/macro_other.py +1 -6
  32. akshare/economic/macro_swiss.py +2 -3
  33. akshare/economic/macro_uk.py +1 -1
  34. akshare/economic/macro_usa.py +0 -2
  35. akshare/energy/energy_carbon.py +0 -1
  36. akshare/energy/energy_oil_em.py +1 -2
  37. akshare/event/cons.py +1 -0
  38. akshare/forex/forex_em.py +0 -1
  39. akshare/fortune/fortune_bloomberg.py +6 -3
  40. akshare/fortune/fortune_forbes_500.py +3 -6
  41. akshare/fortune/fortune_hurun.py +2 -1
  42. akshare/fortune/fortune_xincaifu_500.py +17 -14
  43. akshare/fund/fund_announcement.py +1 -0
  44. akshare/fund/fund_aum_em.py +47 -35
  45. akshare/fund/fund_em.py +0 -7
  46. akshare/fund/fund_etf_em.py +0 -5
  47. akshare/fund/fund_fhsp_em.py +27 -20
  48. akshare/fund/fund_init_em.py +8 -5
  49. akshare/fund/fund_lof_em.py +0 -5
  50. akshare/fund/fund_manager.py +18 -7
  51. akshare/fund/fund_portfolio_em.py +0 -1
  52. akshare/fund/fund_position_lg.py +19 -8
  53. akshare/fund/fund_rank_em.py +0 -3
  54. akshare/fund/fund_rating.py +28 -9
  55. akshare/fund/fund_scale_em.py +24 -13
  56. akshare/futures/futures_comex_em.py +1 -0
  57. akshare/futures/futures_contract_detail.py +11 -8
  58. akshare/futures/futures_inventory_em.py +0 -2
  59. akshare/futures/futures_rule.py +5 -1
  60. akshare/futures/futures_settlement_price_sgx.py +21 -6
  61. akshare/futures/futures_stock_js.py +0 -1
  62. akshare/futures/receipt.py +279 -153
  63. akshare/futures/requests_fun.py +16 -3
  64. akshare/futures_derivative/cons.py +100 -103
  65. akshare/futures_derivative/futures_contract_info_cffex.py +53 -39
  66. akshare/futures_derivative/futures_contract_info_dce.py +16 -9
  67. akshare/futures_derivative/futures_contract_info_gfex.py +43 -31
  68. akshare/futures_derivative/futures_index_sina.py +25 -13
  69. akshare/fx/cons.py +12 -7
  70. akshare/fx/fx_quote.py +1 -0
  71. akshare/fx/fx_quote_baidu.py +2 -1
  72. akshare/hf/__init__.py +1 -1
  73. akshare/hf/hf_sp500.py +8 -7
  74. akshare/index/index_eri.py +1 -0
  75. akshare/index/index_global_em.py +0 -1
  76. akshare/index/index_kq_fz.py +17 -14
  77. akshare/index/index_kq_ss.py +1 -0
  78. akshare/index/index_stock_hk.py +0 -1
  79. akshare/index/index_stock_zh.py +0 -3
  80. akshare/index/index_sugar.py +18 -4
  81. akshare/index/index_zh_em.py +0 -15
  82. akshare/interest_rate/interbank_rate_em.py +0 -1
  83. akshare/movie/jm.js +0 -1
  84. akshare/news/__init__.py +1 -1
  85. akshare/news/news_stock.py +0 -1
  86. akshare/option/option_commodity_sina.py +22 -26
  87. akshare/option/option_daily_stats_sse_szse.py +0 -1
  88. akshare/option/option_em.py +0 -1
  89. akshare/option/option_lhb_em.py +0 -1
  90. akshare/option/option_risk_indicator_sse.py +0 -1
  91. akshare/other/__init__.py +1 -1
  92. akshare/pro/__init__.py +0 -1
  93. akshare/pro/client.py +6 -4
  94. akshare/pro/cons.py +3 -2
  95. akshare/pro/data_pro.py +6 -5
  96. akshare/qhkc/qhkc_api.py +63 -21
  97. akshare/qhkc_web/qhkc_fund.py +1 -0
  98. akshare/qhkc_web/qhkc_index.py +1 -0
  99. akshare/qhkc_web/qhkc_tool.py +55 -54
  100. akshare/rate/__init__.py +1 -1
  101. akshare/rate/repo_rate.py +36 -32
  102. akshare/reits/__init__.py +1 -1
  103. akshare/reits/reits_basic.py +44 -2
  104. akshare/sport/__init__.py +1 -1
  105. akshare/sport/sport_olympic.py +1 -0
  106. akshare/spot/__init__.py +1 -1
  107. akshare/stock/cons.py +19 -12
  108. akshare/stock/stock_board_concept_em.py +0 -6
  109. akshare/stock/stock_board_industry_em.py +0 -6
  110. akshare/stock/stock_dzjy_em.py +1 -1
  111. akshare/stock/stock_fund_em.py +0 -2
  112. akshare/stock/stock_fund_hold.py +1 -2
  113. akshare/stock/stock_gsrl_em.py +1 -0
  114. akshare/stock/stock_hk_famous.py +0 -1
  115. akshare/stock/stock_hk_fhpx_ths.py +2 -1
  116. akshare/stock/stock_hk_hot_rank_em.py +1 -0
  117. akshare/stock/stock_hold_control_em.py +0 -2
  118. akshare/stock/stock_hot_up_em.py +4 -1
  119. akshare/stock/stock_hsgt_em.py +0 -2
  120. akshare/stock/stock_industry.py +1 -0
  121. akshare/stock/stock_info.py +0 -2
  122. akshare/stock/stock_info_em.py +0 -1
  123. akshare/stock/stock_repurchase_em.py +7 -2
  124. akshare/stock/stock_share_hold.py +0 -1
  125. akshare/stock/stock_stop.py +0 -1
  126. akshare/stock/stock_summary.py +0 -2
  127. akshare/stock/stock_us_famous.py +0 -1
  128. akshare/stock/stock_us_js.py +3 -2
  129. akshare/stock/stock_us_pink.py +0 -1
  130. akshare/stock/stock_weibo_nlp.py +18 -20
  131. akshare/stock/stock_zh_a_special.py +0 -3
  132. akshare/stock/stock_zh_a_tick_tx.py +11 -3
  133. akshare/stock_a/stock_board_concept_name_em.py +0 -1
  134. akshare/stock_a/stock_zh_a_spot.py +0 -1
  135. akshare/stock_feature/cons.py +1 -0
  136. akshare/stock_feature/stock_account_em.py +0 -1
  137. akshare/stock_feature/stock_all_pb.py +2 -1
  138. akshare/stock_feature/stock_analyst_em.py +0 -3
  139. akshare/stock_feature/stock_buffett_index_lg.py +7 -6
  140. akshare/stock_feature/stock_classify_sina.py +3 -6
  141. akshare/stock_feature/stock_comment_em.py +0 -2
  142. akshare/stock_feature/stock_congestion_lg.py +2 -1
  143. akshare/stock_feature/stock_dxsyl_em.py +116 -71
  144. akshare/stock_feature/stock_gdzjc_em.py +16 -5
  145. akshare/stock_feature/stock_gxl_lg.py +3 -2
  146. akshare/stock_feature/stock_hist_em.py +0 -20
  147. akshare/stock_feature/stock_hist_tx.py +10 -8
  148. akshare/stock_feature/stock_hot_xq.py +4 -6
  149. akshare/stock_feature/stock_hsgt_em.py +0 -2
  150. akshare/stock_feature/stock_hsgt_exchange_rate.py +0 -2
  151. akshare/stock_feature/stock_hsgt_min_em.py +13 -16
  152. akshare/stock_feature/stock_inner_trade_xq.py +0 -1
  153. akshare/stock_feature/stock_lhb_em.py +0 -1
  154. akshare/stock_feature/stock_margin_em.py +0 -1
  155. akshare/stock_feature/stock_margin_sse.py +0 -2
  156. akshare/stock_feature/stock_pankou_em.py +0 -2
  157. akshare/stock_feature/stock_qsjy_em.py +13 -4
  158. akshare/stock_feature/stock_research_report_em.py +0 -1
  159. akshare/stock_feature/stock_yjyg_cninfo.py +4 -1
  160. akshare/stock_feature/stock_yjyg_em.py +1 -1
  161. akshare/stock_feature/stock_zh_vote_baidu.py +4 -1
  162. akshare/stock_feature/stock_ztb_em.py +0 -6
  163. akshare/stock_fundamental/__init__.py +1 -1
  164. akshare/stock_fundamental/stock_hold.py +26 -17
  165. akshare/stock_fundamental/stock_ipo_declare.py +1 -0
  166. akshare/stock_fundamental/stock_kcb_detail_sse.py +10 -10
  167. akshare/stock_fundamental/stock_kcb_sse.py +26 -25
  168. akshare/stock_fundamental/stock_profit_forecast_hk_etnet.py +64 -41
  169. akshare/stock_fundamental/stock_recommend.py +20 -4
  170. akshare/utils/demjson.py +2007 -1336
  171. akshare/utils/token_process.py +6 -5
  172. {akshare-1.16.64.dist-info → akshare-1.16.66.dist-info}/METADATA +12 -35
  173. {akshare-1.16.64.dist-info → akshare-1.16.66.dist-info}/RECORD +176 -176
  174. {akshare-1.16.64.dist-info → akshare-1.16.66.dist-info}/WHEEL +0 -0
  175. {akshare-1.16.64.dist-info → akshare-1.16.66.dist-info}/licenses/LICENSE +0 -0
  176. {akshare-1.16.64.dist-info → akshare-1.16.66.dist-info}/top_level.txt +0 -0
@@ -127,7 +127,6 @@ def stock_analyst_detail_em(
127
127
  "pageNumber": "1",
128
128
  "pageSize": "1000",
129
129
  "filter": f'(ANALYST_CODE="{analyst_id}")',
130
- "_": "1675744438197",
131
130
  }
132
131
  r = requests.get(url, params=params, headers=headers)
133
132
  data_json = r.json()
@@ -186,7 +185,6 @@ def stock_analyst_detail_em(
186
185
  "pageNumber": "1",
187
186
  "pageSize": "1000",
188
187
  "filter": f'(ANALYST_CODE="{analyst_id}")',
189
- "_": "1675744438197",
190
188
  }
191
189
  r = requests.get(url, params=params, headers=headers)
192
190
  data_json = r.json()
@@ -236,7 +234,6 @@ def stock_analyst_detail_em(
236
234
  "filter": f'(ANALYST_CODE="{analyst_id}")',
237
235
  "source": "WEB",
238
236
  "client": "WEB",
239
- "_": "1675744438200",
240
237
  }
241
238
  r = requests.get(url, params=params, headers=headers)
242
239
  data_json = r.json()
@@ -5,6 +5,7 @@ Date: 2023/4/5 22:05
5
5
  Desc: 乐估乐股-底部研究-巴菲特指标
6
6
  https://legulegu.com/stockdata/marketcap-gdp
7
7
  """
8
+
8
9
  import pandas as pd
9
10
  import requests
10
11
 
@@ -24,7 +25,7 @@ def stock_buffett_index_lg() -> pd.DataFrame:
24
25
  r = requests.get(
25
26
  url,
26
27
  params=params,
27
- **get_cookie_csrf(url="https://legulegu.com/stockdata/marketcap-gdp")
28
+ **get_cookie_csrf(url="https://legulegu.com/stockdata/marketcap-gdp"),
28
29
  )
29
30
  data_json = r.json()
30
31
  temp_df = pd.DataFrame(data_json["data"])
@@ -50,11 +51,11 @@ def stock_buffett_index_lg() -> pd.DataFrame:
50
51
  ]
51
52
  ]
52
53
  temp_df["日期"] = pd.to_datetime(temp_df["日期"], unit="ms").dt.date
53
- temp_df['收盘价'] = pd.to_numeric(temp_df['收盘价'], errors="coerce")
54
- temp_df['总市值'] = pd.to_numeric(temp_df['总市值'], errors="coerce")
55
- temp_df['GDP'] = pd.to_numeric(temp_df['GDP'], errors="coerce")
56
- temp_df['近十年分位数'] = pd.to_numeric(temp_df['近十年分位数'], errors="coerce")
57
- temp_df['总历史分位数'] = pd.to_numeric(temp_df['总历史分位数'], errors="coerce")
54
+ temp_df["收盘价"] = pd.to_numeric(temp_df["收盘价"], errors="coerce")
55
+ temp_df["总市值"] = pd.to_numeric(temp_df["总市值"], errors="coerce")
56
+ temp_df["GDP"] = pd.to_numeric(temp_df["GDP"], errors="coerce")
57
+ temp_df["近十年分位数"] = pd.to_numeric(temp_df["近十年分位数"], errors="coerce")
58
+ temp_df["总历史分位数"] = pd.to_numeric(temp_df["总历史分位数"], errors="coerce")
58
59
  return temp_df
59
60
 
60
61
 
@@ -5,6 +5,7 @@ Date: 2022/7/13 16:16
5
5
  Desc: 新浪财经-股票-行业分类
6
6
  http://vip.stock.finance.sina.com.cn/mkt/
7
7
  """
8
+
8
9
  import math
9
10
 
10
11
  import pandas as pd
@@ -30,9 +31,7 @@ def stock_classify_board() -> dict:
30
31
  for item in data_json[1][0][1]
31
32
  ] # 沪深股市
32
33
  for num, class_name in enumerate(class_name_list):
33
- temp_df = pd.DataFrame(
34
- [item for item in data_json[1][0][1][num][1:][0]]
35
- )
34
+ temp_df = pd.DataFrame([item for item in data_json[1][0][1][num][1:][0]])
36
35
  if temp_df.shape[1] == 5:
37
36
  temp_df.columns = ["name", "_", "code", "_", "_"]
38
37
  temp_df = temp_df[["name", "code"]]
@@ -57,9 +56,7 @@ def stock_classify_sina(symbol: str = "热门概念") -> pd.DataFrame:
57
56
  """
58
57
  stock_classify_board_dict = stock_classify_board()
59
58
  data_df = pd.DataFrame()
60
- for num in tqdm(
61
- range(len(stock_classify_board_dict[symbol]["code"])), leave=False
62
- ):
59
+ for num in tqdm(range(len(stock_classify_board_dict[symbol]["code"])), leave=False):
63
60
  url = "http://vip.stock.finance.sina.com.cn/quotes_service/api/json_v2.php/Market_Center.getHQNodeStockCount"
64
61
  params = {"node": stock_classify_board_dict[symbol]["code"][num]}
65
62
  r = requests.get(url, params=params)
@@ -132,7 +132,6 @@ def stock_comment_detail_zlkp_jgcyd_em(symbol: str = "600000") -> pd.DataFrame:
132
132
  "client": "WEB",
133
133
  "sortColumns": "TRADE_DATE",
134
134
  "sortTypes": "-1",
135
- "_": "1655387358195",
136
135
  }
137
136
  r = requests.get(url, params=params)
138
137
  data_json = r.json()
@@ -291,7 +290,6 @@ def stock_comment_detail_scrd_desire_daily_em(
291
290
  "sortColumns": "TRADE_DATE",
292
291
  "sortTypes": "-1",
293
292
  "pageSize": "30",
294
- "_": "1727189719991",
295
293
  }
296
294
  r = requests.get(url=url, params=params)
297
295
  data_json = r.json()
@@ -5,6 +5,7 @@ Date: 2023/4/7 15:05
5
5
  Desc: 乐咕乐股-大盘拥挤度
6
6
  https://legulegu.com/stockdata/ashares-congestion
7
7
  """
8
+
8
9
  import pandas as pd
9
10
  import requests
10
11
 
@@ -24,7 +25,7 @@ def stock_a_congestion_lg() -> pd.DataFrame:
24
25
  r = requests.get(
25
26
  url,
26
27
  params=params,
27
- **get_cookie_csrf(url="https://legulegu.com/stockdata/ashares-congestion")
28
+ **get_cookie_csrf(url="https://legulegu.com/stockdata/ashares-congestion"),
28
29
  )
29
30
  data_json = r.json()
30
31
  temp_df = pd.DataFrame(data_json["items"])
@@ -8,6 +8,7 @@ https://data.eastmoney.com/xg/xg/dxsyl.html
8
8
  东方财富网-数据中心-新股数据-新股申购与中签查询
9
9
  https://data.eastmoney.com/xg/xg/default_2.html
10
10
  """
11
+
11
12
  import pandas as pd
12
13
  import requests
13
14
 
@@ -93,14 +94,30 @@ def stock_dxsyl_em() -> pd.DataFrame:
93
94
  ]
94
95
  big_df["发行价"] = pd.to_numeric(big_df["发行价"], errors="coerce")
95
96
  big_df["最新价"] = pd.to_numeric(big_df["最新价"], errors="coerce")
96
- big_df["网上-发行中签率"] = pd.to_numeric(big_df["网上-发行中签率"], errors="coerce")
97
- big_df["网上-有效申购股数"] = pd.to_numeric(big_df["网上-有效申购股数"], errors="coerce")
98
- big_df["网上-有效申购户数"] = pd.to_numeric(big_df["网上-有效申购户数"], errors="coerce")
99
- big_df["网上-超额认购倍数"] = pd.to_numeric(big_df["网上-超额认购倍数"], errors="coerce")
100
- big_df["网下-配售中签率"] = pd.to_numeric(big_df["网下-配售中签率"], errors="coerce")
101
- big_df["网下-有效申购股数"] = pd.to_numeric(big_df["网下-有效申购股数"], errors="coerce")
102
- big_df["网下-有效申购户数"] = pd.to_numeric(big_df["网下-有效申购户数"], errors="coerce")
103
- big_df["网下-配售认购倍数"] = pd.to_numeric(big_df["网下-配售认购倍数"], errors="coerce")
97
+ big_df["网上-发行中签率"] = pd.to_numeric(
98
+ big_df["网上-发行中签率"], errors="coerce"
99
+ )
100
+ big_df["网上-有效申购股数"] = pd.to_numeric(
101
+ big_df["网上-有效申购股数"], errors="coerce"
102
+ )
103
+ big_df["网上-有效申购户数"] = pd.to_numeric(
104
+ big_df["网上-有效申购户数"], errors="coerce"
105
+ )
106
+ big_df["网上-超额认购倍数"] = pd.to_numeric(
107
+ big_df["网上-超额认购倍数"], errors="coerce"
108
+ )
109
+ big_df["网下-配售中签率"] = pd.to_numeric(
110
+ big_df["网下-配售中签率"], errors="coerce"
111
+ )
112
+ big_df["网下-有效申购股数"] = pd.to_numeric(
113
+ big_df["网下-有效申购股数"], errors="coerce"
114
+ )
115
+ big_df["网下-有效申购户数"] = pd.to_numeric(
116
+ big_df["网下-有效申购户数"], errors="coerce"
117
+ )
118
+ big_df["网下-配售认购倍数"] = pd.to_numeric(
119
+ big_df["网下-配售认购倍数"], errors="coerce"
120
+ )
104
121
  big_df["总发行数量"] = pd.to_numeric(big_df["总发行数量"], errors="coerce")
105
122
  big_df["开盘溢价"] = pd.to_numeric(big_df["开盘溢价"], errors="coerce")
106
123
  big_df["首日涨幅"] = pd.to_numeric(big_df["首日涨幅"], errors="coerce")
@@ -151,47 +168,47 @@ def stock_xgsglb_em(symbol: str = "全部股票") -> pd.DataFrame:
151
168
 
152
169
  big_df.rename(
153
170
  columns={
154
- 'ORG_CODE': '-',
155
- 'SECURITY_CODE': '代码',
156
- 'SECUCODE': '带市场标识股票代码',
157
- 'SECURITY_NAME_ABBR': '简称',
158
- 'APPLY_CODE': '申购代码',
159
- 'EXPECT_ISSUE_NUM': '发行总数',
160
- 'PRICE_WAY': '定价方式',
161
- 'ISSUE_PRICE': '发行价格',
162
- 'ISSUE_PE_RATIO': '发行市盈率',
163
- 'APPLY_DATE': '申购日',
164
- 'RESULT_NOTICE_DATE': '发行结果公告日期',
165
- 'SELECT_LISTING_DATE': '上市首日-上市日',
166
- 'ONLINE_ISSUE_NUM': '网上-发行数量',
167
- 'APPLY_AMT_UPPER': '网上-顶格所需资金',
168
- 'APPLY_NUM_UPPER': '网上-申购上限',
169
- 'ONLINE_PAY_DATE': '网上申购缴款日期',
170
- 'ONLINE_REFUND_DATE': '网上申购资金退款日',
171
- 'INFO_CODE': '-',
172
- 'ONLINE_ISSUE_LWR': '中签率',
173
- 'NEWEST_PRICE': '最新价格-价格',
174
- 'CLOSE_PRICE': '首日收盘价',
175
- 'INITIAL_MULTIPLE': '-',
176
- 'PER_SHARES_INCOME': '上市首日-每百股获利',
177
- 'LD_CLOSE_CHANGE': '上市首日-涨幅',
178
- 'TURNOVERRATE': '首日换手率',
179
- 'AMPLITUDE': '首日振幅',
180
- 'ONLINE_APPLY_LOWER': '-',
181
- 'MAIN_BUSINESS': '主营业务',
182
- 'INDUSTRY_PE_RATIO': '行业市盈率',
183
- 'APPLY_AMT_100': '稳获百股需配资金',
184
- 'TAKE_UP_TIME': '资金占用时间',
185
- 'CAPTURE_PROFIT': '上市首日-约合年化收益',
186
- 'APPLY_SHARE_100': '每获配百股需配股数',
187
- 'AVERAGE_PRICE': '上市首日-均价',
188
- 'ORG_VAN': '参与申购人数',
189
- 'VA_AMT': '参与申购资金',
190
- 'ISSUE_PRICE_ADJFACTOR': '-'
171
+ "ORG_CODE": "-",
172
+ "SECURITY_CODE": "代码",
173
+ "SECUCODE": "带市场标识股票代码",
174
+ "SECURITY_NAME_ABBR": "简称",
175
+ "APPLY_CODE": "申购代码",
176
+ "EXPECT_ISSUE_NUM": "发行总数",
177
+ "PRICE_WAY": "定价方式",
178
+ "ISSUE_PRICE": "发行价格",
179
+ "ISSUE_PE_RATIO": "发行市盈率",
180
+ "APPLY_DATE": "申购日",
181
+ "RESULT_NOTICE_DATE": "发行结果公告日期",
182
+ "SELECT_LISTING_DATE": "上市首日-上市日",
183
+ "ONLINE_ISSUE_NUM": "网上-发行数量",
184
+ "APPLY_AMT_UPPER": "网上-顶格所需资金",
185
+ "APPLY_NUM_UPPER": "网上-申购上限",
186
+ "ONLINE_PAY_DATE": "网上申购缴款日期",
187
+ "ONLINE_REFUND_DATE": "网上申购资金退款日",
188
+ "INFO_CODE": "-",
189
+ "ONLINE_ISSUE_LWR": "中签率",
190
+ "NEWEST_PRICE": "最新价格-价格",
191
+ "CLOSE_PRICE": "首日收盘价",
192
+ "INITIAL_MULTIPLE": "-",
193
+ "PER_SHARES_INCOME": "上市首日-每百股获利",
194
+ "LD_CLOSE_CHANGE": "上市首日-涨幅",
195
+ "TURNOVERRATE": "首日换手率",
196
+ "AMPLITUDE": "首日振幅",
197
+ "ONLINE_APPLY_LOWER": "-",
198
+ "MAIN_BUSINESS": "主营业务",
199
+ "INDUSTRY_PE_RATIO": "行业市盈率",
200
+ "APPLY_AMT_100": "稳获百股需配资金",
201
+ "TAKE_UP_TIME": "资金占用时间",
202
+ "CAPTURE_PROFIT": "上市首日-约合年化收益",
203
+ "APPLY_SHARE_100": "每获配百股需配股数",
204
+ "AVERAGE_PRICE": "上市首日-均价",
205
+ "ORG_VAN": "参与申购人数",
206
+ "VA_AMT": "参与申购资金",
207
+ "ISSUE_PRICE_ADJFACTOR": "-",
191
208
  },
192
- inplace=True
209
+ inplace=True,
193
210
  )
194
- big_df['最新价格-累计涨幅'] = big_df['首日收盘价'] / big_df['最新价格-价格']
211
+ big_df["最新价格-累计涨幅"] = big_df["首日收盘价"] / big_df["最新价格-价格"]
195
212
 
196
213
  big_df = big_df[
197
214
  [
@@ -205,39 +222,61 @@ def stock_xgsglb_em(symbol: str = "全部股票") -> pd.DataFrame:
205
222
  "发行价格",
206
223
  "申购日",
207
224
  "中签率",
208
- '稳获百股需配资金',
209
- '最新价格-价格',
210
- '最新价格-累计涨幅',
211
- '上市首日-上市日',
212
- '上市首日-均价',
213
- '上市首日-涨幅',
214
- '上市首日-每百股获利',
215
- '上市首日-约合年化收益',
216
- '发行市盈率',
217
- '行业市盈率',
225
+ "稳获百股需配资金",
226
+ "最新价格-价格",
227
+ "最新价格-累计涨幅",
228
+ "上市首日-上市日",
229
+ "上市首日-均价",
230
+ "上市首日-涨幅",
231
+ "上市首日-每百股获利",
232
+ "上市首日-约合年化收益",
233
+ "发行市盈率",
234
+ "行业市盈率",
218
235
  "参与申购资金",
219
236
  "参与申购人数",
220
237
  ]
221
238
  ]
222
239
  big_df["发行总数"] = pd.to_numeric(big_df["发行总数"], errors="coerce")
223
- big_df["网上-发行数量"] = pd.to_numeric(big_df["网上-发行数量"], errors="coerce")
224
- big_df["网上-申购上限"] = pd.to_numeric(big_df["网上-申购上限"], errors="coerce")
225
- big_df["网上-顶格所需资金"] = pd.to_numeric(big_df["网上-顶格所需资金"], errors="coerce")
240
+ big_df["网上-发行数量"] = pd.to_numeric(
241
+ big_df["网上-发行数量"], errors="coerce"
242
+ )
243
+ big_df["网上-申购上限"] = pd.to_numeric(
244
+ big_df["网上-申购上限"], errors="coerce"
245
+ )
246
+ big_df["网上-顶格所需资金"] = pd.to_numeric(
247
+ big_df["网上-顶格所需资金"], errors="coerce"
248
+ )
226
249
  big_df["发行价格"] = pd.to_numeric(big_df["发行价格"], errors="coerce")
227
250
  big_df["中签率"] = pd.to_numeric(big_df["中签率"], errors="coerce")
228
- big_df["稳获百股需配资金"] = pd.to_numeric(big_df["稳获百股需配资金"], errors="coerce")
229
- big_df["最新价格-价格"] = pd.to_numeric(big_df["最新价格-价格"], errors="coerce")
230
- big_df["最新价格-累计涨幅"] = pd.to_numeric(big_df["最新价格-累计涨幅"], errors="coerce")
231
- big_df["上市首日-均价"] = pd.to_numeric(big_df["上市首日-均价"], errors="coerce")
232
- big_df["上市首日-涨幅"] = pd.to_numeric(big_df["上市首日-涨幅"], errors="coerce")
233
- big_df["上市首日-每百股获利"] = pd.to_numeric(big_df["上市首日-每百股获利"], errors="coerce")
234
- big_df["上市首日-约合年化收益"] = pd.to_numeric(big_df["上市首日-约合年化收益"], errors="coerce")
251
+ big_df["稳获百股需配资金"] = pd.to_numeric(
252
+ big_df["稳获百股需配资金"], errors="coerce"
253
+ )
254
+ big_df["最新价格-价格"] = pd.to_numeric(
255
+ big_df["最新价格-价格"], errors="coerce"
256
+ )
257
+ big_df["最新价格-累计涨幅"] = pd.to_numeric(
258
+ big_df["最新价格-累计涨幅"], errors="coerce"
259
+ )
260
+ big_df["上市首日-均价"] = pd.to_numeric(
261
+ big_df["上市首日-均价"], errors="coerce"
262
+ )
263
+ big_df["上市首日-涨幅"] = pd.to_numeric(
264
+ big_df["上市首日-涨幅"], errors="coerce"
265
+ )
266
+ big_df["上市首日-每百股获利"] = pd.to_numeric(
267
+ big_df["上市首日-每百股获利"], errors="coerce"
268
+ )
269
+ big_df["上市首日-约合年化收益"] = pd.to_numeric(
270
+ big_df["上市首日-约合年化收益"], errors="coerce"
271
+ )
235
272
  big_df["发行市盈率"] = pd.to_numeric(big_df["发行市盈率"], errors="coerce")
236
273
  big_df["行业市盈率"] = pd.to_numeric(big_df["行业市盈率"], errors="coerce")
237
274
  big_df["参与申购资金"] = pd.to_numeric(big_df["参与申购资金"], errors="coerce")
238
275
  big_df["参与申购人数"] = pd.to_numeric(big_df["参与申购人数"], errors="coerce")
239
276
  big_df["申购日"] = pd.to_datetime(big_df["申购日"], errors="coerce").dt.date
240
- big_df["上市首日-上市日"] = pd.to_datetime(big_df["上市首日-上市日"], errors="coerce").dt.date
277
+ big_df["上市首日-上市日"] = pd.to_datetime(
278
+ big_df["上市首日-上市日"], errors="coerce"
279
+ ).dt.date
241
280
  return big_df
242
281
  else:
243
282
  params = {
@@ -347,7 +386,9 @@ def stock_xgsglb_em(symbol: str = "全部股票") -> pd.DataFrame:
347
386
  big_df["中签缴款日期"] = pd.to_datetime(big_df["中签缴款日期"]).dt.date
348
387
  big_df["发行总数"] = pd.to_numeric(big_df["发行总数"], errors="coerce")
349
388
  big_df["网上发行"] = pd.to_numeric(big_df["网上发行"], errors="coerce")
350
- big_df["顶格申购需配市值"] = pd.to_numeric(big_df["顶格申购需配市值"], errors="coerce")
389
+ big_df["顶格申购需配市值"] = pd.to_numeric(
390
+ big_df["顶格申购需配市值"], errors="coerce"
391
+ )
351
392
  big_df["申购上限"] = pd.to_numeric(big_df["申购上限"], errors="coerce")
352
393
  big_df["发行价格"] = pd.to_numeric(big_df["发行价格"], errors="coerce")
353
394
  big_df["最新价"] = pd.to_numeric(big_df["最新价"], errors="coerce")
@@ -355,8 +396,12 @@ def stock_xgsglb_em(symbol: str = "全部股票") -> pd.DataFrame:
355
396
  big_df["发行市盈率"] = pd.to_numeric(big_df["发行市盈率"], errors="coerce")
356
397
  big_df["行业市盈率"] = pd.to_numeric(big_df["行业市盈率"], errors="coerce")
357
398
  big_df["中签率"] = pd.to_numeric(big_df["中签率"], errors="coerce")
358
- big_df["询价累计报价倍数"] = pd.to_numeric(big_df["询价累计报价倍数"], errors="coerce")
359
- big_df["配售对象报价家数"] = pd.to_numeric(big_df["配售对象报价家数"], errors="coerce")
399
+ big_df["询价累计报价倍数"] = pd.to_numeric(
400
+ big_df["询价累计报价倍数"], errors="coerce"
401
+ )
402
+ big_df["配售对象报价家数"] = pd.to_numeric(
403
+ big_df["配售对象报价家数"], errors="coerce"
404
+ )
360
405
  big_df["涨幅"] = pd.to_numeric(big_df["涨幅"], errors="coerce")
361
406
  big_df["每中一签获利"] = pd.to_numeric(big_df["每中一签获利"], errors="coerce")
362
407
  return big_df
@@ -5,6 +5,7 @@ Date: 2023/1/28 11:03
5
5
  Desc: 东方财富网-数据中心-特色数据-高管持股
6
6
  https://data.eastmoney.com/executive/gdzjc.html
7
7
  """
8
+
8
9
  from tqdm import tqdm
9
10
 
10
11
  import pandas as pd
@@ -105,12 +106,22 @@ def stock_ggcg_em(symbol: str = "全部") -> pd.DataFrame:
105
106
  big_df["最新价"] = pd.to_numeric(big_df["最新价"], errors="coerce")
106
107
  big_df["涨跌幅"] = pd.to_numeric(big_df["涨跌幅"], errors="coerce")
107
108
  big_df["持股变动信息-变动数量"] = pd.to_numeric(big_df["持股变动信息-变动数量"])
108
- big_df["持股变动信息-占总股本比例"] = pd.to_numeric(big_df["持股变动信息-占总股本比例"])
109
- big_df["持股变动信息-占流通股比例"] = pd.to_numeric(big_df["持股变动信息-占流通股比例"])
109
+ big_df["持股变动信息-占总股本比例"] = pd.to_numeric(
110
+ big_df["持股变动信息-占总股本比例"]
111
+ )
112
+ big_df["持股变动信息-占流通股比例"] = pd.to_numeric(
113
+ big_df["持股变动信息-占流通股比例"]
114
+ )
110
115
  big_df["变动后持股情况-持股总数"] = pd.to_numeric(big_df["变动后持股情况-持股总数"])
111
- big_df["变动后持股情况-占总股本比例"] = pd.to_numeric(big_df["变动后持股情况-占总股本比例"])
112
- big_df["变动后持股情况-持流通股数"] = pd.to_numeric(big_df["变动后持股情况-持流通股数"])
113
- big_df["变动后持股情况-占流通股比例"] = pd.to_numeric(big_df["变动后持股情况-占流通股比例"])
116
+ big_df["变动后持股情况-占总股本比例"] = pd.to_numeric(
117
+ big_df["变动后持股情况-占总股本比例"]
118
+ )
119
+ big_df["变动后持股情况-持流通股数"] = pd.to_numeric(
120
+ big_df["变动后持股情况-持流通股数"]
121
+ )
122
+ big_df["变动后持股情况-占流通股比例"] = pd.to_numeric(
123
+ big_df["变动后持股情况-占流通股比例"]
124
+ )
114
125
  big_df["变动开始日"] = pd.to_datetime(big_df["变动开始日"]).dt.date
115
126
  big_df["变动截止日"] = pd.to_datetime(big_df["变动截止日"]).dt.date
116
127
  big_df["公告日"] = pd.to_datetime(big_df["公告日"]).dt.date
@@ -5,6 +5,7 @@ Date: 2023/4/10 16:05
5
5
  Desc: 乐咕乐股-股息率-A 股股息率
6
6
  https://legulegu.com/stockdata/guxilv
7
7
  """
8
+
8
9
  import pandas as pd
9
10
  import requests
10
11
 
@@ -32,7 +33,7 @@ def stock_a_gxl_lg(symbol: str = "上证A股") -> pd.DataFrame:
32
33
  r = requests.get(
33
34
  url,
34
35
  params=params,
35
- **get_cookie_csrf(url="https://legulegu.com/stockdata/guxilv")
36
+ **get_cookie_csrf(url="https://legulegu.com/stockdata/guxilv"),
36
37
  )
37
38
  data_json = r.json()
38
39
  temp_df = pd.DataFrame(data_json[symbol_map[symbol]])
@@ -63,7 +64,7 @@ def stock_hk_gxl_lg() -> pd.DataFrame:
63
64
  r = requests.get(
64
65
  url,
65
66
  params=params,
66
- **get_cookie_csrf(url="https://legulegu.com/stockdata/market/hk/dv/hsi")
67
+ **get_cookie_csrf(url="https://legulegu.com/stockdata/market/hk/dv/hsi"),
67
68
  )
68
69
  data_json = r.json()
69
70
  temp_df = pd.DataFrame(data_json)
@@ -32,7 +32,6 @@ def stock_zh_a_spot_em() -> pd.DataFrame:
32
32
  "fs": "m:0 t:6,m:0 t:80,m:1 t:2,m:1 t:23,m:0 t:81 s:2048",
33
33
  "fields": "f1,f2,f3,f4,f5,f6,f7,f8,f9,f10,f12,f13,f14,f15,f16,f17,f18,"
34
34
  "f20,f21,f23,f24,f25,f22,f11,f62,f128,f136,f115,f152",
35
- "_": "1623833739532",
36
35
  }
37
36
  temp_df = fetch_paginated_data(url, params)
38
37
  temp_df.columns = [
@@ -142,7 +141,6 @@ def stock_sh_a_spot_em() -> pd.DataFrame:
142
141
  "fs": "m:1 t:2,m:1 t:23",
143
142
  "fields": "f1,f2,f3,f4,f5,f6,f7,f8,f9,f10,f12,f13,f14,f15,f16,f17,f18,f20,f21,f23,"
144
143
  "f24,f25,f22,f11,f62,f128,f136,f115,f152",
145
- "_": "1623833739532",
146
144
  }
147
145
  temp_df = fetch_paginated_data(url, params)
148
146
  temp_df.columns = [
@@ -251,7 +249,6 @@ def stock_sz_a_spot_em() -> pd.DataFrame:
251
249
  "fs": "m:0 t:6,m:0 t:80",
252
250
  "fields": "f1,f2,f3,f4,f5,f6,f7,f8,f9,f10,f12,f13,f14,f15,f16,f17,f18,f20,f21,f23,f24,"
253
251
  "f25,f22,f11,f62,f128,f136,f115,f152",
254
- "_": "1623833739532",
255
252
  }
256
253
  temp_df = fetch_paginated_data(url, params)
257
254
  temp_df.columns = [
@@ -360,7 +357,6 @@ def stock_bj_a_spot_em() -> pd.DataFrame:
360
357
  "fs": "m:0 t:81 s:2048",
361
358
  "fields": "f1,f2,f3,f4,f5,f6,f7,f8,f9,f10,f12,f13,f14,f15,f16,f17,f18,f20,f21,f23,f24"
362
359
  ",f25,f22,f11,f62,f128,f136,f115,f152",
363
- "_": "1623833739532",
364
360
  }
365
361
  temp_df = fetch_paginated_data(url, params)
366
362
  temp_df.columns = [
@@ -470,7 +466,6 @@ def stock_new_a_spot_em() -> pd.DataFrame:
470
466
  "fs": "m:0 f:8,m:1 f:8",
471
467
  "fields": "f1,f2,f3,f4,f5,f6,f7,f8,f9,f10,f12,f13,f14,f15,f16,f17,f18,f20,f21,f23,f24,"
472
468
  "f25,f26,f22,f11,f62,f128,f136,f115,f152",
473
- "_": "1623833739532",
474
469
  }
475
470
  temp_df = fetch_paginated_data(url, params)
476
471
  temp_df.columns = [
@@ -584,7 +579,6 @@ def stock_cy_a_spot_em() -> pd.DataFrame:
584
579
  "fs": "m:0 t:80",
585
580
  "fields": "f1,f2,f3,f4,f5,f6,f7,f8,f9,f10,f12,f13,f14,f15,f16,f17,f18,f20,f21,"
586
581
  "f23,f24,f25,f22,f11,f62,f128,f136,f115,f152",
587
- "_": "1623833739532",
588
582
  }
589
583
  temp_df = fetch_paginated_data(url, params)
590
584
  temp_df.columns = [
@@ -694,7 +688,6 @@ def stock_kc_a_spot_em() -> pd.DataFrame:
694
688
  "fs": "m:1 t:23",
695
689
  "fields": "f1,f2,f3,f4,f5,f6,f7,f8,f9,f10,f12,f13,f14,f15,f16,f17,f18,f20,"
696
690
  "f21,f23,f24,f25,f22,f11,f62,f128,f136,f115,f152",
697
- "_": "1623833739532",
698
691
  }
699
692
  temp_df = fetch_paginated_data(url, params)
700
693
  temp_df.columns = [
@@ -803,7 +796,6 @@ def stock_zh_b_spot_em() -> pd.DataFrame:
803
796
  "fs": "m:0 t:7,m:1 t:3",
804
797
  "fields": "f1,f2,f3,f4,f5,f6,f7,f8,f9,f10,f12,f13,f14,f15,f16,f17,f18,f20"
805
798
  ",f21,f23,f24,f25,f22,f11,f62,f128,f136,f115,f152",
806
- "_": "1623833739532",
807
799
  }
808
800
  temp_df = fetch_paginated_data(url, params)
809
801
  temp_df.columns = [
@@ -931,7 +923,6 @@ def stock_zh_a_hist(
931
923
  "secid": f"{market_code}.{symbol}",
932
924
  "beg": start_date,
933
925
  "end": end_date,
934
- "_": "1623766962675",
935
926
  }
936
927
  r = requests.get(url, params=params, timeout=timeout)
937
928
  data_json = r.json()
@@ -1021,7 +1012,6 @@ def stock_zh_a_hist_min_em(
1021
1012
  "ndays": "5",
1022
1013
  "iscr": "0",
1023
1014
  "secid": f"{market_code}.{symbol}",
1024
- "_": "1623766962675",
1025
1015
  }
1026
1016
  r = requests.get(url, timeout=15, params=params)
1027
1017
  data_json = r.json()
@@ -1061,7 +1051,6 @@ def stock_zh_a_hist_min_em(
1061
1051
  "secid": f"{market_code}.{symbol}",
1062
1052
  "beg": "0",
1063
1053
  "end": "20500000",
1064
- "_": "1630930917857",
1065
1054
  }
1066
1055
  r = requests.get(url, timeout=15, params=params)
1067
1056
  data_json = r.json()
@@ -1140,7 +1129,6 @@ def stock_zh_a_hist_pre_min_em(
1140
1129
  "iscr": "1",
1141
1130
  "iscca": "0",
1142
1131
  "secid": f"{market_code}.{symbol}",
1143
- "_": "1623766962675",
1144
1132
  }
1145
1133
  r = requests.get(url, timeout=15, params=params)
1146
1134
  data_json = r.json()
@@ -1190,7 +1178,6 @@ def stock_hk_spot_em() -> pd.DataFrame:
1190
1178
  "fs": "m:128 t:3,m:128 t:4,m:128 t:1,m:128 t:2",
1191
1179
  "fields": "f1,f2,f3,f4,f5,f6,f7,f8,f9,f10,f12,f13,f14,f15,f16,f17,f18,f20,"
1192
1180
  "f21,f23,f24,f25,f22,f11,f62,f128,f136,f115,f152",
1193
- "_": "1624010056945",
1194
1181
  }
1195
1182
  temp_df = fetch_paginated_data(url, params)
1196
1183
  temp_df.columns = [
@@ -1276,7 +1263,6 @@ def stock_hk_main_board_spot_em() -> pd.DataFrame:
1276
1263
  "fs": "m:128 t:3",
1277
1264
  "fields": "f1,f2,f3,f4,f5,f6,f7,f8,f9,f10,f12,f13,f14,f15,f16,f17,f18,f20,"
1278
1265
  "f21,f23,f24,f25,f22,f11,f62,f128,f136,f115,f152",
1279
- "_": "1624010056945",
1280
1266
  }
1281
1267
  temp_df = fetch_paginated_data(url, params)
1282
1268
  temp_df.columns = [
@@ -1377,7 +1363,6 @@ def stock_hk_hist(
1377
1363
  "fqt": adjust_dict[adjust],
1378
1364
  "end": "20500000",
1379
1365
  "lmt": "1000000",
1380
- "_": "1623766962675",
1381
1366
  }
1382
1367
  r = requests.get(url, timeout=15, params=params)
1383
1368
  data_json = r.json()
@@ -1453,7 +1438,6 @@ def stock_hk_hist_min_em(
1453
1438
  "iscr": "0",
1454
1439
  "ndays": "5",
1455
1440
  "secid": f"116.{symbol}",
1456
- "_": "1623766962675",
1457
1441
  }
1458
1442
  r = requests.get(url, timeout=15, params=params)
1459
1443
  data_json = r.json()
@@ -1493,7 +1477,6 @@ def stock_hk_hist_min_em(
1493
1477
  "secid": f"116.{symbol}",
1494
1478
  "beg": "0",
1495
1479
  "end": "20500000",
1496
- "_": "1630930917857",
1497
1480
  }
1498
1481
  r = requests.get(url, timeout=15, params=params)
1499
1482
  data_json = r.json()
@@ -1565,7 +1548,6 @@ def stock_us_spot_em() -> pd.DataFrame:
1565
1548
  "fs": "m:105,m:106,m:107",
1566
1549
  "fields": "f1,f2,f3,f4,f5,f6,f7,f8,f9,f10,f12,f13,f14,f15,f16,f17,f18,f20,"
1567
1550
  "f21,f23,f24,f25,f26,f22,f33,f11,f62,f128,f136,f115,f152",
1568
- "_": "1624010056945",
1569
1551
  }
1570
1552
  temp_df = fetch_paginated_data(url, params)
1571
1553
  temp_df.columns = [
@@ -1676,7 +1658,6 @@ def stock_us_hist(
1676
1658
  "fqt": adjust_dict[adjust],
1677
1659
  "end": "20500000",
1678
1660
  "lmt": "1000000",
1679
- "_": "1623766962675",
1680
1661
  }
1681
1662
  r = requests.get(url, timeout=15, params=params)
1682
1663
  data_json = r.json()
@@ -1738,7 +1719,6 @@ def stock_us_hist_min_em(
1738
1719
  "iscr": "0",
1739
1720
  "ndays": "5",
1740
1721
  "secid": f"{symbol.split('.')[0]}.{symbol.split('.')[1]}",
1741
- "_": "1623766962675",
1742
1722
  }
1743
1723
  r = requests.get(url, params=params, timeout=15)
1744
1724
  data_json = r.json()
@@ -5,6 +5,7 @@ Date: 2023/7/25 15:30
5
5
  Desc: 腾讯证券-行情首页-沪深京A股
6
6
  https://quote.eastmoney.com/
7
7
  """
8
+
8
9
  import datetime
9
10
 
10
11
  import pandas as pd
@@ -16,11 +17,11 @@ from akshare.utils.tqdm import get_tqdm
16
17
 
17
18
 
18
19
  def stock_zh_a_hist_tx(
19
- symbol: str = "sz000001",
20
- start_date: str = "19000101",
21
- end_date: str = "20500101",
22
- adjust: str = "",
23
- timeout: float = None,
20
+ symbol: str = "sz000001",
21
+ start_date: str = "19000101",
22
+ end_date: str = "20500101",
23
+ adjust: str = "",
24
+ timeout: float = None,
24
25
  ) -> pd.DataFrame:
25
26
  """
26
27
  腾讯证券-日频-股票历史数据
@@ -57,7 +58,7 @@ def stock_zh_a_hist_tx(
57
58
  }
58
59
  r = requests.get(url, params=params, timeout=timeout)
59
60
  data_text = r.text
60
- data_json = demjson.decode(data_text[data_text.find("={") + 1:])["data"][
61
+ data_json = demjson.decode(data_text[data_text.find("={") + 1 :])["data"][
61
62
  symbol
62
63
  ]
63
64
  if "day" in data_json.keys():
@@ -83,6 +84,7 @@ def stock_zh_a_hist_tx(
83
84
 
84
85
 
85
86
  if __name__ == "__main__":
86
- stock_zh_a_hist_tx_df = stock_zh_a_hist_tx(symbol="sz000001", start_date="20200101", end_date="20231027",
87
- adjust="hfq")
87
+ stock_zh_a_hist_tx_df = stock_zh_a_hist_tx(
88
+ symbol="sz000001", start_date="20200101", end_date="20231027", adjust="hfq"
89
+ )
88
90
  print(stock_zh_a_hist_tx_df)