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

akshare/__init__.py CHANGED
@@ -2938,9 +2938,11 @@ amac_manager_cancelled_info # 中国证券投资基金业协会-信息公示-诚
2938
2938
  1.15.26 fix: fix option_dce_daily interface
2939
2939
  1.15.27 fix: fix stock_zh_index_spot_em interface
2940
2940
  1.15.28 fix: fix stock_hk_valuation_baidu interface
2941
+ 1.15.29 fix: fix option_dce_daily interface
2942
+ 1.15.30 fix: fix fund_etf_category_sina interface
2941
2943
  """
2942
2944
 
2943
- __version__ = "1.15.28"
2945
+ __version__ = "1.15.30"
2944
2946
  __author__ = "AKFamily"
2945
2947
 
2946
2948
  import sys
@@ -1,14 +1,14 @@
1
1
  #!/usr/bin/env python
2
2
  # -*- coding:utf-8 -*-
3
3
  """
4
- Date: 2022/2/15 17:33
4
+ Date: 2024/11/22 14:00
5
5
  Desc: 新浪财经-基金行情
6
- http://vip.stock.finance.sina.com.cn/fund_center/index.html#jjhqetf
6
+ https://vip.stock.finance.sina.com.cn/fund_center/index.html#jjhqetf
7
7
  """
8
8
 
9
9
  import pandas as pd
10
- import requests
11
10
  import py_mini_racer
11
+ import requests
12
12
 
13
13
  from akshare.stock.cons import hk_js_decode
14
14
  from akshare.utils import demjson
@@ -28,10 +28,13 @@ def fund_etf_category_sina(symbol: str = "LOF基金") -> pd.DataFrame:
28
28
  "ETF基金": "etf_hq_fund",
29
29
  "LOF基金": "lof_hq_fund",
30
30
  }
31
- url = "http://vip.stock.finance.sina.com.cn/quotes_service/api/jsonp.php/IO.XSRV2.CallbackList['da_yPT46_Ll7K6WD']/Market_Center.getHQNodeDataSimple"
31
+ url = (
32
+ "https://vip.stock.finance.sina.com.cn/quotes_service/api/jsonp.php/"
33
+ "IO.XSRV2.CallbackList['da_yPT46_Ll7K6WD']/Market_Center.getHQNodeDataSimple"
34
+ )
32
35
  params = {
33
36
  "page": "1",
34
- "num": "1000",
37
+ "num": "5000",
35
38
  "sort": "symbol",
36
39
  "asc": "0",
37
40
  "node": fund_map[symbol],
@@ -96,21 +99,21 @@ def fund_etf_category_sina(symbol: str = "LOF基金") -> pd.DataFrame:
96
99
  "成交额",
97
100
  ]
98
101
  ]
99
- temp_df["最新价"] = pd.to_numeric(temp_df["最新价"])
100
- temp_df["涨跌额"] = pd.to_numeric(temp_df["涨跌额"])
101
- temp_df["涨跌幅"] = pd.to_numeric(temp_df["涨跌幅"])
102
- temp_df["买入"] = pd.to_numeric(temp_df["买入"])
103
- temp_df["卖出"] = pd.to_numeric(temp_df["卖出"])
104
- temp_df["昨收"] = pd.to_numeric(temp_df["昨收"])
105
- temp_df["今开"] = pd.to_numeric(temp_df["今开"])
106
- temp_df["最高"] = pd.to_numeric(temp_df["最高"])
107
- temp_df["最低"] = pd.to_numeric(temp_df["最低"])
108
- temp_df["成交量"] = pd.to_numeric(temp_df["成交量"])
109
- temp_df["成交额"] = pd.to_numeric(temp_df["成交额"])
102
+ temp_df["最新价"] = pd.to_numeric(temp_df["最新价"], errors="coerce")
103
+ temp_df["涨跌额"] = pd.to_numeric(temp_df["涨跌额"], errors="coerce")
104
+ temp_df["涨跌幅"] = pd.to_numeric(temp_df["涨跌幅"], errors="coerce")
105
+ temp_df["买入"] = pd.to_numeric(temp_df["买入"], errors="coerce")
106
+ temp_df["卖出"] = pd.to_numeric(temp_df["卖出"], errors="coerce")
107
+ temp_df["昨收"] = pd.to_numeric(temp_df["昨收"], errors="coerce")
108
+ temp_df["今开"] = pd.to_numeric(temp_df["今开"], errors="coerce")
109
+ temp_df["最高"] = pd.to_numeric(temp_df["最高"], errors="coerce")
110
+ temp_df["最低"] = pd.to_numeric(temp_df["最低"], errors="coerce")
111
+ temp_df["成交量"] = pd.to_numeric(temp_df["成交量"], errors="coerce")
112
+ temp_df["成交额"] = pd.to_numeric(temp_df["成交额"], errors="coerce")
110
113
  return temp_df
111
114
 
112
115
 
113
- def fund_etf_hist_sina(symbol: str = "sz159996") -> pd.DataFrame:
116
+ def fund_etf_hist_sina(symbol: str = "sh510050") -> pd.DataFrame:
114
117
  """
115
118
  新浪财经-基金-ETF 基金-日行情数据
116
119
  https://finance.sina.com.cn/fund/quotes/159996/bc.shtml
@@ -129,12 +132,12 @@ def fund_etf_hist_sina(symbol: str = "sz159996") -> pd.DataFrame:
129
132
  temp_df = pd.DataFrame(dict_list)
