akshare 1.17.74__py3-none-any.whl → 1.17.76__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 +4 -5
- akshare/futures/futures_index_ccidx.py +1 -59
- akshare/stock_feature/stock_ttm_lyr.py +8 -2
- {akshare-1.17.74.dist-info → akshare-1.17.76.dist-info}/METADATA +1 -1
- {akshare-1.17.74.dist-info → akshare-1.17.76.dist-info}/RECORD +8 -8
- {akshare-1.17.74.dist-info → akshare-1.17.76.dist-info}/WHEEL +0 -0
- {akshare-1.17.74.dist-info → akshare-1.17.76.dist-info}/licenses/LICENSE +0 -0
- {akshare-1.17.74.dist-info → akshare-1.17.76.dist-info}/top_level.txt +0 -0
akshare/__init__.py
CHANGED
|
@@ -3181,9 +3181,11 @@ amac_manager_cancelled_info # 中国证券投资基金业协会-信息公示-诚
|
|
|
3181
3181
|
1.17.72 fix: fix futures_warehouse_receipt_dce interface
|
|
3182
3182
|
1.17.73 fix: fix get_receipt interface
|
|
3183
3183
|
1.17.74 fix: fix futures_dce_position_rank interface
|
|
3184
|
+
1.17.75 fix: fix stock_a_ttm_lyr interface
|
|
3185
|
+
1.17.76 fix: fix futures_index_ccidx interface
|
|
3184
3186
|
"""
|
|
3185
3187
|
|
|
3186
|
-
__version__ = "1.17.
|
|
3188
|
+
__version__ = "1.17.76"
|
|
3187
3189
|
__author__ = "AKFamily"
|
|
3188
3190
|
|
|
3189
3191
|
import sys
|
|
@@ -5006,10 +5008,7 @@ from akshare.article.fred_md import fred_md, fred_qd
|
|
|
5006
5008
|
"""
|
|
5007
5009
|
中证商品指数
|
|
5008
5010
|
"""
|
|
5009
|
-
from akshare.futures.futures_index_ccidx import
|
|
5010
|
-
futures_index_min_ccidx,
|
|
5011
|
-
futures_index_ccidx,
|
|
5012
|
-
)
|
|
5011
|
+
from akshare.futures.futures_index_ccidx import futures_index_ccidx
|
|
5013
5012
|
|
|
5014
5013
|
"""
|
|
5015
5014
|
futures_em_spot_stock
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
# -*- coding:utf-8 -*-
|
|
2
2
|
# !/usr/bin/env python
|
|
3
3
|
"""
|
|
4
|
-
Date: 2025/
|
|
4
|
+
Date: 2025/10/29 15:00
|
|
5
5
|
Desc: 中证商品指数
|
|
6
6
|
http://www.ccidx.com/
|
|
7
7
|
"""
|
|
@@ -54,64 +54,6 @@ def futures_index_ccidx(symbol: str = "中证商品期货指数") -> pd.DataFram
|
|
|
54
54
|
return temp_df
|
|
55
55
|
|
|
56
56
|
|
|
57
|
-
def futures_index_min_ccidx(symbol: str = "中证监控油脂油料期货指数") -> pd.DataFrame:
|
|
58
|
-
"""
|
|
59
|
-
中证商品指数-商品指数-分时数据
|
|
60
|
-
http://www.ccidx.com/index.html
|
|
61
|
-
:param symbol: choice of {"中证商品期货指数", "中证商品期货价格指数", "中证监控油脂油料期货指数", "中证监控软商品期货指数",
|
|
62
|
-
"中证监控能化期货指数", "中证监控钢铁期货指数"}
|
|
63
|
-
:type symbol: str
|
|
64
|
-
:return: 商品指数-分时数据
|
|
65
|
-
:rtype: pandas.DataFrame
|
|
66
|
-
"""
|
|
67
|
-
futures_index_map = {
|
|
68
|
-
"中证商品期货指数": ["100001.CCI", "0"],
|
|
69
|
-
"中证商品期货价格指数": ["000001.CCI", "1"],
|
|
70
|
-
"中证监控油脂油料期货指数": ["606005.CCI", "2"],
|
|
71
|
-
"中证监控软商品期货指数": ["606008.CCI", "3"],
|
|
72
|
-
"中证监控能化期货指数": ["606010.CCI", "4"],
|
|
73
|
-
"中证监控钢铁期货指数": ["606011.CCI", "5"],
|
|
74
|
-
}
|
|
75
|
-
url = "http://www.ccidx.com/cscidx/csciAction/loadTimeData"
|
|
76
|
-
params = {"r": "0.08644997232349438"}
|
|
77
|
-
payload = {
|
|
78
|
-
"indexCode": futures_index_map[symbol][0],
|
|
79
|
-
"indexType": futures_index_map[symbol][1],
|
|
80
|
-
"pointer": "all",
|
|
81
|
-
}
|
|
82
|
-
headers = {
|
|
83
|
-
"Accept": "application/json, text/javascript, */*; q=0.01",
|
|
84
|
-
"Accept-Encoding": "gzip, deflate",
|
|
85
|
-
"Accept-Language": "zh-CN,zh;q=0.9,en;q=0.8",
|
|
86
|
-
"Cache-Control": "no-cache",
|
|
87
|
-
"Content-Length": "44",
|
|
88
|
-
"Connection": "keep-alive",
|
|
89
|
-
"Content-Type": "application/x-www-form-urlencoded; charset=UTF-8",
|
|
90
|
-
"Host": "www.ccidx.com",
|
|
91
|
-
"Origin": "http://www.ccidx.com",
|
|
92
|
-
"Pragma": "no-cache",
|
|
93
|
-
"Proxy-Connection": "keep-alive",
|
|
94
|
-
"Referer": "http://www.ccidx.com/cscidx/quote1",
|
|
95
|
-
"User-Agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) "
|
|
96
|
-
"Chrome/92.0.4515.159 Safari/537.36",
|
|
97
|
-
"X-Requested-With": "XMLHttpRequest",
|
|
98
|
-
}
|
|
99
|
-
r = requests.post(url, params=params, data=payload, headers=headers)
|
|
100
|
-
data_json = r.json()
|
|
101
|
-
temp_df = pd.DataFrame(
|
|
102
|
-
[data_json["dataMap"]["axisList"], data_json["dataMap"]["lineList"]]
|
|
103
|
-
).T
|
|
104
|
-
temp_df.columns = [
|
|
105
|
-
"datetime",
|
|
106
|
-
"value",
|
|
107
|
-
]
|
|
108
|
-
temp_df["value"] = pd.to_numeric(temp_df["value"], errors="coerce")
|
|
109
|
-
return temp_df
|
|
110
|
-
|
|
111
|
-
|
|
112
57
|
if __name__ == "__main__":
|
|
113
58
|
futures_index_ccidx_df = futures_index_ccidx(symbol="中证商品期货指数")
|
|
114
59
|
print(futures_index_ccidx_df)
|
|
115
|
-
|
|
116
|
-
futures_index_min_ccidx_df = futures_index_min_ccidx(symbol="中证商品期货指数")
|
|
117
|
-
print(futures_index_min_ccidx_df)
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
#!/usr/bin/env python
|
|
2
2
|
# -*- coding:utf-8 -*-
|
|
3
3
|
"""
|
|
4
|
-
Date:
|
|
4
|
+
Date: 2025/10/28 15:00
|
|
5
5
|
Desc: 全部A股-等权重市盈率、中位数市盈率
|
|
6
6
|
https://www.legulegu.com/stockdata/a-ttm-lyr
|
|
7
7
|
"""
|
|
@@ -24,10 +24,16 @@ def stock_a_ttm_lyr() -> pd.DataFrame:
|
|
|
24
24
|
"marketId": "5",
|
|
25
25
|
"token": get_token_lg(),
|
|
26
26
|
}
|
|
27
|
+
headers = get_cookie_csrf(url="https://www.legulegu.com/stockdata/a-ttm-lyr")['headers']
|
|
28
|
+
headers.update({
|
|
29
|
+
"host": "www.legulegu.com",
|
|
30
|
+
"referer": "https://www.legulegu.com/stockdata/a-ttm-lyr",
|
|
31
|
+
})
|
|
27
32
|
r = requests.get(
|
|
28
33
|
url,
|
|
29
34
|
params=params,
|
|
30
|
-
|
|
35
|
+
cookies=get_cookie_csrf(url="https://www.legulegu.com/stockdata/a-ttm-lyr")['cookies'],
|
|
36
|
+
headers=headers,
|
|
31
37
|
)
|
|
32
38
|
data_json = r.json()
|
|
33
39
|
temp_df = pd.DataFrame(data_json["data"])
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
akshare/__init__.py,sha256=
|
|
1
|
+
akshare/__init__.py,sha256=jL8SC0z10pTXEYXE39KQDrNuXrQBy9G_n6x1FqSeCL0,199732
|
|
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
|
|
@@ -120,7 +120,7 @@ akshare/futures/futures_foreign.py,sha256=2cbMA-eug_jriDFwKZWmA_TbPW2GQAjscpZHBr
|
|
|
120
120
|
akshare/futures/futures_hf_em.py,sha256=juiJauO7T6YTHXIS--ZDW-Idk73KMOrXgRBi1xEiBqA,8195
|
|
121
121
|
akshare/futures/futures_hist_em.py,sha256=TuHdpcfVxdqoHzg5-JwppLUQgwuaz_LG2UZBlgf73i4,6509
|
|
122
122
|
akshare/futures/futures_hq_sina.py,sha256=HZBAve1yxp1fnwgEy_2CqVoniTXRkt8KI3REt0N0TiY,9575
|
|
123
|
-
akshare/futures/futures_index_ccidx.py,sha256=
|
|
123
|
+
akshare/futures/futures_index_ccidx.py,sha256=4jP0cW_4zPWP1ZIkFSvQAsSxBO39fq5sSlBFUsmu8F8,1988
|
|
124
124
|
akshare/futures/futures_inventory_99.py,sha256=fUsb1ghPcz3KyoAWva_h_oj6EcEuhp_tHtJIO0eLMKI,3424
|
|
125
125
|
akshare/futures/futures_inventory_em.py,sha256=OwgONgg3Tu1WCIADcH6LpahDedAPz0iQcmNJb4ma5Dw,2620
|
|
126
126
|
akshare/futures/futures_news_shmet.py,sha256=1epZ3MwDc-T2n1ie4SSDfvUaBiMpSL0Q_xb2VoZ_llU,2465
|
|
@@ -357,7 +357,7 @@ akshare/stock_feature/stock_sy_em.py,sha256=GysP1WvPpqCLhbCRXH5sxwmXCPYvgtbJYQ_j
|
|
|
357
357
|
akshare/stock_feature/stock_technology_ths.py,sha256=4u9z7H6MYEutOYAQvYfzgc_FxG6XlhkMLujSotAbraw,30827
|
|
358
358
|
akshare/stock_feature/stock_tfp_em.py,sha256=Y3jjZ758AlCvmSHr7tlT0CMk5MawbLln0cMtl1dqYMY,2481
|
|
359
359
|
akshare/stock_feature/stock_three_report_em.py,sha256=SBksPOAGwYFDZSqoOXFg_d4qowHNZdw7JVOMFhMbBG0,24181
|
|
360
|
-
akshare/stock_feature/stock_ttm_lyr.py,sha256=
|
|
360
|
+
akshare/stock_feature/stock_ttm_lyr.py,sha256=VzxwSzQZNaEJlW7azS1FxZJSyk9V7DrMt25285U1mw4,1376
|
|
361
361
|
akshare/stock_feature/stock_value_em.py,sha256=RA842dkeChSEoS3yN9fiGxS3eDzYjeUdrpXbnteyzZY,2576
|
|
362
362
|
akshare/stock_feature/stock_yjbb_em.py,sha256=hQBr1aj808AdA88Y_dpuR7G1mb487hcRamD31UZus-s,4689
|
|
363
363
|
akshare/stock_feature/stock_yjyg_cninfo.py,sha256=KM0O5rHBkVAxDl4dmA_WAgqBWJMuaMLoQ2PyJ-VPBi4,2889
|
|
@@ -399,10 +399,10 @@ akshare/utils/func.py,sha256=4cwmXFztU86yJNONJ40KJLvsIEQHBbct4iMm3zT2v30,2315
|
|
|
399
399
|
akshare/utils/multi_decrypt.py,sha256=aWoL2iEPeuXHJg8-n7OtMKixLnIhfzepACgxfrfmQB4,1657
|
|
400
400
|
akshare/utils/token_process.py,sha256=nGtgnZGRprXJkhLXH8mcUH4TgIFwzsTOb0EaEPa0Euo,667
|
|
401
401
|
akshare/utils/tqdm.py,sha256=MuPNwcswkOGjwWQOMWXi9ZvQ_RmW4obCWRj2i7HM7FE,847
|
|
402
|
-
akshare-1.17.
|
|
402
|
+
akshare-1.17.76.dist-info/licenses/LICENSE,sha256=s18q7gS2g1F9-Cnk5eqrJG4OGWSwSxVEMzIuT6HyYNY,1073
|
|
403
403
|
tests/__init__.py,sha256=gNzhlO0UPjFq6Ieb38kaVIODXv4cTDByrdohAZnDYt4,82
|
|
404
404
|
tests/test_func.py,sha256=j1MGYbZI2if2j_LY1S4FLsf4qfq4NwVqD5wmRlv5Log,832
|
|
405
|
-
akshare-1.17.
|
|
406
|
-
akshare-1.17.
|
|
407
|
-
akshare-1.17.
|
|
408
|
-
akshare-1.17.
|
|
405
|
+
akshare-1.17.76.dist-info/METADATA,sha256=lrV-kMILMSBggWN3O3Zr7Xf0FM9dl6Vd-EksmXdOTJg,12593
|
|
406
|
+
akshare-1.17.76.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
|
|
407
|
+
akshare-1.17.76.dist-info/top_level.txt,sha256=jsf9ZzZPmHaISTVumQPsAw7vv7Yv-PdEVW70SMEelQQ,14
|
|
408
|
+
akshare-1.17.76.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|
|
File without changes
|