akshare 1.17.35__py3-none-any.whl → 1.17.37__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
@@ -3142,9 +3142,11 @@ amac_manager_cancelled_info # 中国证券投资基金业协会-信息公示-诚
3142
3142
  1.17.33 fix: fix stock_comment_em interface
3143
3143
  1.17.34 fix: fix option_czce_daily interface
3144
3144
  1.17.35 fix: fix option_dce_daily interface
3145
+ 1.17.36 fix: fix futures_hist_em interface
3146
+ 1.17.37 fix: fix stock_zh_index_daily_em interface
3145
3147
  """
3146
3148
 
3147
- __version__ = "1.17.35"
3149
+ __version__ = "1.17.37"
3148
3150
  __author__ = "AKFamily"
3149
3151
 
3150
3152
  import sys
@@ -136,6 +136,7 @@ def futures_hist_em(
136
136
  r = requests.get(url, timeout=15, params=params)
137
137
  data_json = r.json()
138
138
  temp_df = pd.DataFrame([item.split(",") for item in data_json["data"]["klines"]])
139
+ if temp_df.empty: return temp_df
139
140
  temp_df.columns = [
140
141
  "时间",
141
142
  "开盘",
@@ -1,7 +1,7 @@
1
1
  #!/usr/bin/env python
2
2
  # -*- coding:utf-8 -*-
3
3
  """
4
- Date: 2024/2/28 11:00
4
+ Date: 2025/8/18 11:00
5
5
  Desc: 大连商品交易所-业务/服务-业务参数-交易参数-合约信息查询
6
6
  http://www.dce.com.cn/dalianshangpin/ywfw/ywcs/jycs/hyxxcx/index.html
7
7
  """
@@ -19,7 +19,7 @@ def futures_contract_info_dce() -> pd.DataFrame:
19
19
  :return: 交易参数汇总查询
20
20
  :rtype: pandas.DataFrame
21
21
  """