130
133
  if temp_df.empty: # 处理获取数据为空的问题
131
134
  return pd.DataFrame()
132
- temp_df["date"] = pd.to_datetime(temp_df["date"]).dt.date
133
- temp_df["open"] = pd.to_numeric(temp_df["open"])
134
- temp_df["high"] = pd.to_numeric(temp_df["high"])
135
- temp_df["low"] = pd.to_numeric(temp_df["low"])
136
- temp_df["close"] = pd.to_numeric(temp_df["close"])
137
- temp_df["volume"] = pd.to_numeric(temp_df["volume"])
135
+ temp_df["date"] = pd.to_datetime(temp_df["date"], errors="coerce").dt.date
136
+ temp_df["open"] = pd.to_numeric(temp_df["open"], errors="coerce")
137
+ temp_df["high"] = pd.to_numeric(temp_df["high"], errors="coerce")
138
+ temp_df["low"] = pd.to_numeric(temp_df["low"], errors="coerce")
139
+ temp_df["close"] = pd.to_numeric(temp_df["close"], errors="coerce")
140
+ temp_df["volume"] = pd.to_numeric(temp_df["volume"], errors="coerce")
138
141
  return temp_df
139
142
 
140
143
 
@@ -80,7 +80,7 @@ def option_dce_daily(
80
80
  elif symbol == "玉米期权":
81
81
  result_one_df, result_two_df = (
82
82
  table_df[table_df["商品名称"] == "玉米"],
83
- another_df[another_df.iloc[:, 0].str.contains("c")],
83
+ another_df[another_df.iloc[:, 0].str.contains(r"^c\d")],
84
84
  )
85
85
  elif symbol == "铁矿石期权":
86
86
  result_one_df, result_two_df = (
@@ -163,6 +163,43 @@ def option_dce_daily(
163
163
  return result_one_df, result_two_df
164
164
 
165
165
 
166
+ def __option_czce_daily_convert_numeric_columns(df):
167
+ # 定义要处理的列
168
+ columns_to_convert = [
169
+ "昨结算",
170
+ "今开盘",
171
+ "最高价",
172
+ "最低价",
173
+ "今收盘",
174
+ "今结算",
175
+ "涨跌1",
176
+ "涨跌2",
177
+ "成交量(手)",
178
+ "持仓量",
179
+ "增减量",
180
+ "成交额(万元)",
181
+ "DELTA",
182
+ "隐含波动率",
183
+ "行权量",
184
+ ]
185
+
186
+ # 转换函数:去除逗号并转换为float
187
+ def convert_to_float(x):
188
+ try:
189
+ return float(str(x).replace(",", ""))
190
+ except: # noqa: E722
191
+ return x
192
+
193
+ # 创建DataFrame的副本以避免SettingWithCopyWarning
194
+ df_copy = df.copy()
195
+ df_copy.columns = [item.strip() for item in df_copy]
196
+ # 应用转换
197
+ for col in columns_to_convert:
198
+ df_copy[col] = df_copy[col].apply(convert_to_float)
199
+
200
+ return df_copy
201
+
202
+
166
203
  def option_czce_daily(
167
204
  symbol: str = "白糖期权", trade_date: str = "20191017"
168
205
  ) -> pd.DataFrame:
@@ -192,82 +229,118 @@ def option_czce_daily(
192
229
  if symbol == "白糖期权":
193
230
  temp_df = table_df[table_df.iloc[:, 0].str.contains("SR")]
194
231
  temp_df.reset_index(inplace=True, drop=True)
195
- return temp_df.iloc[:-1, :]
232
+ temp_df = temp_df.iloc[:-1, :].copy()
233
+ new_df = __option_czce_daily_convert_numeric_columns(temp_df)
234
+ return new_df
196
235
  elif symbol == "棉花期权":
197
236
  temp_df = table_df[table_df.iloc[:, 0].str.contains("CF")]
198
237
  temp_df.reset_index(inplace=True, drop=True)
199
- return temp_df.iloc[:-1, :]
238
+ temp_df = temp_df.iloc[:-1, :].copy()
239
+ new_df = __option_czce_daily_convert_numeric_columns(temp_df)
240
+ return new_df
200
241
  elif symbol == "甲醇期权":
201
242
  temp_df = table_df[table_df.iloc[:, 0].str.contains("MA")]
202
243
  temp_df.reset_index(inplace=True, drop=True)
203
- return temp_df.iloc[:-1, :]
244
+ temp_df = temp_df.iloc[:-1, :].copy()
245
+ new_df = __option_czce_daily_convert_numeric_columns(temp_df)
246
+ return new_df
204
247
  elif symbol == "PTA期权":
205
248
  temp_df = table_df[table_df.iloc[:, 0].str.contains("TA")]
206
249
  temp_df.reset_index(inplace=True, drop=True)
207
- return temp_df.iloc[:-1, :]
250
+ temp_df = temp_df.iloc[:-1, :].copy()
251
+ new_df = __option_czce_daily_convert_numeric_columns(temp_df)
252
+ return new_df
208
253
  elif symbol == "菜籽粕期权":
209
254
  temp_df = table_df[table_df.iloc[:, 0].str.contains("RM")]
210
255
  temp_df.reset_index(inplace=True, drop=True)
211
- return temp_df.iloc[:-1, :]
256
+ temp_df = temp_df.iloc[:-1, :].copy()
257
+ new_df = __option_czce_daily_convert_numeric_columns(temp_df)
258
+ return new_df
212
259
  elif symbol == "动力煤期权":
213
260
  temp_df = table_df[table_df.iloc[:, 0].str.contains("ZC")]
214
261
  temp_df.reset_index(inplace=True, drop=True)
215
- return temp_df.iloc[:-1, :]
262
+ temp_df = temp_df.iloc[:-1, :].copy()
263
+ new_df = __option_czce_daily_convert_numeric_columns(temp_df)
264
+ return new_df
216
265
  elif symbol == "短纤期权":
217
266
  temp_df = table_df[table_df.iloc[:, 0].str.contains("PF")]
218
267
  temp_df.reset_index(inplace=True, drop=True)
219
- return temp_df.iloc[:-1, :]
268
+ temp_df = temp_df.iloc[:-1, :].copy()
269
+ new_df = __option_czce_daily_convert_numeric_columns(temp_df)
270
+ return new_df
220
271
  elif symbol == "菜籽油期权":
221
272
  temp_df = table_df[table_df.iloc[:, 0].str.contains("OI")]
222
273
  temp_df.reset_index(inplace=True, drop=True)
223
- return temp_df.iloc[:-1, :]
274
+ temp_df = temp_df.iloc[:-1, :].copy()
275
+ new_df = __option_czce_daily_convert_numeric_columns(temp_df)
276
+ return new_df
224
277
  elif symbol == "花生期权":
225
278
  temp_df = table_df[table_df.iloc[:, 0].str.contains("PK")]
226
279
  temp_df.reset_index(inplace=True, drop=True)
227
- return temp_df.iloc[:-1, :]
280
+ temp_df = temp_df.iloc[:-1, :].copy()
281
+ new_df = __option_czce_daily_convert_numeric_columns(temp_df)
282
+ return new_df
228
283
  elif symbol == "纯碱期权":
229
284
  temp_df = table_df[table_df.iloc[:, 0].str.contains("SA")]
230
285
  temp_df.reset_index(inplace=True, drop=True)
231
- return temp_df.iloc[:-1, :]
286
+ temp_df = temp_df.iloc[:-1, :].copy()
287
+ new_df = __option_czce_daily_convert_numeric_columns(temp_df)
288
+ return new_df
232
289
  elif symbol == "锰硅期权":
233
290
  temp_df = table_df[table_df.iloc[:, 0].str.contains("SM")]
234
291
  temp_df.reset_index(inplace=True, drop=True)
235
- return temp_df.iloc[:-1, :]
292
+ temp_df = temp_df.iloc[:-1, :].copy()
293
+ new_df = __option_czce_daily_convert_numeric_columns(temp_df)
294
+ return new_df
236
295
  elif symbol == "硅铁期权":
237
296
  temp_df = table_df[table_df.iloc[:, 0].str.contains("SF")]
238
297
  temp_df.reset_index(inplace=True, drop=True)
239
- return temp_df.iloc[:-1, :]
298
+ temp_df = temp_df.iloc[:-1, :].copy()
299
+ new_df = __option_czce_daily_convert_numeric_columns(temp_df)
300
+ return new_df
240
301
  elif symbol == "尿素期权":
241
302
  temp_df = table_df[table_df.iloc[:, 0].str.contains("UR")]
242
303
  temp_df.reset_index(inplace=True, drop=True)
243
- return temp_df.iloc[:-1, :]
304
+ temp_df = temp_df.iloc[:-1, :].copy()
305
+ new_df = __option_czce_daily_convert_numeric_columns(temp_df)
306
+ return new_df
244
307
  elif symbol == "苹果期权":
245
308
  temp_df = table_df[table_df.iloc[:, 0].str.contains("AP")]
246
309
  temp_df.reset_index(inplace=True, drop=True)
247
- return temp_df.iloc[:-1, :]
310
+ temp_df = temp_df.iloc[:-1, :].copy()
311
+ new_df = __option_czce_daily_convert_numeric_columns(temp_df)
312
+ return new_df
248
313
  elif symbol == "红枣期权":
249
314
  temp_df = table_df[table_df.iloc[:, 0].str.contains("CJ")]
250
315
  temp_df.reset_index(inplace=True, drop=True)
251
- return temp_df.iloc[:-1, :]
316
+ temp_df = temp_df.iloc[:-1, :].copy()
317
+ new_df = __option_czce_daily_convert_numeric_columns(temp_df)
318
+ return new_df
252
319
  elif symbol == "对二甲苯期权":
253
320
  temp_df = table_df[table_df.iloc[:, 0].str.contains("PX")]
254
321
  temp_df.reset_index(inplace=True, drop=True)
255
- return temp_df.iloc[:-1, :]
322
+ temp_df = temp_df.iloc[:-1, :].copy()
323
+ new_df = __option_czce_daily_convert_numeric_columns(temp_df)
324
+ return new_df
256
325
  elif symbol == "烧碱期权":
257
326
  temp_df = table_df[table_df.iloc[:, 0].str.contains("SH")]
258
327
  temp_df.reset_index(inplace=True, drop=True)
259
- return temp_df.iloc[:-1, :]
328
+ temp_df = temp_df.iloc[:-1, :].copy()
329
+ new_df = __option_czce_daily_convert_numeric_columns(temp_df)
330
+ return new_df
260
331
  elif symbol == "玻璃期权":
261
332
  temp_df = table_df[table_df.iloc[:, 0].str.contains("FG")]
262
333
  temp_df.reset_index(inplace=True, drop=True)
263
- return temp_df.iloc[:-1, :]
334
+ temp_df = temp_df.iloc[:-1, :].copy()
335
+ new_df = __option_czce_daily_convert_numeric_columns(temp_df)
336
+ return new_df
264
337
  except: # noqa: E722
265
338
  return pd.DataFrame()
266
339
 
267
340
 
268
341
  def option_shfe_daily(
269
342
  symbol: str = "铝期权", trade_date: str = "20200827"
270
- ) -> Optional[pd.DataFrame]:
343
+ ) -> Optional[tuple[pd.DataFrame, pd.DataFrame]]:
271
344
  """
272
345
  上海期货交易所-期权-日频行情数据
273
346
  https://tsite.shfe.com.cn/statements/dataview.html?paramid=kxQ
@@ -527,11 +600,11 @@ def option_gfex_vol_daily(symbol: str = "碳酸锂", trade_date: str = "20230724
527
600
 
528
601
 
529
602
  if __name__ == "__main__":
530
- option_czce_daily_df = option_czce_daily(symbol="短纤期权", trade_date="20240718")
603
+ option_czce_daily_df = option_czce_daily(symbol="白糖期权", trade_date="20240711")
531
604
  print(option_czce_daily_df)
532
605
 
533
606
  option_dce_daily_one, option_dce_daily_two = option_dce_daily(
534
- symbol="鸡蛋期权", trade_date="20241118"
607
+ symbol="玉米期权", trade_date="20241121"
535
608
  )
536
609
  print(option_dce_daily_one)
537
610
  print(option_dce_daily_two)
@@ -138,7 +138,7 @@ def stock_zh_a_daily(
138
138
  :type start_date: str
139
139
  :param end_date: 20201103; 结束日期
140
140
  :type end_date: str
141
- :param adjust: 默认为空: 返回不复权的数据; qfq: 返回前复权后的数据; hfq: 返回后复权后的数据; hfq-factor: 返回后复权因子; hfq-factor: 返回前复权因子
141
+ :param adjust: 默认为空: 返回不复权的数据; qfq: 返回前复权后的数据; hfq: 返回后复权后的数据; hfq-factor: 返回后复权因子; qfq-factor: 返回前复权因子
142
142
  :type adjust: str
143
143
  :return: 行情数据
144
144
  :rtype: pandas.DataFrame
@@ -136,7 +136,7 @@ def stock_zh_b_daily(
136
136
  :type end_date: str
137
137
  :param symbol: sh600000
138
138
  :type symbol: str
139
- :param adjust: 默认为空: 返回不复权的数据; qfq: 返回前复权后的数据; hfq: 返回后复权后的数据; hfq-factor: 返回后复权因子; hfq-factor: 返回前复权因子
139
+ :param adjust: 默认为空: 返回不复权的数据; qfq: 返回前复权后的数据; hfq: 返回后复权后的数据; hfq-factor: 返回后复权因子; qfq-factor: 返回前复权因子
140
140
  :type adjust: str
141
141
  :return: specific data
142
142
  :rtype: pandas.DataFrame
@@ -4,6 +4,7 @@
4
4
  Date: 2023/7/6 19:28
5
5
  Desc: 新浪财经-科创板-实时行情数据和历史行情数据(包含前复权和后复权因子)
6
6
  """
7
+
7
8
  import datetime
8
9
  import re
9
10
 
@@ -61,59 +62,61 @@ def stock_zh_kcb_spot() -> pd.DataFrame:
61
62
  "最新价",
62
63
  "涨跌额",
63
64
  "涨跌幅",
64
- '买入',
65
- '卖出',
66
- '昨收',
67
- '今开',
68
- '最高',
69
- '最低',
70
- '成交量',
71
- '成交额',
72
- '时点',
73
- '市盈率',
74
- '市净率',
75
- '流通市值',
76
- '总市值',
77
- '换手率',
65
+ "买入",
66
+ "卖出",
67
+ "昨收",
68
+ "今开",
69
+ "最高",
70
+ "最低",
71
+ "成交量",
72
+ "成交额",
73
+ "时点",
74
+ "市盈率",
75
+ "市净率",
76
+ "流通市值",
77
+ "总市值",
78
+ "换手率",
79
+ ]
80
+ big_df = big_df[
81
+ [
82
+ "代码",
83
+ "名称",
84
+ "最新价",
85
+ "涨跌额",
86
+ "涨跌幅",
87
+ "买入",
88
+ "卖出",
89
+ "昨收",
90
+ "今开",
91
+ "最高",
92
+ "最低",
93
+ "成交量",
94
+ "成交额",
95
+ "时点",
96
+ "市盈率",
97
+ "市净率",
98
+ "流通市值",
99
+ "总市值",
100
+ "换手率",
101
+ ]
78
102
  ]
79
- big_df = big_df[[
80
- "代码",
81
- "名称",
82
- "最新价",
83
- "涨跌额",
84
- "涨跌幅",
85
- '买入',
86
- '卖出',
87
- '昨收',
88
- '今开',
89
- '最高',
90
- '最低',
91
- '成交量',
92
- '成交额',
93
- '时点',
94
- '市盈率',
95
- '市净率',
96
- '流通市值',
97
- '总市值',
98
- '换手率',
99
- ]]
100
103
 
101
- big_df['最新价'] = pd.to_numeric(big_df['最新价'])
102
- big_df['涨跌额'] = pd.to_numeric(big_df['涨跌额'])
103
- big_df['涨跌幅'] = pd.to_numeric(big_df['涨跌幅'])
104
- big_df['买入'] = pd.to_numeric(big_df['买入'])
105
- big_df['卖出'] = pd.to_numeric(big_df['卖出'])
106
- big_df['昨收'] = pd.to_numeric(big_df['昨收'])
107
- big_df['今开'] = pd.to_numeric(big_df['今开'])
108
- big_df['最高'] = pd.to_numeric(big_df['最高'])
109
- big_df['最低'] = pd.to_numeric(big_df['最低'])
110
- 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['市净率'])
114
- big_df['流通市值'] = pd.to_numeric(big_df['流通市值'])
115
- big_df['总市值'] = pd.to_numeric(big_df['总市值'])
116
- big_df['换手率'] = pd.to_numeric(big_df['换手率'])
104
+ big_df["最新价"] = pd.to_numeric(big_df["最新价"])
105
+ big_df["涨跌额"] = pd.to_numeric(big_df["涨跌额"])
106
+ big_df["涨跌幅"] = pd.to_numeric(big_df["涨跌幅"])
107
+ big_df["买入"] = pd.to_numeric(big_df["买入"])
108
+ big_df["卖出"] = pd.to_numeric(big_df["卖出"])
109
+ big_df["昨收"] = pd.to_numeric(big_df["昨收"])
110
+ 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["成交量"])
114
+ big_df["成交额"] = pd.to_numeric(big_df["成交额"])
115
+ big_df["市盈率"] = pd.to_numeric(big_df["市盈率"])
116
+ big_df["市净率"] = pd.to_numeric(big_df["市净率"])
117
+ big_df["流通市值"] = pd.to_numeric(big_df["流通市值"])
118
+ big_df["总市值"] = pd.to_numeric(big_df["总市值"])
119
+ big_df["换手率"] = pd.to_numeric(big_df["换手率"])
117
120
  return big_df
