akshare 1.17.73__py3-none-any.whl → 1.17.75__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 +3 -1
- akshare/futures/cot.py +11 -30
- akshare/stock/cons.py +2 -2
- akshare/stock_feature/stock_ttm_lyr.py +8 -2
- {akshare-1.17.73.dist-info → akshare-1.17.75.dist-info}/METADATA +1 -1
- {akshare-1.17.73.dist-info → akshare-1.17.75.dist-info}/RECORD +9 -9
- {akshare-1.17.73.dist-info → akshare-1.17.75.dist-info}/WHEEL +0 -0
- {akshare-1.17.73.dist-info → akshare-1.17.75.dist-info}/licenses/LICENSE +0 -0
- {akshare-1.17.73.dist-info → akshare-1.17.75.dist-info}/top_level.txt +0 -0
akshare/__init__.py
CHANGED
|
@@ -3180,9 +3180,11 @@ amac_manager_cancelled_info # 中国证券投资基金业协会-信息公示-诚
|
|
|
3180
3180
|
1.17.71 fix: fix futures_inventory_99 interface
|
|
3181
3181
|
1.17.72 fix: fix futures_warehouse_receipt_dce interface
|
|
3182
3182
|
1.17.73 fix: fix get_receipt interface
|
|
3183
|
+
1.17.74 fix: fix futures_dce_position_rank interface
|
|
3184
|
+
1.17.75 fix: fix stock_a_ttm_lyr interface
|
|
3183
3185
|
"""
|
|
3184
3186
|
|
|
3185
|
-
__version__ = "1.17.
|
|
3187
|
+
__version__ = "1.17.75"
|
|
3186
3188
|
__author__ = "AKFamily"
|
|
3187
3189
|
|
|
3188
3190
|
import sys
|
akshare/futures/cot.py
CHANGED
|
@@ -99,7 +99,7 @@ def get_rank_sum_daily(
|
|
|
99
99
|
f"{start_day.strftime('%Y-%m-%d')}日交易所数据连接失败,已超过20次,您的地址被网站墙了,请保存好返回数据,稍后从该日期起重试"
|
|
100
100
|
)
|
|
101
101
|
return records.reset_index(drop=True)
|
|
102
|
-
records = pd.concat([records, data], ignore_index=True)
|
|
102
|
+
records = pd.concat(objs=[records, data], ignore_index=True)
|
|
103
103
|
else:
|
|
104
104
|
warnings.warn(f"{start_day.strftime('%Y%m%d')}非交易日")
|
|
105
105
|
start_day += datetime.timedelta(days=1)
|
|
@@ -826,40 +826,21 @@ def futures_dce_position_rank(
|
|
|
826
826
|
if date.strftime("%Y%m%d") not in calendar:
|
|
827
827
|
warnings.warn("%s非交易日" % date.strftime("%Y%m%d"))
|
|
828
828
|
return {}
|
|
829
|
-
|
|
830
|
-
|
|
831
|
-
"Accept": "text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;"
|
|
832
|
-
"q=0.8,application/signed-exchange;v=b3;q=0.9",
|
|
833
|
-
"Accept-Encoding": "gzip, deflate",
|
|
834
|
-
"Accept-Language": "zh-CN,zh;q=0.9,en;q=0.8",
|
|
835
|
-
"Cache-Control": "no-cache",
|
|
836
|
-
"Connection": "keep-alive",
|
|
837
|
-
"Content-Length": "160",
|
|
838
|
-
"Content-Type": "application/x-www-form-urlencoded",
|
|
839
|
-
"Host": "www.dce.com.cn",
|
|
840
|
-
"Origin": "http://portal.dce.com.cn",
|
|
841
|
-
"Pragma": "no-cache",
|
|
842
|
-
"Referer": "http://portal.dce.com.cn/publicweb/quotesdata/memberDealPosiQuotes.html",
|
|
843
|
-
"Upgrade-Insecure-Requests": "1",
|
|
844
|
-
"User-Agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) "
|
|
845
|
-
"Chrome/81.0.4044.138 Safari/537.36",
|
|
846
|
-
}
|
|
829
|
+
date_str = date.strftime("%Y%m%d")
|
|
830
|
+
url = "http://www.dce.com.cn/dcereport/publicweb/dailystat/memberDealPosi/batchDownload"
|
|
847
831
|
payload = {
|
|
848
|
-
"
|
|
849
|
-
"
|
|
850
|
-
"
|
|
851
|
-
"
|
|
852
|
-
"
|
|
853
|
-
"month": date.month - 1,
|
|
854
|
-
"day": str(date.day).zfill(2),
|
|
855
|
-
"batchExportFlag": "batch",
|
|
832
|
+
"tradeDate": date_str,
|
|
833
|
+
"varietyId": "a",
|
|
834
|
+
"contractId": "a2601",
|
|
835
|
+
"tradeType": "1",
|
|
836
|
+
"lang": "zh",
|
|
856
837
|
}
|
|
857
|
-
r = requests.post(url, payload
|
|
838
|
+
r = requests.post(url, json=payload)
|
|
858
839
|
big_dict = dict()
|
|
859
840
|
with zipfile.ZipFile(BytesIO(r.content), mode="r") as z:
|
|
860
841
|
for i in z.namelist():
|
|
861
|
-
file_name = i
|
|
862
|
-
if not file_name.startswith(
|
|
842
|
+
file_name = i
|
|
843
|
+
if not file_name.startswith(date_str):
|
|
863
844
|
continue
|
|
864
845
|
try:
|
|
865
846
|
data = pd.read_table(z.open(i), header=None, sep="\t")
|
akshare/stock/cons.py
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
#!/usr/bin/env python
|
|
2
2
|
# -*- coding:utf-8 -*-
|
|
3
3
|
"""
|
|
4
|
-
Date: 2025/10/
|
|
4
|
+
Date: 2025/10/28 15:00
|
|
5
5
|
Desc: 股票配置文件
|
|
6
6
|
"""
|
|
7
7
|
|
|
8
|
-
xq_a_token = "
|
|
8
|
+
xq_a_token = "144a75f00fac53d1ebae9a21261446d57d4443d1"
|
|
9
9
|
|
|
10
10
|
# zh-sina-kcb
|
|
11
11
|
zh_sina_kcb_stock_url = ("http://vip.stock.finance.sina.com.cn/quotes_service/api/json_v2.php/"
|
|
@@ -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=rKjZiSLdda0WXJ_iQj1QU2g-IXhPjLXz_ii46xg-E30,199723
|
|
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
|
|
@@ -109,7 +109,7 @@ akshare/fund/fund_scale_sina.py,sha256=A0qIzWBQdE3IGS9-cxO9_FNpuH-BAG5HhPk5KzTFT
|
|
|
109
109
|
akshare/fund/fund_xq.py,sha256=AxMZB-940bNY7-BatVLZiseHNxiWA17hQzTfuxGibPU,11306
|
|
110
110
|
akshare/futures/__init__.py,sha256=RMTf1bT5EOE3ttWpn3hGu1LtUmsVxDoa0W7W0gXHOy8,81
|
|
111
111
|
akshare/futures/cons.py,sha256=2cqWdaPbuGHtkhbrDWnhHnIBxUzelRJjJ5oCmMKodFo,17976
|
|
112
|
-
akshare/futures/cot.py,sha256=
|
|
112
|
+
akshare/futures/cot.py,sha256=hY27LMsSmRvme4ITJdcWAc8N4a7vwNo6M2Gh8jcxz74,57848
|
|
113
113
|
akshare/futures/futures_basis.py,sha256=YB-fOUTCanNZqHNcJXJdFqpCBi9_NYbrTlzx2st5AS0,15710
|
|
114
114
|
akshare/futures/futures_comex_em.py,sha256=NPwOCD6lZUDL4wlGxvbmmJIFkQlW427ERO0vTux13WU,3172
|
|
115
115
|
akshare/futures/futures_comm_ctp.py,sha256=IyVRCUvhLTFzmcUVvlIaYZ1e38ll7AF8ExhgtXKuzrI,1003
|
|
@@ -238,7 +238,7 @@ akshare/spot/spot_hog_soozhu.py,sha256=IEt7zrDs0ptAKgMA7QRIk45jcMLcA_LGq6Y3lKLFT
|
|
|
238
238
|
akshare/spot/spot_price_qh.py,sha256=rRv09vR8K0U_x6x8AiLgGluxytIXkLatFNVkFbIh8eQ,3756
|
|
239
239
|
akshare/spot/spot_sge.py,sha256=fXy6I9GchX2rfdPDD2wSN8K-hcDdS3ABzLDLdH-9t4Y,8696
|
|
240
240
|
akshare/stock/__init__.py,sha256=jSa9260d6aNZajaW68chI2mpPkDSXLOgi3eXrqo4MQ8,82
|
|
241
|
-
akshare/stock/cons.py,sha256=
|
|
241
|
+
akshare/stock/cons.py,sha256=UfWofeh75Jo8lifeoONVtNuyjwCxngtsJ9Az3nNuXHA,43668
|
|
242
242
|
akshare/stock/stock_allotment_cninfo.py,sha256=OVjVdWp2XVRNbJvVgtgVVoBmPBJgBB4RyIIgA_9QHM8,6066
|
|
243
243
|
akshare/stock/stock_ask_bid_em.py,sha256=bo7VNkp1PmK4Z-GPZuVn_I-IAdzeW8cs3W_75KodxCg,3368
|
|
244
244
|
akshare/stock/stock_board_concept_em.py,sha256=C13AHQueLFDDqL39MEkIKWFJVgMql5T79N1Hruppn9o,17785
|
|
@@ -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.75.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.75.dist-info/METADATA,sha256=C1Kwna80JqZx5Z2ywXhXw-Ij4u0z0xWlyKQi1sqBOOA,12593
|
|
406
|
+
akshare-1.17.75.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
|
|
407
|
+
akshare-1.17.75.dist-info/top_level.txt,sha256=jsf9ZzZPmHaISTVumQPsAw7vv7Yv-PdEVW70SMEelQQ,14
|
|
408
|
+
akshare-1.17.75.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|
|
File without changes
|