akshare 1.14.57__py3-none-any.whl → 1.14.59__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 -1
- akshare/economic/marco_cnbs.py +11 -6
- akshare/spot/spot_hog_soozhu.py +27 -0
- {akshare-1.14.57.dist-info → akshare-1.14.59.dist-info}/METADATA +1 -1
- {akshare-1.14.57.dist-info → akshare-1.14.59.dist-info}/RECORD +8 -8
- {akshare-1.14.57.dist-info → akshare-1.14.59.dist-info}/WHEEL +1 -1
- {akshare-1.14.57.dist-info → akshare-1.14.59.dist-info}/LICENSE +0 -0
- {akshare-1.14.57.dist-info → akshare-1.14.59.dist-info}/top_level.txt +0 -0
akshare/__init__.py
CHANGED
|
@@ -2868,9 +2868,11 @@ amac_manager_cancelled_info # 中国证券投资基金业协会-信息公示-诚
|
|
|
2868
2868
|
1.14.55 add: add spot_hog_crossbred_soozhu interface
|
|
2869
2869
|
1.14.56 add: add spot_corn_price_soozhu interface
|
|
2870
2870
|
1.14.57 add: add spot_soybean_price_soozhu interface
|
|
2871
|
+
1.14.58 add: add spot_mixed_feed_soozhu interface
|
|
2872
|
+
1.14.59 fix: fix macro_cnbs interface
|
|
2871
2873
|
"""
|
|
2872
2874
|
|
|
2873
|
-
__version__ = "1.14.
|
|
2875
|
+
__version__ = "1.14.59"
|
|
2874
2876
|
__author__ = "AKFamily"
|
|
2875
2877
|
|
|
2876
2878
|
import sys
|
|
@@ -2908,6 +2910,7 @@ from akshare.spot.spot_hog_soozhu import (
|
|
|
2908
2910
|
spot_hog_crossbred_soozhu,
|
|
2909
2911
|
spot_corn_price_soozhu,
|
|
2910
2912
|
spot_soybean_price_soozhu,
|
|
2913
|
+
spot_mixed_feed_soozhu,
|
|
2911
2914
|
)
|
|
2912
2915
|
|
|
2913
2916
|
"""
|
akshare/economic/marco_cnbs.py
CHANGED
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
#!/usr/bin/env python
|
|
2
2
|
# -*- coding:utf-8 -*-
|
|
3
3
|
"""
|
|
4
|
-
Date: 2023/
|
|
4
|
+
Date: 2023/8/14 11:10
|
|
5
5
|
Desc: 国家金融与发展实验室-中国宏观杠杆率数据
|
|
6
6
|
http://114.115.232.154:8080/
|
|
7
7
|
"""
|
|
8
|
+
|
|
8
9
|
import pandas as pd
|
|
9
10
|
|
|
10
11
|
|
|
@@ -50,16 +51,20 @@ def macro_cnbs() -> pd.DataFrame:
|
|
|
50
51
|
"金融部门负债方",
|
|
51
52
|
]
|
|
52
53
|
temp_df = temp_df.reindex(columns=column_order)
|
|
53
|
-
|
|
54
54
|
temp_df["居民部门"] = pd.to_numeric(temp_df["居民部门"], errors="coerce")
|
|
55
|
-
temp_df["非金融企业部门"] = pd.to_numeric(
|
|
55
|
+
temp_df["非金融企业部门"] = pd.to_numeric(
|
|
56
|
+
temp_df["非金融企业部门"], errors="coerce"
|
|
57
|
+
)
|
|
56
58
|
temp_df["政府部门"] = pd.to_numeric(temp_df["政府部门"], errors="coerce")
|
|
57
59
|
temp_df["中央政府"] = pd.to_numeric(temp_df["中央政府"], errors="coerce")
|
|
58
60
|
temp_df["地方政府"] = pd.to_numeric(temp_df["地方政府"], errors="coerce")
|
|
59
61
|
temp_df["实体经济部门"] = pd.to_numeric(temp_df["实体经济部门"], errors="coerce")
|
|
60
|
-
temp_df["金融部门资产方"] = pd.to_numeric(
|
|
61
|
-
|
|
62
|
-
|
|
62
|
+
temp_df["金融部门资产方"] = pd.to_numeric(
|
|
63
|
+
temp_df["金融部门资产方"], errors="coerce"
|
|
64
|
+
)
|
|
65
|
+
temp_df["金融部门负债方"] = pd.to_numeric(
|
|
66
|
+
temp_df["金融部门负债方"], errors="coerce"
|
|
67
|
+
)
|
|
63
68
|
return temp_df
|
|
64
69
|
|
|
65
70
|
|
akshare/spot/spot_hog_soozhu.py
CHANGED
|
@@ -182,6 +182,30 @@ def spot_soybean_price_soozhu() -> pd.DataFrame:
|
|
|
182
182
|
return temp_df
|
|
183
183
|
|
|
184
184
|
|
|
185
|
+
def spot_mixed_feed_soozhu() -> pd.DataFrame:
|
|
186
|
+
"""
|
|
187
|
+
搜猪-生猪大数据-全国育肥猪合料(含自配料)半月走势
|
|
188
|
+
https://www.soozhu.com/price/data/center/
|
|
189
|
+
:return: 全国育肥猪合料(含自配料)半月走势
|
|
190
|
+
:rtype: pandas.DataFrame
|
|
191
|
+
"""
|
|
192
|
+
session = requests.session()
|
|
193
|
+
url = "https://www.soozhu.com/price/data/center/"
|
|
194
|
+
r = session.get(url)
|
|
195
|
+
soup = BeautifulSoup(r.text, features="lxml")
|
|
196
|
+
token = soup.find(name="input", attrs={"name": "csrfmiddlewaretoken"})["value"]
|
|
197
|
+
url = "https://www.soozhu.com/price/data/center/"
|
|
198
|
+
payload = {"act": "pricetrend", "indid": "11", "csrfmiddlewaretoken": token}
|
|
199
|
+
r = session.post(url, data=payload)
|
|
200
|
+
data_json = r.json()
|
|
201
|
+
temp_df = pd.DataFrame(data_json["datalist"])
|
|
202
|
+
temp_df.columns = ["日期", "价格"]
|
|
203
|
+
temp_df["日期"] = pd.to_datetime(temp_df["日期"], errors="coerce").dt.date
|
|
204
|
+
temp_df["价格"] = pd.to_numeric(temp_df["价格"], errors="coerce")
|
|
205
|
+
temp_df.sort_values(by=["日期"], ignore_index=True, inplace=True)
|
|
206
|
+
return temp_df
|
|
207
|
+
|
|
208
|
+
|
|
185
209
|
if __name__ == "__main__":
|
|
186
210
|
spot_hog_soozhu_df = spot_hog_soozhu()
|
|
187
211
|
print(spot_hog_soozhu_df)
|
|
@@ -203,3 +227,6 @@ if __name__ == "__main__":
|
|
|
203
227
|
|
|
204
228
|
spot_soybean_price_soozhu_df = spot_soybean_price_soozhu()
|
|
205
229
|
print(spot_soybean_price_soozhu_df)
|
|
230
|
+
|
|
231
|
+
spot_mixed_feed_soozhu_df = spot_mixed_feed_soozhu()
|
|
232
|
+
print(spot_mixed_feed_soozhu_df)
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
akshare/__init__.py,sha256
|
|
1
|
+
akshare/__init__.py,sha256=-vt4pHcLM4WikNyFRByB1ZYt0UcrfREBrzB3TiLNLeA,180780
|
|
2
2
|
akshare/datasets.py,sha256=oIu1zC7o_LMHY22lQmdM7vCnryHibKrJLBqJwQiitlI,1167
|
|
3
3
|
akshare/air/__init__.py,sha256=RMTf1bT5EOE3ttWpn3hGu1LtUmsVxDoa0W7W0gXHOy8,81
|
|
4
4
|
akshare/air/air_hebei.py,sha256=xIXNGLK7IGYqrkteM9fxnHAwWqk6PCQs6D9-ggZ7byY,4442
|
|
@@ -64,7 +64,7 @@ akshare/economic/macro_other.py,sha256=nf4XIw1x5wnn9WaiuxxbOYf9mgRsJNXJ7gmiprsbf
|
|
|
64
64
|
akshare/economic/macro_swiss.py,sha256=23b2Swd786XC3BI2TZdxmzGDaZKb-O6QkbAtAnHa6WE,4403
|
|
65
65
|
akshare/economic/macro_uk.py,sha256=wxfzehWbGysnnyjeZz4sZPcezJLDQDRcGJGjOYhUUmY,8469
|
|
66
66
|
akshare/economic/macro_usa.py,sha256=4t4rk7h83mnkyroM4VwRo0W7NmFBFgOsZ50ml1fck1o,48492
|
|
67
|
-
akshare/economic/marco_cnbs.py,sha256=
|
|
67
|
+
akshare/economic/marco_cnbs.py,sha256=gWLy489eEQrxqqpoztls5FnM6yJKSw-H7o40sK6ssMU,2490
|
|
68
68
|
akshare/energy/__init__.py,sha256=hnsOSZlRX38q13LxfitiByNj_hUcVM-VtWDDnDoHe3s,82
|
|
69
69
|
akshare/energy/energy_carbon.py,sha256=ORFzl5YmcZry1TUoQHoSmTTDLpVq_Aof7SxEABGkOoU,11341
|
|
70
70
|
akshare/energy/energy_oil_em.py,sha256=ebXH9icUpgX1qssHslw3Hx5xYgifKz5VNt9UKbXfAAk,4087
|
|
@@ -226,7 +226,7 @@ akshare/reits/reits_basic.py,sha256=gxQeP8_K7SYjBT9zkKuVRRi8B4SPOHNqVdXe_UvTWTY,
|
|
|
226
226
|
akshare/sport/__init__.py,sha256=aMsxmuOMZFkcI8tGmQanhPyPwyBpdeApAWyCtDRKMeg,81
|
|
227
227
|
akshare/sport/sport_olympic.py,sha256=CB1cvLpz2BWuadfonhHuQ17Qxt9X_3ks0Zc5Bff2w9k,818
|
|
228
228
|
akshare/spot/__init__.py,sha256=VGuha94pXYoezmMs3F3Q_ofaN8RZIrkJ2NtVv8hWCjY,83
|
|
229
|
-
akshare/spot/spot_hog_soozhu.py,sha256=
|
|
229
|
+
akshare/spot/spot_hog_soozhu.py,sha256=IEt7zrDs0ptAKgMA7QRIk45jcMLcA_LGq6Y3lKLFTi0,9397
|
|
230
230
|
akshare/spot/spot_price_qh.py,sha256=rRv09vR8K0U_x6x8AiLgGluxytIXkLatFNVkFbIh8eQ,3756
|
|
231
231
|
akshare/spot/spot_sge.py,sha256=Ta5EHUlGCSpNDlufIJcwgCErsJEUgH6HJHzYxoYtaMk,6313
|
|
232
232
|
akshare/stock/__init__.py,sha256=jSa9260d6aNZajaW68chI2mpPkDSXLOgi3eXrqo4MQ8,82
|
|
@@ -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=tfvy_YnYmDra2dkKZ5JvprU1gNW5X9T634PszdSdH1A,944
|
|
383
|
-
akshare-1.14.
|
|
384
|
-
akshare-1.14.
|
|
385
|
-
akshare-1.14.
|
|
386
|
-
akshare-1.14.
|
|
387
|
-
akshare-1.14.
|
|
383
|
+
akshare-1.14.59.dist-info/LICENSE,sha256=mmSZCPgfHiVw34LXuFArd-SUgQtBJ_QsIlh-kWlDHfs,1073
|
|
384
|
+
akshare-1.14.59.dist-info/METADATA,sha256=iHe8eKqNoBraIvHQouVf52pobYirOlzI48byGPb9FQU,13961
|
|
385
|
+
akshare-1.14.59.dist-info/WHEEL,sha256=HiCZjzuy6Dw0hdX5R3LCFPDmFS4BWl8H-8W39XfmgX4,91
|
|
386
|
+
akshare-1.14.59.dist-info/top_level.txt,sha256=jsf9ZzZPmHaISTVumQPsAw7vv7Yv-PdEVW70SMEelQQ,14
|
|
387
|
+
akshare-1.14.59.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|