118
121
 
119
122
 
@@ -123,7 +126,7 @@ def stock_zh_kcb_daily(symbol: str = "sh688399", adjust: str = "") -> pd.DataFra
123
126
  https://finance.sina.com.cn/realstock/company/sh688005/nc.shtml
124
127
  :param symbol: 股票代码; 带市场标识的股票代码
125
128
  :type symbol: str
126
- :param adjust: 默认不复权的数据; qfq: 返回前复权后的数据; hfq: 返回后复权后的数据; hfq-factor: 返回后复权因子; hfq-factor: 返回前复权因子
129
+ :param adjust: 默认不复权的数据; qfq: 返回前复权后的数据; hfq: 返回后复权后的数据; hfq-factor: 返回后复权因子; qfq-factor: 返回前复权因子
127
130
  :type adjust: str
128
131
  :return: 科创板股票的历史行情数据
129
132
  :rtype: pandas.DataFrame
@@ -150,12 +153,12 @@ def stock_zh_kcb_daily(symbol: str = "sh688399", adjust: str = "") -> pd.DataFra
150
153
  try:
151
154
  # try for pandas >= 2.1.0
152
155
  temp_df.ffill(inplace=True)
153
- except Exception as e:
156
+ except Exception:
154
157
  try:
155
- # try for pandas < 2.1.0
158
+ # try for pandas < 2.1.0
156
159
  temp_df.fillna(method="ffill", inplace=True)
