akshare 1.17.36__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
@@ -3143,9 +3143,10 @@ amac_manager_cancelled_info # 中国证券投资基金业协会-信息公示-诚
3143
3143
  1.17.34 fix: fix option_czce_daily interface
3144
3144
  1.17.35 fix: fix option_dce_daily interface
3145
3145
  1.17.36 fix: fix futures_hist_em interface
3146
+ 1.17.37 fix: fix stock_zh_index_daily_em interface
3146
3147
  """
3147
3148
 
3148
- __version__ = "1.17.36"
3149
+ __version__ = "1.17.37"
3149
3150
  __author__ = "AKFamily"
3150
3151
 
3151
3152
  import sys
@@ -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.36
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
@@ -1,4 +1,4 @@
1
- akshare/__init__.py,sha256=rr7ZClxcM_RxKUvwatMo95IGlHjqPqt5ipiT-hKGhd4,196288
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
@@ -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.36.dist-info/licenses/LICENSE,sha256=s18q7gS2g1F9-Cnk5eqrJG4OGWSwSxVEMzIuT6HyYNY,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.36.dist-info/METADATA,sha256=nzWH_5HbtjhqaN_UtEtR_Ed-BkpgMDrd-UFPfmDfv-c,11919
400
- akshare-1.17.36.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
401
- akshare-1.17.36.dist-info/top_level.txt,sha256=jsf9ZzZPmHaISTVumQPsAw7vv7Yv-PdEVW70SMEelQQ,14
402
- akshare-1.17.36.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,,