akshare 1.16.80__py3-none-any.whl → 1.16.82__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/index/index_global_em.py +2 -2
- akshare/option/option_commodity.py +36 -46
- {akshare-1.16.80.dist-info → akshare-1.16.82.dist-info}/METADATA +1 -1
- {akshare-1.16.80.dist-info → akshare-1.16.82.dist-info}/RECORD +8 -8
- {akshare-1.16.80.dist-info → akshare-1.16.82.dist-info}/WHEEL +1 -1
- {akshare-1.16.80.dist-info → akshare-1.16.82.dist-info}/licenses/LICENSE +0 -0
- {akshare-1.16.80.dist-info → akshare-1.16.82.dist-info}/top_level.txt +0 -0
akshare/__init__.py
CHANGED
@@ -3088,9 +3088,11 @@ amac_manager_cancelled_info # 中国证券投资基金业协会-信息公示-诚
|
|
3088
3088
|
1.16.78 fix: fix stock_zh_a_spot_em interface
|
3089
3089
|
1.16.79 fix: fix stock_individual_basic_info_xq interface
|
3090
3090
|
1.16.80 fix: fix stock_zh_a_disclosure_report_cninfo interface
|
3091
|
+
1.16.81 fix: fix option_shfe_daily interface
|
3092
|
+
1.16.82 fix: fix index_global_spot_em interface
|
3091
3093
|
"""
|
3092
3094
|
|
3093
|
-
__version__ = "1.16.
|
3095
|
+
__version__ = "1.16.82"
|
3094
3096
|
__author__ = "AKFamily"
|
3095
3097
|
|
3096
3098
|
import sys
|
akshare/index/index_global_em.py
CHANGED
@@ -373,11 +373,11 @@ def option_czce_daily(
|
|
373
373
|
|
374
374
|
|
375
375
|
def option_shfe_daily(
|
376
|
-
symbol: str = "铝期权", trade_date: str = "
|
376
|
+
symbol: str = "铝期权", trade_date: str = "20250418"
|
377
377
|
) -> Optional[Tuple[pd.DataFrame, pd.DataFrame]]:
|
378
378
|
"""
|
379
379
|
上海期货交易所-期权-日频行情数据
|
380
|
-
https://
|
380
|
+
https://www.shfe.com.cn/reports/tradedata/dailyandweeklydata/
|
381
381
|
:param trade_date: 交易日
|
382
382
|
:type trade_date: str
|
383
383
|
:param symbol: choice of {"铜期权", "天胶期权", "黄金期权", "铝期权", "锌期权"}
|
@@ -390,8 +390,8 @@ def option_shfe_daily(
|
|
390
390
|
if day.strftime("%Y%m%d") not in calendar:
|
391
391
|
warnings.warn("%s非交易日" % day.strftime("%Y%m%d"))
|
392
392
|
return pd.DataFrame(), pd.DataFrame()
|
393
|
-
if day > datetime.date(2010, 8, 24):
|
394
|
-
url =
|
393
|
+
if day > datetime.date(year=2010, month=8, day=24):
|
394
|
+
url = f"""https://www.shfe.com.cn/data/tradedata/option/dailydata/kx{day.strftime("%Y%m%d")}.dat"""
|
395
395
|
try:
|
396
396
|
r = requests.get(url, headers=SHFE_HEADERS)
|
397
397
|
json_data = r.json()
|
@@ -408,31 +408,25 @@ def option_shfe_daily(
|
|
408
408
|
volatility_df = volatility_df[
|
409
409
|
volatility_df["PRODUCTNAME"].str.strip() == symbol
|
410
410
|
]
|
411
|
-
contract_df.
|
412
|
-
|
413
|
-
|
414
|
-
|
415
|
-
|
416
|
-
|
417
|
-
|
418
|
-
|
419
|
-
|
420
|
-
|
421
|
-
|
422
|
-
|
423
|
-
|
424
|
-
|
425
|
-
|
426
|
-
|
427
|
-
|
428
|
-
|
429
|
-
|
430
|
-
"德尔塔",
|
431
|
-
"_",
|
432
|
-
"_",
|
433
|
-
"_",
|
434
|
-
"_",
|
435
|
-
]
|
411
|
+
contract_df.rename(
|
412
|
+
columns={
|
413
|
+
"INSTRUMENTID": "合约代码",
|
414
|
+
"OPENPRICE": "开盘价",
|
415
|
+
"HIGHESTPRICE": "最高价",
|
416
|
+
"LOWESTPRICE": "最低价",
|
417
|
+
"CLOSEPRICE": "收盘价",
|
418
|
+
"PRESETTLEMENTPRICE": "前结算价",
|
419
|
+
"SETTLEMENTPRICE": "结算价",
|
420
|
+
"ZD1_CHG": "涨跌1",
|
421
|
+
"ZD2_CHG": "涨跌2",
|
422
|
+
"VOLUME": "成交量",
|
423
|
+
"OPENINTEREST": "持仓量",
|
424
|
+
"OPENINTERESTCHG": "持仓量变化",
|
425
|
+
"TURNOVER": "成交额",
|
426
|
+
"DELTA": "德尔塔",
|
427
|
+
"EXECVOLUME": "行权量"
|
428
|
+
}, inplace=True
|
429
|
+
)
|
436
430
|
contract_df = contract_df[
|
437
431
|
[
|
438
432
|
"合约代码",
|
@@ -452,21 +446,15 @@ def option_shfe_daily(
|
|
452
446
|
"行权量",
|
453
447
|
]
|
454
448
|
]
|
455
|
-
|
456
|
-
|
457
|
-
"
|
458
|
-
"
|
459
|
-
"
|
460
|
-
"
|
461
|
-
"
|
462
|
-
"
|
463
|
-
|
464
|
-
"行权量",
|
465
|
-
"成交额",
|
466
|
-
"隐含波动率",
|
467
|
-
"_",
|
468
|
-
]
|
469
|
-
|
449
|
+
volatility_df.rename(columns={
|
450
|
+
"INSTRUMENTID": "合约系列",
|
451
|
+
"VOLUME": "成交量",
|
452
|
+
"OPENINTEREST": "持仓量",
|
453
|
+
"OPENINTERESTCHG": "持仓量变化",
|
454
|
+
"TURNOVER": "成交额",
|
455
|
+
"EXECVOLUME": "行权量",
|
456
|
+
"SIGMA": "隐含波动率"
|
457
|
+
}, inplace=True)
|
470
458
|
volatility_df = volatility_df[
|
471
459
|
[
|
472
460
|
"合约系列",
|
@@ -482,7 +470,9 @@ def option_shfe_daily(
|
|
482
470
|
volatility_df.reset_index(inplace=True, drop=True)
|
483
471
|
return contract_df, volatility_df
|
484
472
|
except: # noqa: E722
|
485
|
-
return
|
473
|
+
return pd.DataFrame(), pd.DataFrame()
|
474
|
+
else:
|
475
|
+
return pd.DataFrame(), pd.DataFrame()
|
486
476
|
|
487
477
|
|
488
478
|
def option_gfex_daily(symbol: str = "工业硅", trade_date: str = "20230724"):
|
@@ -657,7 +647,7 @@ if __name__ == "__main__":
|
|
657
647
|
print(option_dce_daily_two)
|
658
648
|
|
659
649
|
option_shfe_daily_one, option_shfe_daily_two = option_shfe_daily(
|
660
|
-
symbol="天胶期权", trade_date="
|
650
|
+
symbol="天胶期权", trade_date="20250418"
|
661
651
|
)
|
662
652
|
print(option_shfe_daily_one)
|
663
653
|
print(option_shfe_daily_two)
|
@@ -1,4 +1,4 @@
|
|
1
|
-
akshare/__init__.py,sha256=
|
1
|
+
akshare/__init__.py,sha256=bdPm47zcxa1kgLQA3Y69ji4lV4wLR3qsSYlstRAMq8A,193600
|
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
|
@@ -162,7 +162,7 @@ akshare/index/index_cons.py,sha256=exCYkXauu3u_liWS5Y0W89F19eSwt6gJmlBciM86txQ,7
|
|
162
162
|
akshare/index/index_cx.py,sha256=aAmsIKkswKFNOhAsW0QOhp-q6q1aFOSBtqcDaZhIh6A,16775
|
163
163
|
akshare/index/index_drewry.py,sha256=BM7V6P8K4QUFQArsdaWRu5qJUZaCoyNz97_b8dmLeCw,2937
|
164
164
|
akshare/index/index_eri.py,sha256=N1yP2_n04WCIJ_vdPb7w5xdSNMIdomqgZ43Wg69hzts,2112
|
165
|
-
akshare/index/index_global_em.py,sha256=
|
165
|
+
akshare/index/index_global_em.py,sha256=UNYBCpO-sD16RKgSmaEDE4IXVLMgKL9SKiv_mSxiQ_0,5912
|
166
166
|
akshare/index/index_global_sina.py,sha256=fFJeW-u6Jo1iiuRMVaGJaUZBUA6wUT0L0u6KT3vkJ4I,2494
|
167
167
|
akshare/index/index_hog.py,sha256=kb867BVagt70_ycZMn22ks5Z9jlVbMiuTsvq5ygjeig,1657
|
168
168
|
akshare/index/index_kq_fz.py,sha256=7RoRYptw5pwKzkfE94qLlhUkK_fXQzwm7G6o6vPk7jM,3376
|
@@ -196,7 +196,7 @@ akshare/nlp/nlp_interface.py,sha256=PyZjT3PkuTbloop-JwLwZ2kNi22zdO-r_pRUWQ5SmgM,
|
|
196
196
|
akshare/option/__init__.py,sha256=RMTf1bT5EOE3ttWpn3hGu1LtUmsVxDoa0W7W0gXHOy8,81
|
197
197
|
akshare/option/cons.py,sha256=zTRZ62RFwOcAKfmso-7nZJtT3a8Dt1nQbNnEjSqgjpI,4811
|
198
198
|
akshare/option/option_comm_qihuo.py,sha256=kjbdp-94KJJJi1ex5U03abtlgviqwP0Aahb6FwddPkk,3128
|
199
|
-
akshare/option/option_commodity.py,sha256=
|
199
|
+
akshare/option/option_commodity.py,sha256=7KCJ9QScHgdVzX76GF5io32RPTeVmjg8-XwisKT9LnM,27238
|
200
200
|
akshare/option/option_commodity_sina.py,sha256=NN2qywfGZphKlHiEuwU7_3aNXTEKaXH0UrU8xLIQ5XQ,7731
|
201
201
|
akshare/option/option_czce.py,sha256=TxmLZn6hxjZa8TyEpwhZazL2m5XbympRHaRjJw1q7lk,2509
|
202
202
|
akshare/option/option_daily_stats_sse_szse.py,sha256=Igqi2IPX_1UT2qgIsPDJtSZ660TjvHy9twn_q7Vrodw,4932
|
@@ -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.82.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.82.dist-info/METADATA,sha256=0Qn7NiqPLLsqCnRX1l3icy5rEgeuHOJ62vk6VAu3qJk,11902
|
401
|
+
akshare-1.16.82.dist-info/WHEEL,sha256=SmOxYU7pzNKBqASvQJ7DjX3XGUF92lrGhMb3R6_iiqI,91
|
402
|
+
akshare-1.16.82.dist-info/top_level.txt,sha256=jsf9ZzZPmHaISTVumQPsAw7vv7Yv-PdEVW70SMEelQQ,14
|
403
|
+
akshare-1.16.82.dist-info/RECORD,,
|
File without changes
|
File without changes
|