157
160
  except Exception as e:
158
- print("Error:", e)
161
+ print("Error:", e)
159
162
  temp_df = temp_df.astype(float)
160
163
  temp_df["amount"] = temp_df["amount"] * 10000
161
164
  temp_df["turnover"] = temp_df["v"] / temp_df["amount"]
@@ -173,7 +176,7 @@ def stock_zh_kcb_daily(symbol: str = "sh688399", adjust: str = "") -> pd.DataFra
173
176
 
174
177
  if not adjust:
175
178
  temp_df.reset_index(inplace=True)
176
- temp_df['date'] = pd.to_datetime(temp_df['date']).dt.date
179
+ temp_df["date"] = pd.to_datetime(temp_df["date"]).dt.date
177
180
  return temp_df
178
181
 
179
182
  if adjust == "hfq":
@@ -191,9 +194,9 @@ def stock_zh_kcb_daily(symbol: str = "sh688399", adjust: str = "") -> pd.DataFra
191
194
  try:
192
195
  # try for pandas >= 2.1.0
193
196
  temp_df.ffill(inplace=True)
194
- except Exception as e:
197
+ except Exception:
195
198
  try:
196
- # try for pandas < 2.1.0
199
+ # try for pandas < 2.1.0
197
200
  temp_df.fillna(method="ffill", inplace=True)