22
- url = "http://www.dce.com.cn/publicweb/businessguidelines/queryContractInfo.html"
22
+ url = "http://portal.dce.com.cn/publicweb/businessguidelines/queryContractInfo.html"
23
23
  params = {
24
24
  "contractInformation.variety": "all",
25
25
  "contractInformation.trade_type": "0",
@@ -417,10 +417,12 @@ def stock_zh_index_daily_em(
417
417
  :return: 指数数据
418
418
  :rtype: pandas.DataFrame
419
419
  """
420
- market_map = {"sz": "0", "sh": "1", "csi": "2"}
420
+ market_map = {"sz": "0", "sh": "1", "csi": "2", "bj": "0"}
421
421
  url = "https://push2his.eastmoney.com/api/qt/stock/kline/get"
422
422
  if symbol.find("sz") != -1:
423
423
  secid = "{}.{}".format(market_map["sz"], symbol.replace("sz", ""))
424
+ elif symbol.find("bj") != -1:
425
+ secid = "{}.{}".format(market_map["bj"], symbol.replace("bj", ""))
424
426
  elif symbol.find("sh") != -1:
425
427
  secid = "{}.{}".format(market_map["sh"], symbol.replace("sh", ""))
426
428
  elif symbol.find("csi") != -1:
@@ -428,7 +430,6 @@ def stock_zh_index_daily_em(
428
430
  else:
429
431
  return pd.DataFrame()
430
432
  params = {
431
- "cb": "jQuery1124033485574041163946_1596700547000",
432
433
  "secid": secid,
433
434
  "fields1": "f1,f2,f3,f4,f5",
434
435
  "fields2": "f51,f52,f53,f54,f55,f56,f57,f58",
@@ -438,10 +439,8 @@ def stock_zh_index_daily_em(
438
439
  "end": end_date,
439
440
  }
440
441
  r = requests.get(url, params=params)
441
- data_text = r.text
442
- data_json = demjson.decode(data_text[data_text.find("{") : -2])
442
+ data_json = r.json()
443
443
  temp_df = pd.DataFrame([item.split(",") for item in data_json["data"]["klines"]])
444
- # check temp_df data availability before further transformations which may raise errors
445
444
  if temp_df.empty:
446
445
  return pd.DataFrame()
447
446
  temp_df.columns = ["date", "open", "close", "high", "low", "volume", "amount", "_"]
@@ -480,5 +479,5 @@ if __name__ == "__main__":
480
479
  stock_zh_index_daily_tx_df = stock_zh_index_daily_tx(symbol="sh000919")
481
480
  print(stock_zh_index_daily_tx_df)
482
481
 
483
- stock_zh_index_daily_em_df = stock_zh_index_daily_em(symbol="sz399812")
482
+ stock_zh_index_daily_em_df = stock_zh_index_daily_em(symbol="bj899050")
484
483
  print(stock_zh_index_daily_em_df)
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: akshare
3
- Version: 1.17.35
3
+ Version: 1.17.37
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
@@ -227,9 +227,9 @@ Please use this **bibtex** if you want to cite this repository in your publicati
227
227
 
228
228
  ```markdown
229
229
  @misc{akshare,
230
- author = {Albert King},
230
+ author = {Albert King and Yaojie Zhang},
231
231
  title = {AKShare},
232
- year = {2019},
232
+ year = {2022},
233
233
  publisher = {GitHub},
234
234
  journal = {GitHub repository},
235
235
  howpublished = {\url{https://github.com/akfamily/akshare}},
@@ -1,4 +1,4 @@
1
- akshare/__init__.py,sha256=zZR3guHKQN0xwzj2kEaa5-nxCQOn9c8IU6jHSF1Z7qc,196245
1
+ akshare/__init__.py,sha256=yFChUWmBLl9LLugayq1FUCmSYgefm_AvZLeZdKJOs2o,196339
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
@@ -117,7 +117,7 @@ akshare/futures/futures_contract_detail.py,sha256=Glm1x72WBwF4G-f_ZYzHsbNhlQ6Ti1
117
117
  akshare/futures/futures_daily_bar.py,sha256=QWeHNxFMtwY2IGEK6ZlPJ9wax4Jl8pcGinqtkIVj0KQ,25366
118
118
  akshare/futures/futures_foreign.py,sha256=2cbMA-eug_jriDFwKZWmA_TbPW2GQAjscpZHBrs287E,2131
119
119
  akshare/futures/futures_hf_em.py,sha256=juiJauO7T6YTHXIS--ZDW-Idk73KMOrXgRBi1xEiBqA,8195
120
- akshare/futures/futures_hist_em.py,sha256=Q8I20qRjp2ujiJMCCNBvTHXmrIth22p2k6KpvbkC3dk,6472
120
+ akshare/futures/futures_hist_em.py,sha256=TuHdpcfVxdqoHzg5-JwppLUQgwuaz_LG2UZBlgf73i4,6509
121
121
  akshare/futures/futures_hq_sina.py,sha256=HZBAve1yxp1fnwgEy_2CqVoniTXRkt8KI3REt0N0TiY,9575
122
122
  akshare/futures/futures_index_ccidx.py,sha256=_kgWioCOpFNn8WUcL5qKHGb3rUHzrbrx2AszprKpBh4,4460
123
123
  akshare/futures/futures_inventory_99.py,sha256=1vbl5G34BS1oDvxdkv7k-CNLHGsM6JYZtB7FUx0WoR0,3424
@@ -139,7 +139,7 @@ akshare/futures_derivative/__init__.py,sha256=COFyP01gIUhWs4EBr6hwL73B7IWePIzg7v
139
139
  akshare/futures_derivative/cons.py,sha256=VkG1HMwPVxvj7BaMifcvDpRYLsfd506npVNiEIaLF_s,5914
140
140
  akshare/futures_derivative/futures_contract_info_cffex.py,sha256=zqnshPdW4_A6ccNSL_0grbNWVMRBnF-o9RocWELA31A,3447
141
141
  akshare/futures_derivative/futures_contract_info_czce.py,sha256=61WvHkbAKaeYBZwAfZSKGFxm4uTQj2i1xqR2mCkXyFw,4279
142
- akshare/futures_derivative/futures_contract_info_dce.py,sha256=LHGVlEJ0DFqZwY0ZAsbtREYV2ke2fgkk2yRjH-WdfW4,1706
142
+ akshare/futures_derivative/futures_contract_info_dce.py,sha256=_VOfb7JT8CRHkZlL4rIKcrCIf-JvITFs45CT2zE5ugc,1709
143
143
  akshare/futures_derivative/futures_contract_info_gfex.py,sha256=jWQ7TKPNfEjf1FUCnJqWlHmkvv0qYX0xi0JEEUAuzRg,2313
144
144
  akshare/futures_derivative/futures_contract_info_ine.py,sha256=vwCPG-Vl8c_Wy3ydBZ11ghMM5gjuPN0x9QFvyWxewXI,2433
145
145
  akshare/futures_derivative/futures_contract_info_shfe.py,sha256=PA_S7uIhCidMv2csJ8DpBtKvDQs9GaoZq-yt8oDoyfU,2454
@@ -174,7 +174,7 @@ akshare/index/index_research_sw.py,sha256=Mm1YtiP-PXhDysJwmFidX3RZSZZ92AyXpjl_tV
174
174
  akshare/index/index_spot.py,sha256=meTBTCp2DPVTX_N3qpCLtkI-0q3XhrJ3gndNugRBGKg,1767
175
175
  akshare/index/index_stock_hk.py,sha256=TpWC8061n1qEJTcC-ser4e8Ls8d0hCUG2ozHwqVKtgA,9648
176
176
  akshare/index/index_stock_us_sina.py,sha256=IxOk4G49oasv7EfEQenL9-GLuelyUus6c4JPyRlaOzY,1551
177
- akshare/index/index_stock_zh.py,sha256=AhZQV8wEJEgMBU6I19eaMrB92m6wA8nR-9Tbfo3ZiZg,17898
177
+ akshare/index/index_stock_zh.py,sha256=9RTM5xukCQk8URaaPhjM4PNEZ8W0yTCaNfaHcppxUcs,17800
178
178
  akshare/index/index_stock_zh_csindex.py,sha256=sRVoDD-fitqAMuDs0XPm1oCz2nZ2QTkvNswL1WvXpwo,4164
179
179
  akshare/index/index_sugar.py,sha256=u-huRz_WLCc2xHKRDrI3BHD7lm0XrMkQQwcEfS3FMvo,5104
180
180
  akshare/index/index_sw.py,sha256=hETMmFszQb7JDY8UHjLK8szfwkr7Ui_6QcseOoEfxaI,10456
@@ -393,10 +393,10 @@ akshare/utils/func.py,sha256=4cwmXFztU86yJNONJ40KJLvsIEQHBbct4iMm3zT2v30,2315
393
393
  akshare/utils/multi_decrypt.py,sha256=aWoL2iEPeuXHJg8-n7OtMKixLnIhfzepACgxfrfmQB4,1657
394
394
  akshare/utils/token_process.py,sha256=nGtgnZGRprXJkhLXH8mcUH4TgIFwzsTOb0EaEPa0Euo,667
395
395
  akshare/utils/tqdm.py,sha256=MuPNwcswkOGjwWQOMWXi9ZvQ_RmW4obCWRj2i7HM7FE,847
396
- akshare-1.17.35.dist-info/licenses/LICENSE,sha256=mmSZCPgfHiVw34LXuFArd-SUgQtBJ_QsIlh-kWlDHfs,1073
396
+ akshare-1.17.37.dist-info/licenses/LICENSE,sha256=s18q7gS2g1F9-Cnk5eqrJG4OGWSwSxVEMzIuT6HyYNY,1073
397
397
  tests/__init__.py,sha256=gNzhlO0UPjFq6Ieb38kaVIODXv4cTDByrdohAZnDYt4,82
398
398
  tests/test_func.py,sha256=j1MGYbZI2if2j_LY1S4FLsf4qfq4NwVqD5wmRlv5Log,832
399
- akshare-1.17.35.dist-info/METADATA,sha256=-cdndm4ufPkImfB9VnQ_x54Hfi-undo9W6otO4m0MWg,11902
400
- akshare-1.17.35.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
401
- akshare-1.17.35.dist-info/top_level.txt,sha256=jsf9ZzZPmHaISTVumQPsAw7vv7Yv-PdEVW70SMEelQQ,14
402
- akshare-1.17.35.dist-info/RECORD,,
399
+ akshare-1.17.37.dist-info/METADATA,sha256=GetKMSSqESo3tABpkburEjhQqBtInfxecK-wh_FOZDA,11919
400
+ akshare-1.17.37.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
401
+ akshare-1.17.37.dist-info/top_level.txt,sha256=jsf9ZzZPmHaISTVumQPsAw7vv7Yv-PdEVW70SMEelQQ,14
402
+ akshare-1.17.37.dist-info/RECORD,,
@@ -1,6 +1,6 @@
1
1
  MIT License
2
2
 
3
- Copyright (c) 2019-2024 Albert King
3
+ Copyright (c) 2019-2025 Albert King
4
4
 
5
5
  Permission is hereby granted, free of charge, to any person obtaining a copy
6
6
  of this software and associated documentation files (the "Software"), to deal