akshare 1.15.86__py3-none-any.whl → 1.15.87__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
@@ -2996,9 +2996,10 @@ amac_manager_cancelled_info # 中国证券投资基金业协会-信息公示-诚
2996
2996
  1.15.84 fix: fix option_dce_daily interface
2997
2997
  1.15.85 fix: fix stock_gddh_em interface
2998
2998
  1.15.86 fix: fix stock_zdhtmx_em interface
2999
+ 1.15.87 fix: fix futures_index_ccidx interface
2999
3000
  """
3000
3001
 
3001
- __version__ = "1.15.86"
3002
+ __version__ = "1.15.87"
3002
3003
  __author__ = "AKFamily"
3003
3004
 
3004
3005
  import sys
@@ -1,12 +1,12 @@
1
1
  # -*- coding:utf-8 -*-
2
2
  # !/usr/bin/env python
3
3
  """
4
- Date: 2023/11/9 14:00
4
+ Date: 2025/2/12 16:00
5
5
  Desc: 中证商品指数
6
6
  http://www.ccidx.com/
7
7
  """
8
8
 
9
- from io import BytesIO
9
+ import json
10
10
 
11
11
  import pandas as pd
12
12
  import requests
@@ -25,31 +25,28 @@ def futures_index_ccidx(symbol: str = "中证商品期货指数") -> pd.DataFram
25
25
  "中证商品期货指数": "100001.CCI",
26
26
  "中证商品期货价格指数": "000001.CCI",
27
27
  }
28
- url = "http://www.ccidx.com/front/ajax_downZSHQ.do"
29
- params = {"indexCode": futures_index_map[symbol]}
28
+ url = "http://www.ccidx.com/CCI-ZZZS/index/getDateLine"
29
+ params = {"indexId": futures_index_map[symbol]}
30
30
  r = requests.get(url, params=params)
31
- temp_df = pd.read_excel(BytesIO(r.content), header=1, engine="openpyxl")
32
- temp_df.columns = [
33
- "日期",
34
- "指数代码",
35
- "指数中文全称",
36
- "指数中文简称",
37
- "指数英文全称",
38
- "指数英文简称",
39
- "开盘",
40
- "最高",
41
- "最低",
42
- "收盘",
43
- "结算",
44
- "涨跌",
45
- "涨跌幅",
46
- ]
31
+ data_json = r.json()
32
+ temp_df = pd.DataFrame(
33
+ [json.loads(item) for item in data_json["data"]["dateLineJson"]]
34
+ )
35
+ temp_df.rename(
36
+ columns={
37
+ "tradeDate": "日期",
38
+ "indexId": "指数代码",
39
+ "closingPrice": "收盘点位",
40
+ "settlePrice": "结算点位",
41
+ "dailyIncreaseAndDecrease": "涨跌",
42
+ "dailyIncreaseAndDecreasePercentage": "涨跌幅",
43
+ },
44
+ inplace=True,
45
+ )
46
+
47
47
  temp_df["日期"] = pd.to_datetime(temp_df["日期"], errors="coerce").dt.date
48
- temp_df["开盘"] = pd.to_numeric(temp_df["开盘"], errors="coerce")
49
- temp_df["最高"] = pd.to_numeric(temp_df["最高"], errors="coerce")
50
- temp_df["最低"] = pd.to_numeric(temp_df["最低"], errors="coerce")
51
- temp_df["收盘"] = pd.to_numeric(temp_df["收盘"], errors="coerce")
52
- temp_df["结算"] = pd.to_numeric(temp_df["结算"], errors="coerce")
48
+ temp_df["收盘点位"] = pd.to_numeric(temp_df["收盘点位"], errors="coerce")
49
+ temp_df["结算点位"] = pd.to_numeric(temp_df["结算点位"], errors="coerce")
53
50
  temp_df["涨跌"] = pd.to_numeric(temp_df["涨跌"], errors="coerce")
54
51
  temp_df["涨跌幅"] = pd.to_numeric(temp_df["涨跌幅"], errors="coerce")
55
52
  temp_df.sort_values(by=["日期"], inplace=True)
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.2
2
2
  Name: akshare
3
- Version: 1.15.86
3
+ Version: 1.15.87
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=fW5bZMjmcN526kpsUiiaSP97n1auQPoQ0yaNTexZUZs,186883
1
+ akshare/__init__.py,sha256=IYBCt-ujchTg4VREWnkTnX-buYA9aQmbWH849eD0ZeQ,186930
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
@@ -115,7 +115,7 @@ akshare/futures/futures_foreign.py,sha256=oSIoAg5oy-CIlPWHkQffcvZGu02Y2GWOrt-6aP
115
115
  akshare/futures/futures_hf_em.py,sha256=jne-wUYr2QTUkDq3qAxYKE0Hm90L3H8qUDu3JavKiUg,3338
116
116
  akshare/futures/futures_hist_em.py,sha256=23poFID_GE2mWf9NnkJBE3N7FgxNYiqrbTKO0VciS_A,6441
117
117
  akshare/futures/futures_hq_sina.py,sha256=eK1gEan4DPvpYmln8-tNnzh_J_733s95DBr--NqNYVA,9576
118
- akshare/futures/futures_index_ccidx.py,sha256=Ni5GICleqcHrmLatOE_Bs4i1DS3bn0lEm_RyrjlucB0,4581
118
+ akshare/futures/futures_index_ccidx.py,sha256=_kgWioCOpFNn8WUcL5qKHGb3rUHzrbrx2AszprKpBh4,4460
119
119
  akshare/futures/futures_inventory_99.py,sha256=xdX8GSCEcRWYnbw0XS22rcblXOvlzUvfUltv7oyRh3Y,2990
120
120
  akshare/futures/futures_inventory_em.py,sha256=C5nt4F51WB-oc8o3GrMvEGo0SO2mIq_H1vHVl42vzT0,2340
121
121
  akshare/futures/futures_news_shmet.py,sha256=1epZ3MwDc-T2n1ie4SSDfvUaBiMpSL0Q_xb2VoZ_llU,2465
@@ -380,8 +380,8 @@ akshare/utils/token_process.py,sha256=K4rGXjh_tgugbRcyOK2h2x0jP3PT65IIK7nxhUKhOe
380
380
  akshare/utils/tqdm.py,sha256=MuPNwcswkOGjwWQOMWXi9ZvQ_RmW4obCWRj2i7HM7FE,847
381
381
  tests/__init__.py,sha256=gNzhlO0UPjFq6Ieb38kaVIODXv4cTDByrdohAZnDYt4,82
382
382
  tests/test_func.py,sha256=j1MGYbZI2if2j_LY1S4FLsf4qfq4NwVqD5wmRlv5Log,832
383
- akshare-1.15.86.dist-info/LICENSE,sha256=mmSZCPgfHiVw34LXuFArd-SUgQtBJ_QsIlh-kWlDHfs,1073
384
- akshare-1.15.86.dist-info/METADATA,sha256=--Ircg6PIKICrg10sE11cIplNQZkcZe2Mc86LOI650A,13679
385
- akshare-1.15.86.dist-info/WHEEL,sha256=In9FTNxeP60KnTkGw7wk6mJPYd_dQSjEZmXdBdMCI-8,91
386
- akshare-1.15.86.dist-info/top_level.txt,sha256=jsf9ZzZPmHaISTVumQPsAw7vv7Yv-PdEVW70SMEelQQ,14
387
- akshare-1.15.86.dist-info/RECORD,,
383
+ akshare-1.15.87.dist-info/LICENSE,sha256=mmSZCPgfHiVw34LXuFArd-SUgQtBJ_QsIlh-kWlDHfs,1073
384
+ akshare-1.15.87.dist-info/METADATA,sha256=0TbL6iLOFFIXCWenS6eBnCFZnVlY4F-1mx2W6GEXpQA,13679
385
+ akshare-1.15.87.dist-info/WHEEL,sha256=In9FTNxeP60KnTkGw7wk6mJPYd_dQSjEZmXdBdMCI-8,91
386
+ akshare-1.15.87.dist-info/top_level.txt,sha256=jsf9ZzZPmHaISTVumQPsAw7vv7Yv-PdEVW70SMEelQQ,14
387
+ akshare-1.15.87.dist-info/RECORD,,