198
201
  except Exception as e:
199
202
  print("Error:", e)
@@ -204,7 +207,7 @@ def stock_zh_kcb_daily(symbol: str = "sh688399", adjust: str = "") -> pd.DataFra
204
207
  temp_df["low"] = temp_df["low"] * temp_df["hfq_factor"]
205
208
  temp_df = temp_df.iloc[:, :-1]
206
209
  temp_df.reset_index(inplace=True)
207
- temp_df['date'] = pd.to_datetime(temp_df['date']).dt.date
210
+ temp_df["date"] = pd.to_datetime(temp_df["date"]).dt.date
208
211
  return temp_df
209
212
 
210
213
  if adjust == "qfq":
@@ -222,9 +225,9 @@ def stock_zh_kcb_daily(symbol: str = "sh688399", adjust: str = "") -> pd.DataFra
222
225
  try:
223
226
  # try for pandas >= 2.1.0
224
227
  temp_df.ffill(inplace=True)
225
- except Exception as e:
228
+ except Exception:
226
229
  try:
227
- # try for pandas < 2.1.0
230
+ # try for pandas < 2.1.0
228
231
  temp_df.fillna(method="ffill", inplace=True)
229
232
  except Exception as e:
230
233
  print("Error:", e)
@@ -235,7 +238,7 @@ def stock_zh_kcb_daily(symbol: str = "sh688399", adjust: str = "") -> pd.DataFra
235
238
  temp_df["low"] = temp_df["low"] / temp_df["qfq_factor"]
