akshare 1.16.72__py3-none-any.whl → 1.16.74__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.
- akshare/__init__.py +3 -1
- akshare/stock/stock_board_industry_em.py +14 -12
- akshare/stock/stock_xq.py +7 -4
- {akshare-1.16.72.dist-info → akshare-1.16.74.dist-info}/METADATA +2 -2
- {akshare-1.16.72.dist-info → akshare-1.16.74.dist-info}/RECORD +8 -8
- {akshare-1.16.72.dist-info → akshare-1.16.74.dist-info}/WHEEL +0 -0
- {akshare-1.16.72.dist-info → akshare-1.16.74.dist-info}/licenses/LICENSE +0 -0
- {akshare-1.16.72.dist-info → akshare-1.16.74.dist-info}/top_level.txt +0 -0
akshare/__init__.py
CHANGED
@@ -3081,9 +3081,11 @@ amac_manager_cancelled_info # 中国证券投资基金业协会-信息公示-诚
|
|
3081
3081
|
1.16.70 fix: fix stock_zh_ah_spot_em interface
|
3082
3082
|
1.16.71 add: add stock_zh_a_gbjg_em interface
|
3083
3083
|
1.16.72 add: add bond_sh_buy_back_em interface
|
3084
|
+
1.16.73 fix: fix stock_board_industry_hist_em interface
|
3085
|
+
1.16.74 fix: fix stock_individual_spot_xq interface
|
3084
3086
|
"""
|
3085
3087
|
|
3086
|
-
__version__ = "1.16.
|
3088
|
+
__version__ = "1.16.74"
|
3087
3089
|
__author__ = "AKFamily"
|
3088
3090
|
|
3089
3091
|
import sys
|
@@ -281,19 +281,20 @@ def stock_board_industry_hist_em(
|
|
281
281
|
:return: 历史行情
|
282
282
|
:rtype: pandas.DataFrame
|
283
283
|
"""
|
284
|
+
if re.match(pattern=r"^BK\d+", string=symbol):
|
285
|
+
em_code = symbol
|
286
|
+
else:
|
287
|
+
industry_listing = __stock_board_industry_name_em()
|
288
|
+
em_code = industry_listing.query("板块名称 == @symbol")["板块代码"].values[0]
|
284
289
|
period_map = {
|
285
290
|
"日k": "101",
|
286
291
|
"周k": "102",
|
287
292
|
"月k": "103",
|
288
293
|
}
|
289
|
-
stock_board_concept_em_map = __stock_board_industry_name_em()
|
290
|
-
stock_board_code = stock_board_concept_em_map[
|
291
|
-
stock_board_concept_em_map["板块名称"] == symbol
|
292
|
-
]["板块代码"].values[0]
|
293
294
|
adjust_map = {"": "0", "qfq": "1", "hfq": "2"}
|
294
295
|
url = "http://7.push2his.eastmoney.com/api/qt/stock/kline/get"
|
295
296
|
params = {
|
296
|
-
"secid": f"90.{
|
297
|
+
"secid": f"90.{em_code}",
|
297
298
|
"fields1": "f1,f2,f3,f4,f5,f6",
|
298
299
|
"fields2": "f51,f52,f53,f54,f55,f56,f57,f58,f59,f60,f61",
|
299
300
|
"klt": period_map[period],
|
@@ -360,10 +361,11 @@ def stock_board_industry_hist_min_em(
|
|
360
361
|
:return: 分时历史行情
|
361
362
|
:rtype: pandas.DataFrame
|
362
363
|
"""
|
363
|
-
|
364
|
-
|
365
|
-
|
366
|
-
|
364
|
+
if re.match(pattern=r"^BK\d+", string=symbol):
|
365
|
+
em_code = symbol
|
366
|
+
else:
|
367
|
+
industry_listing = __stock_board_industry_name_em()
|
368
|
+
em_code = industry_listing.query("板块名称 == @symbol")["板块代码"].values[0]
|
367
369
|
if period == "1":
|
368
370
|
url = "https://push2his.eastmoney.com/api/qt/stock/trends2/get"
|
369
371
|
params = {
|
@@ -371,7 +373,7 @@ def stock_board_industry_hist_min_em(
|
|
371
373
|
"fields2": "f51,f52,f53,f54,f55,f56,f57,f58",
|
372
374
|
"iscr": "0",
|
373
375
|
"ndays": "1",
|
374
|
-
"secid": f"90.{
|
376
|
+
"secid": f"90.{em_code}",
|
375
377
|
}
|
376
378
|
r = requests.get(url, params=params)
|
377
379
|
data_json = r.json()
|
@@ -398,9 +400,9 @@ def stock_board_industry_hist_min_em(
|
|
398
400
|
temp_df["最新价"] = pd.to_numeric(temp_df["最新价"], errors="coerce")
|
399
401
|
return temp_df
|
400
402
|
else:
|
401
|
-
url = "
|
403
|
+
url = "https://7.push2his.eastmoney.com/api/qt/stock/kline/get"
|
402
404
|
params = {
|
403
|
-
"secid": f"90.{
|
405
|
+
"secid": f"90.{em_code}",
|
404
406
|
"fields1": "f1,f2,f3,f4,f5,f6",
|
405
407
|
"fields2": "f51,f52,f53,f54,f55,f56,f57,f58,f59,f60,f61",
|
406
408
|
"klt": period,
|
akshare/stock/stock_xq.py
CHANGED
@@ -105,21 +105,24 @@ def stock_individual_spot_xq(
|
|
105
105
|
*map(
|
106
106
|
lambda x: column_name_map[x] if x in column_name_map.keys() else x,
|
107
107
|
temp_df.columns,
|
108
|
-
) # 由于传入的symbol可能是个股,可能是指数,也可能是基金,所以这里取列的最大公约数,没有数据的列内容为None
|
108
|
+
) # 由于传入的 symbol 可能是个股,可能是指数,也可能是基金,所以这里取列的最大公约数,没有数据的列内容为 None
|
109
109
|
]
|
110
110
|
temp_df = temp_df[
|
111
111
|
list(
|
112
112
|
filter(
|
113
113
|
lambda x: re.search(pattern="[\u4e00-\u9fa5]", string=x),
|
114
114
|
temp_df.columns,
|
115
|
-
) # 过滤temp_df,留下包含汉字的列
|
115
|
+
) # 过滤 temp_df,留下包含汉字的列
|
116
116
|
)
|
117
117
|
]
|
118
118
|
temp_df = temp_df.T.reset_index()
|
119
119
|
temp_df.columns = ["item", "value"]
|
120
120
|
temp_df.loc[temp_df["item"] == "时间", "value"] = temp_df.loc[
|
121
121
|
temp_df["item"] == "时间", "value"
|
122
|
-
].apply(lambda x: _convert_timestamp(int(x)))
|
122
|
+
].apply(lambda x: _convert_timestamp(int(x)) if x and not pd.isna(x) else None)
|
123
|
+
temp_df.loc[temp_df["item"] == "发行日期", "value"] = temp_df.loc[
|
124
|
+
temp_df["item"] == "发行日期", "value"
|
125
|
+
].apply(lambda x: _convert_timestamp(int(x)) if x and not pd.isna(x) else None)
|
123
126
|
return temp_df
|
124
127
|
|
125
128
|
|
@@ -127,7 +130,7 @@ if __name__ == "__main__":
|
|
127
130
|
stock_individual_spot_xq_df = stock_individual_spot_xq(symbol="BJ430139")
|
128
131
|
print(stock_individual_spot_xq_df)
|
129
132
|
|
130
|
-
stock_individual_spot_xq_df = stock_individual_spot_xq(symbol="
|
133
|
+
stock_individual_spot_xq_df = stock_individual_spot_xq(symbol="SH600000")
|
131
134
|
print(stock_individual_spot_xq_df)
|
132
135
|
|
133
136
|
stock_individual_spot_xq_df = stock_individual_spot_xq(symbol="SPY")
|
@@ -1,6 +1,6 @@
|
|
1
1
|
Metadata-Version: 2.4
|
2
2
|
Name: akshare
|
3
|
-
Version: 1.16.
|
3
|
+
Version: 1.16.74
|
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
|
@@ -77,7 +77,7 @@ Dynamic: summary
|
|
77
77
|
|
78
78
|
## Overview
|
79
79
|
|
80
|
-
[AKShare](https://github.com/akfamily/akshare) requires Python(64 bit) 3.
|
80
|
+
[AKShare](https://github.com/akfamily/akshare) requires Python(64 bit) 3.9 or higher and
|
81
81
|
aims to simplify the process of fetching financial data.
|
82
82
|
|
83
83
|
**Write less, get more!**
|
@@ -1,4 +1,4 @@
|
|
1
|
-
akshare/__init__.py,sha256=
|
1
|
+
akshare/__init__.py,sha256=GETa9Iz3oavYSlOF3VyySSiywwYFniUgskIs7_cdLlc,193102
|
2
2
|
akshare/datasets.py,sha256=rKuRNZrqi6IMsZ9nyvO3Rx02js0tH3zMLjz8HQNAoPQ,963
|
3
3
|
akshare/exceptions.py,sha256=WEJjIhSmJ_xXNW6grwV4nufE_cfmmyuhmueVGiN1VAg,878
|
4
4
|
akshare/request.py,sha256=HtFFf9MhfEibR-ETWe-1Tts6ELU4VKSqA-ghaXjegQM,4252
|
@@ -238,7 +238,7 @@ akshare/stock/cons.py,sha256=pAMixwmjYARzCVWIxN7RjhjnJMpvLR2OD6mZ-zI7jlM,42990
|
|
238
238
|
akshare/stock/stock_allotment_cninfo.py,sha256=OVjVdWp2XVRNbJvVgtgVVoBmPBJgBB4RyIIgA_9QHM8,6066
|
239
239
|
akshare/stock/stock_ask_bid_em.py,sha256=bo7VNkp1PmK4Z-GPZuVn_I-IAdzeW8cs3W_75KodxCg,3368
|
240
240
|
akshare/stock/stock_board_concept_em.py,sha256=7dIwfF73XrRe1XOj9Q4pvb-X_KXR7CxPQqPziD5nqEU,17725
|
241
|
-
akshare/stock/stock_board_industry_em.py,sha256=
|
241
|
+
akshare/stock/stock_board_industry_em.py,sha256=9QfIxNb5EN5xOYEVXcKr1sQVrpt9muSnc7JhTP1Chco,18396
|
242
242
|
akshare/stock/stock_cg_equity_mortgage.py,sha256=Pui5aWKKPwGuKjF_GNpejDzsMGNPrxiaJviLz3x2e9I,3426
|
243
243
|
akshare/stock/stock_cg_guarantee.py,sha256=ts7qcQhhyN1PHB7Q4XlMn38HhfVvubOvky9RZfmUP94,3844
|
244
244
|
akshare/stock/stock_cg_lawsuit.py,sha256=6Y92pPw0JgyrInteqHuU07G1jwmdX2wjaDtrJN8y6Hg,4129
|
@@ -281,7 +281,7 @@ akshare/stock/stock_us_js.py,sha256=VleGUb7K-NjmW3jMPRc2jwHXM0CMq4IzVM9kUpwURDQ,
|
|
281
281
|
akshare/stock/stock_us_pink.py,sha256=b48o56E6Ur1Z_50gPvaZo8ZyegePwVJs8z8KMSqHg0U,3035
|
282
282
|
akshare/stock/stock_us_sina.py,sha256=D4fhJgpmvnlVoeSV2wQQ7H6lig8h6vaJp71o88dZhDg,8200
|
283
283
|
akshare/stock/stock_weibo_nlp.py,sha256=-k7gzAusb8_D4l0rc6bOzQ3x4b2dFBXJ2hgOntwEGc8,3266
|
284
|
-
akshare/stock/stock_xq.py,sha256=
|
284
|
+
akshare/stock/stock_xq.py,sha256=KgUxqDVtQJNrRPgBfDDTJdmeSrPKZXRDz_CcJY3iwFE,4887
|
285
285
|
akshare/stock/stock_zh_a_sina.py,sha256=-LbBNkqs2i_AAJ77PylfgXRK26pjResCHfM35_n-7G8,18907
|
286
286
|
akshare/stock/stock_zh_a_special.py,sha256=E2BU73FLyOC-3LcXiLEVQosZ6Vvu6sIgo-Ee66kzzTM,10079
|
287
287
|
akshare/stock/stock_zh_a_tick_tx.py,sha256=-HOilipACz-FEZWlkSXy9lH8A-BpNzuLDcXr_Rv6dYQ,2230
|
@@ -394,10 +394,10 @@ akshare/utils/func.py,sha256=4cwmXFztU86yJNONJ40KJLvsIEQHBbct4iMm3zT2v30,2315
|
|
394
394
|
akshare/utils/multi_decrypt.py,sha256=aWoL2iEPeuXHJg8-n7OtMKixLnIhfzepACgxfrfmQB4,1657
|
395
395
|
akshare/utils/token_process.py,sha256=nGtgnZGRprXJkhLXH8mcUH4TgIFwzsTOb0EaEPa0Euo,667
|
396
396
|
akshare/utils/tqdm.py,sha256=MuPNwcswkOGjwWQOMWXi9ZvQ_RmW4obCWRj2i7HM7FE,847
|
397
|
-
akshare-1.16.
|
397
|
+
akshare-1.16.74.dist-info/licenses/LICENSE,sha256=mmSZCPgfHiVw34LXuFArd-SUgQtBJ_QsIlh-kWlDHfs,1073
|
398
398
|
tests/__init__.py,sha256=gNzhlO0UPjFq6Ieb38kaVIODXv4cTDByrdohAZnDYt4,82
|
399
399
|
tests/test_func.py,sha256=j1MGYbZI2if2j_LY1S4FLsf4qfq4NwVqD5wmRlv5Log,832
|
400
|
-
akshare-1.16.
|
401
|
-
akshare-1.16.
|
402
|
-
akshare-1.16.
|
403
|
-
akshare-1.16.
|
400
|
+
akshare-1.16.74.dist-info/METADATA,sha256=xEl6hfjjSaQQ_VxHt6De4SqyPBAY3i621unA4EqGu_U,12591
|
401
|
+
akshare-1.16.74.dist-info/WHEEL,sha256=CmyFI0kx5cdEMTLiONQRbGQwjIoR1aIYB7eCAQ4KPJ0,91
|
402
|
+
akshare-1.16.74.dist-info/top_level.txt,sha256=jsf9ZzZPmHaISTVumQPsAw7vv7Yv-PdEVW70SMEelQQ,14
|
403
|
+
akshare-1.16.74.dist-info/RECORD,,
|
File without changes
|
File without changes
|
File without changes
|