236
239
  temp_df = temp_df.iloc[:, :-1]
237
240
  temp_df.reset_index(inplace=True)
238
- temp_df['date'] = pd.to_datetime(temp_df['date']).dt.date
241
+ temp_df["date"] = pd.to_datetime(temp_df["date"]).dt.date
239
242
  return temp_df
240
243
 
241
244
  if adjust == "hfq-factor":
@@ -247,7 +250,7 @@ def stock_zh_kcb_daily(symbol: str = "sh688399", adjust: str = "") -> pd.DataFra
247
250
  hfq_factor_df.index = pd.to_datetime(hfq_factor_df.date)
248
251
  del hfq_factor_df["date"]
249
252
  hfq_factor_df.reset_index(inplace=True)
250
- hfq_factor_df['date'] = pd.to_datetime(hfq_factor_df['date']).dt.date
253
+ hfq_factor_df["date"] = pd.to_datetime(hfq_factor_df["date"]).dt.date
251
254
  return hfq_factor_df
252
255
 
253
256
  if adjust == "qfq-factor":
@@ -259,7 +262,7 @@ def stock_zh_kcb_daily(symbol: str = "sh688399", adjust: str = "") -> pd.DataFra
259
262
  qfq_factor_df.index = pd.to_datetime(qfq_factor_df.date)
260
263
  del qfq_factor_df["date"]
261
264
  qfq_factor_df.reset_index(inplace=True)
262
- qfq_factor_df['date'] = pd.to_datetime(qfq_factor_df['date']).dt.date
265
+ qfq_factor_df["date"] = pd.to_datetime(qfq_factor_df["date"]).dt.date
263
266
  return qfq_factor_df
264
267
 
265
268
 
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: akshare
3
- Version: 1.15.28
3
+ Version: 1.15.30
4
4
  Summary: AKShare is an elegant and simple financial data interface library for Python, built for human beings!
5
5
  Home-page: https://github.com/akfamily/akshare
6
6
  Author: AKFamily
@@ -40,7 +40,7 @@ Requires-Dist: akqmt; extra == "qmt"
40
40
 
41
41
  **欢迎加入专注于财经数据和量化投资的知识社区,请点击[了解更多](https://akshare.akfamily.xyz/learn.html)**
42
42
 
43
- **量化投研视频课程:《PyBroker-入门及实战》已经上架!**
43
+ **量化投研视频课程:《PyBroker-入门及实战》已经上架!《PyBroker-进阶及实战》正在更新!**
44
44
 
45
45
  **更多视频教程已经发布:《AKShare-初阶-使用教学》、《AKShare-初阶-实战应用》、《AKShare-源码解析》、《开源项目巡礼》**,
46
46
  详情请关注【数据科学实战】公众号,查看更多课程信息!
@@ -257,14 +257,10 @@ Special thanks [TuShare](https://github.com/waditu/tushare) for the opportunity
257
257
 
258
258
  Thanks for the data provided by [生意社网站](http://www.100ppi.com/);
259
259
 
260
- Thanks for the data provided by [奇货可查网站](https://qhkch.com/);
261
-
262
260
  Thanks for the data provided by [中国银行间市场交易商协会网站](http://www.nafmii.org.cn/);
263
261
 
264
262
  Thanks for the data provided by [99期货网站](http://www.99qh.com/);
265
263
 
266
- Thanks for the data provided by [英为财情网站](https://cn.investing.com/);
267
-
268
264
  Thanks for the data provided by [中国外汇交易中心暨全国银行间同业拆借中心网站](http://www.chinamoney.com.cn/chinese/);
269
265
 
270
266
  Thanks for the data provided by [金十数据网站](https://www.jin10.com/);
@@ -273,8 +269,6 @@ Thanks for the data provided by [和讯财经网站](http://www.hexun.com/);
273
269
 
274
270
  Thanks for the data provided by [新浪财经网站](https://finance.sina.com.cn/);
275
271
 
276
- Thanks for the data provided by [Oxford-Man Institute 网站](https://realized.oxford-man.ox.ac.uk/);
277
-
278
272
  Thanks for the data provided by [DACHENG-XIU 网站](https://dachxiu.chicagobooth.edu/);
279
273
 
280
274
  Thanks for the data provided by [上海证券交易所网站](http://www.sse.com.cn/assortment/options/price/);
@@ -301,12 +295,6 @@ Thanks for the data provided by [南华期货网站](http://www.nanhua.net/nhzc/
301
295
 
302
296
  Thanks for the data provided by [Economic Policy Uncertainty 网站](http://www.nanhua.net/nhzc/varietytrend.html);
303
297
 
304
- Thanks for the data provided by [微博指数网站](https://data.weibo.com/index/newindex);
305
-
306
- Thanks for the data provided by [百度指数网站](http://index.baidu.com/v2/main/index.html);
307
-
308
- Thanks for the data provided by [谷歌指数网站](https://trends.google.com/trends/?geo=US);
309
-
310
298
  Thanks for the data provided by [申万指数网站](http://www.swsindex.com/idx0120.aspx?columnid=8832);
311
299
 
312
300
  Thanks for the data provided by [真气网网站](https://www.zq12369.com/);
@@ -321,18 +309,12 @@ Thanks for the data provided by [北京市碳排放权电子交易平台网站](
321
309
 
322
310
  Thanks for the data provided by [国家金融与发展实验室网站](http://www.nifd.cn/);
323
311
 
324
- Thanks for the data provided by [IT桔子网站](https://www.itjuzi.com);
325
-
326
312
  Thanks for the data provided by [东方财富网站](http://data.eastmoney.com/jgdy/);
327
313
 
328
314
  Thanks for the data provided by [义乌小商品指数网站](http://www.ywindex.com/Home/Product/index/);
329
315
 
330
- Thanks for the data provided by [中国国家发展和改革委员会网站](http://jgjc.ndrc.gov.cn/dmzs.aspx?clmId=741);
331
-
332
316
  Thanks for the data provided by [百度迁徙网站](https://qianxi.baidu.com/?from=shoubai#city=0);
333
317
 
334
- Thanks for the data provided by [慈善中国网站](http://cishan.chinanpo.gov.cn/platform/login.html);
335
-
336
318
  Thanks for the data provided by [思知网站](https://www.ownthink.com/);
337
319
 
338
320
  Thanks for the data provided by [Currencyscoop 网站](https://currencyscoop.com/);
@@ -1,4 +1,4 @@
1
- akshare/__init__.py,sha256=8i1-bF44iMG9EqOv0Dfa2TsKHf8wo-1DQzOm1pqlphE,184088
1
+ akshare/__init__.py,sha256=p2G7VK9ddU9MzPrfL-MYZ-W5DMws0gNycqMUTmVBsIA,184182
2
2
  akshare/datasets.py,sha256=-qdwaQjgBlftX84uM74KJqCYJYkQ50PV416_neA4uls,995
3
3
  akshare/exceptions.py,sha256=WEJjIhSmJ_xXNW6grwV4nufE_cfmmyuhmueVGiN1VAg,878
4
4
  akshare/request.py,sha256=HtFFf9MhfEibR-ETWe-1Tts6ELU4VKSqA-ghaXjegQM,4252
@@ -89,7 +89,7 @@ akshare/fund/fund_announcement.py,sha256=g5rcIC9vQ4HapZd0b7cDbFYzHu9V6bOKhwxRHVf
89
89
  akshare/fund/fund_aum_em.py,sha256=dy1R1-0X48H8S-LPiuggNA5M-6MvQ08fnp5bytvCGPQ,3518
90
90
  akshare/fund/fund_em.py,sha256=MrK_HVcRUvHQCrY-blapivPd0La5cVCBNJIG0gW71fs,40844
91
91
  akshare/fund/fund_etf_em.py,sha256=8HrEQbM3wSMHuTAle9g6iT4ULaPjsqCcTBVU7PrpqJA,17377
92
- akshare/fund/fund_etf_sina.py,sha256=bhfxivhwClZxwwslqusaZwrNRdEkfCApQOli0QMrM3A,4899
92
+ akshare/fund/fund_etf_sina.py,sha256=3eYnpug02oSZfR6fuWsT5mZRMRNm39VYCLHKnWdvonM,5218
93
93
  akshare/fund/fund_etf_ths.py,sha256=vb_jy0h2-Kz2dNWUrwBYxPB0MAotv0KZgnFhE98ohSM,3432
94
94
  akshare/fund/fund_fhsp_em.py,sha256=-zSwwveiCB4HHRxwAuaLDTQHmNe3FxwxxeoPeiG8JbM,5546
95
95
  akshare/fund/fund_init_em.py,sha256=4kOhsOkEs50B-RAxz-fTyWxNC1J4jNBDoKGJlFUpIjQ,2210
@@ -194,7 +194,7 @@ akshare/nlp/nlp_interface.py,sha256=PyZjT3PkuTbloop-JwLwZ2kNi22zdO-r_pRUWQ5SmgM,
194
194
  akshare/option/__init__.py,sha256=RMTf1bT5EOE3ttWpn3hGu1LtUmsVxDoa0W7W0gXHOy8,81
195
195
  akshare/option/cons.py,sha256=zTRZ62RFwOcAKfmso-7nZJtT3a8Dt1nQbNnEjSqgjpI,4811
196
196
  akshare/option/option_comm_qihuo.py,sha256=kjbdp-94KJJJi1ex5U03abtlgviqwP0Aahb6FwddPkk,3128
197
- akshare/option/option_commodity.py,sha256=M1R5dGQcW1iZzQ6d3DztZ2yq7V0jzrkCuoW1GKJTwjU,22274
197
+ akshare/option/option_commodity.py,sha256=DMn-PM82xUr_HcHQqF1VLVmJaD35RiXDH4RwpFVMX7k,25338
198
198
  akshare/option/option_commodity_sina.py,sha256=r6qK_K7w3A6Uqp5ZtBb4pW7vH04oMyeCEZLLGqi0jpA,7776
199
199
  akshare/option/option_czce.py,sha256=L4i7TVKcOns5ZKoqq-mrSykdx3SGwu6OL4eI77-A_lc,1812
200
200
  akshare/option/option_daily_stats_sse_szse.py,sha256=Ip_vE81qbEGt4ocbtWfUT7XGu0HWU0zKkzauZeq9RJA,4962
@@ -279,13 +279,13 @@ akshare/stock/stock_us_pink.py,sha256=jgkEjPm_qa4zSN1MH0unHJopSkcF-8Rqlp5Kus2KaQ
279
279
  akshare/stock/stock_us_sina.py,sha256=3bD41Y5GqDTv52bx5jbjrt0psaHZS10UL_e7E2B6wW8,8146
280
280
  akshare/stock/stock_weibo_nlp.py,sha256=eM7ofsNSrKiYeS0g38Qj9CxT6dkJZrn_pmziIiTqp4U,3286
281
281
  akshare/stock/stock_xq.py,sha256=QB6kZeoAY-O64-Lfu51a0tuROoTt3hIQO5K-yNhoXyM,4619
282
- akshare/stock/stock_zh_a_sina.py,sha256=gryRmUwqF9PyNl-fPhD72y5nfNmLVEnvzjZDhAe-cpg,18862
282
+ akshare/stock/stock_zh_a_sina.py,sha256=ZobGnFMIR67ENk05ocqIkeiItLlgK67dW8ZjLdDss3s,18862
283
283
  akshare/stock/stock_zh_a_special.py,sha256=RRXkeZtRWm_maIPWgxvhBdX6eNybECjhSuEesZHRFJI,10294
284
284
  akshare/stock/stock_zh_a_tick_tx.py,sha256=TJUAWLKAeoLEaVVJQlj0t-1smZGoAO0X0rPsUPVhZZ4,2131
285
285
  akshare/stock/stock_zh_ah_tx.py,sha256=nq-dFlgHcgFS8in4HsbGyACTjfSTcixLaJC0yrQccbQ,9204
286
- akshare/stock/stock_zh_b_sina.py,sha256=5OkImYThNjEFxLpFWTcE-enn6_wV7MjfLWOfPWTNsYU,16058
286
+ akshare/stock/stock_zh_b_sina.py,sha256=-sd0wG4zETsgrJSXivww4YieXfnVMNSfh3phsX_XBBc,16058
287
287
  akshare/stock/stock_zh_kcb_report.py,sha256=7zRovNGqXrPIYtUj9C3ivlYzfiudkaeBNiYPYlzDWkQ,2914
288
- akshare/stock/stock_zh_kcb_sina.py,sha256=rpEOkqaOX5ebjs8B3teA1npBL8DpCQQXH8GRFu1ZY6o,9804
288
+ akshare/stock/stock_zh_kcb_sina.py,sha256=ZKFoyq9Y-6LhBoYERc4Oqv5q3Llpne7ngDIZcCs8Yq0,9862
289
289
  akshare/stock_feature/__init__.py,sha256=c2VDBGyg8nWZYLvtnnSqUoQ92Cu6dJ7UFOeJsB2Gff8,82
290
290
  akshare/stock_feature/cons.py,sha256=UgwXlae3UpVRuhTt33nP-jmhNyug2mZLzuMgLja6pbA,465
291
291
  akshare/stock_feature/stock_a_below_net_asset_statistics.py,sha256=XrhZI-wLuXXufI5Nh1l9gUx9x7f0iDtdtKa14wexo54,2653
@@ -383,8 +383,8 @@ akshare/utils/token_process.py,sha256=K4rGXjh_tgugbRcyOK2h2x0jP3PT65IIK7nxhUKhOe
383
383
  akshare/utils/tqdm.py,sha256=MuPNwcswkOGjwWQOMWXi9ZvQ_RmW4obCWRj2i7HM7FE,847
384
384
  tests/__init__.py,sha256=gNzhlO0UPjFq6Ieb38kaVIODXv4cTDByrdohAZnDYt4,82
385
385
  tests/test_func.py,sha256=j1MGYbZI2if2j_LY1S4FLsf4qfq4NwVqD5wmRlv5Log,832
386
- akshare-1.15.28.dist-info/LICENSE,sha256=mmSZCPgfHiVw34LXuFArd-SUgQtBJ_QsIlh-kWlDHfs,1073
387
- akshare-1.15.28.dist-info/METADATA,sha256=rxPymXOcNH6roYEJGJCKgBlt59BTmPoEkqhOzgA5zP0,14232
388
- akshare-1.15.28.dist-info/WHEEL,sha256=PZUExdf71Ui_so67QXpySuHtCi3-J3wvF4ORK6k_S8U,91
389
- akshare-1.15.28.dist-info/top_level.txt,sha256=jsf9ZzZPmHaISTVumQPsAw7vv7Yv-PdEVW70SMEelQQ,14
390
- akshare-1.15.28.dist-info/RECORD,,
386
+ akshare-1.15.30.dist-info/LICENSE,sha256=mmSZCPgfHiVw34LXuFArd-SUgQtBJ_QsIlh-kWlDHfs,1073
387
+ akshare-1.15.30.dist-info/METADATA,sha256=1Q8lpwTZGxFfygUDAfT-Q7iLr4O6n92n-6nQOdVXFOA,13423
388
+ akshare-1.15.30.dist-info/WHEEL,sha256=PZUExdf71Ui_so67QXpySuHtCi3-J3wvF4ORK6k_S8U,91
389
+ akshare-1.15.30.dist-info/top_level.txt,sha256=jsf9ZzZPmHaISTVumQPsAw7vv7Yv-PdEVW70SMEelQQ,14
390
+ akshare-1.15.30.dist-info/RECORD,,