akshare 1.14.56__py3-none-any.whl → 1.14.58__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 +5 -6
- akshare/spot/spot_hog_soozhu.py +54 -0
- {akshare-1.14.56.dist-info → akshare-1.14.58.dist-info}/METADATA +1 -1
- {akshare-1.14.56.dist-info → akshare-1.14.58.dist-info}/RECORD +7 -8
- akshare/bond/bond_futures.py +0 -50
- {akshare-1.14.56.dist-info → akshare-1.14.58.dist-info}/LICENSE +0 -0
- {akshare-1.14.56.dist-info → akshare-1.14.58.dist-info}/WHEEL +0 -0
- {akshare-1.14.56.dist-info → akshare-1.14.58.dist-info}/top_level.txt +0 -0
akshare/__init__.py
CHANGED
|
@@ -2867,9 +2867,11 @@ amac_manager_cancelled_info # 中国证券投资基金业协会-信息公示-诚
|
|
|
2867
2867
|
1.14.54 fix: fix stock_individual_info_em interface
|
|
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
|
+
1.14.57 add: add spot_soybean_price_soozhu interface
|
|
2871
|
+
1.14.58 add: add spot_mixed_feed_soozhu interface
|
|
2870
2872
|
"""
|
|
2871
2873
|
|
|
2872
|
-
__version__ = "1.14.
|
|
2874
|
+
__version__ = "1.14.58"
|
|
2873
2875
|
__author__ = "AKFamily"
|
|
2874
2876
|
|
|
2875
2877
|
import sys
|
|
@@ -2906,6 +2908,8 @@ from akshare.spot.spot_hog_soozhu import (
|
|
|
2906
2908
|
spot_hog_three_way_soozhu,
|
|
2907
2909
|
spot_hog_crossbred_soozhu,
|
|
2908
2910
|
spot_corn_price_soozhu,
|
|
2911
|
+
spot_soybean_price_soozhu,
|
|
2912
|
+
spot_mixed_feed_soozhu,
|
|
2909
2913
|
)
|
|
2910
2914
|
|
|
2911
2915
|
"""
|
|
@@ -4301,11 +4305,6 @@ COMEX黄金-白银库存
|
|
|
4301
4305
|
"""
|
|
4302
4306
|
from akshare.futures.futures_comex_em import futures_comex_inventory
|
|
4303
4307
|
|
|
4304
|
-
"""
|
|
4305
|
-
国债期货可交割券相关指标
|
|
4306
|
-
"""
|
|
4307
|
-
from akshare.bond.bond_futures import bond_futures_deliverable_coupons
|
|
4308
|
-
|
|
4309
4308
|
"""
|
|
4310
4309
|
A 股-特别标的
|
|
4311
4310
|
"""
|
akshare/spot/spot_hog_soozhu.py
CHANGED
|
@@ -158,6 +158,54 @@ def spot_corn_price_soozhu() -> pd.DataFrame:
|
|
|
158
158
|
return temp_df
|
|
159
159
|
|
|
160
160
|
|
|
161
|
+
def spot_soybean_price_soozhu() -> pd.DataFrame:
|
|
162
|
+
"""
|
|
163
|
+
搜猪-生猪大数据-全国豆粕价格走势
|
|
164
|
+
https://www.soozhu.com/price/data/center/
|
|
165
|
+
:return: 全国豆粕价格走势
|
|
166
|
+
:rtype: pandas.DataFrame
|
|
167
|
+
"""
|
|
168
|
+
session = requests.session()
|
|
169
|
+
url = "https://www.soozhu.com/price/data/center/"
|
|
170
|
+
r = session.get(url)
|
|
171
|
+
soup = BeautifulSoup(r.text, features="lxml")
|
|
172
|
+
token = soup.find(name="input", attrs={"name": "csrfmiddlewaretoken"})["value"]
|
|
173
|
+
url = "https://www.soozhu.com/price/data/center/"
|
|
174
|
+
payload = {"act": "pricetrend", "indid": "9", "csrfmiddlewaretoken": token}
|
|
175
|
+
r = session.post(url, data=payload)
|
|
176
|
+
data_json = r.json()
|
|
177
|
+
temp_df = pd.DataFrame(data_json["datalist"])
|
|
178
|
+
temp_df.columns = ["日期", "价格"]
|
|
179
|
+
temp_df["日期"] = pd.to_datetime(temp_df["日期"], errors="coerce").dt.date
|
|
180
|
+
temp_df["价格"] = pd.to_numeric(temp_df["价格"], errors="coerce")
|
|
181
|
+
temp_df.sort_values(by=["日期"], ignore_index=True, inplace=True)
|
|
182
|
+
return temp_df
|
|
183
|
+
|
|
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
|
+
|
|
161
209
|
if __name__ == "__main__":
|
|
162
210
|
spot_hog_soozhu_df = spot_hog_soozhu()
|
|
163
211
|
print(spot_hog_soozhu_df)
|
|
@@ -176,3 +224,9 @@ if __name__ == "__main__":
|
|
|
176
224
|
|
|
177
225
|
spot_corn_price_soozhu_df = spot_corn_price_soozhu()
|
|
178
226
|
print(spot_corn_price_soozhu_df)
|
|
227
|
+
|
|
228
|
+
spot_soybean_price_soozhu_df = spot_soybean_price_soozhu()
|
|
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=ITSnaikUQRAfrWGm9bImN1GEdqw2eNJtWCQYgnWVRXw,180742
|
|
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
|
|
@@ -24,7 +24,6 @@ akshare/bond/bond_china.py,sha256=soAask4fpfcnlYzufUHL2phBU0LtzAyWX_nZI_HisKU,69
|
|
|
24
24
|
akshare/bond/bond_china_money.py,sha256=IInePsQJDby5w0AYd84ipiJL_nbyVAaRC7SaHLWDP_E,13729
|
|
25
25
|
akshare/bond/bond_convert.py,sha256=9w94nIdSN4BUL27sPbVEUouBaAm30WMBiokYr4yM0sI,12649
|
|
26
26
|
akshare/bond/bond_em.py,sha256=Ck5hCloZ25I8updarLPzqHYYZPeOsjIFy4g2oaZvFMs,5318
|
|
27
|
-
akshare/bond/bond_futures.py,sha256=sZ4h9FEXrCO13tYuAF0O0cVWKj0mMJBd7cpwVPWag9A,2326
|
|
28
27
|
akshare/bond/bond_info_cm.py,sha256=VBu9UM9tUcGDRV07pndU9yttLDF_Nk3b0vU0n65qpHs,7890
|
|
29
28
|
akshare/bond/bond_investing.py,sha256=nWONMggn-KV8XwUSs5CqIXKHX9F7W1tb4w8umH5rWho,4992
|
|
30
29
|
akshare/bond/bond_issue_cninfo.py,sha256=tPoZhF-_sIX9ztCKB0K0-Z4Kd9b-389bP3_CdFK7Wb0,21672
|
|
@@ -227,7 +226,7 @@ akshare/reits/reits_basic.py,sha256=gxQeP8_K7SYjBT9zkKuVRRi8B4SPOHNqVdXe_UvTWTY,
|
|
|
227
226
|
akshare/sport/__init__.py,sha256=aMsxmuOMZFkcI8tGmQanhPyPwyBpdeApAWyCtDRKMeg,81
|
|
228
227
|
akshare/sport/sport_olympic.py,sha256=CB1cvLpz2BWuadfonhHuQ17Qxt9X_3ks0Zc5Bff2w9k,818
|
|
229
228
|
akshare/spot/__init__.py,sha256=VGuha94pXYoezmMs3F3Q_ofaN8RZIrkJ2NtVv8hWCjY,83
|
|
230
|
-
akshare/spot/spot_hog_soozhu.py,sha256=
|
|
229
|
+
akshare/spot/spot_hog_soozhu.py,sha256=IEt7zrDs0ptAKgMA7QRIk45jcMLcA_LGq6Y3lKLFTi0,9397
|
|
231
230
|
akshare/spot/spot_price_qh.py,sha256=rRv09vR8K0U_x6x8AiLgGluxytIXkLatFNVkFbIh8eQ,3756
|
|
232
231
|
akshare/spot/spot_sge.py,sha256=Ta5EHUlGCSpNDlufIJcwgCErsJEUgH6HJHzYxoYtaMk,6313
|
|
233
232
|
akshare/stock/__init__.py,sha256=jSa9260d6aNZajaW68chI2mpPkDSXLOgi3eXrqo4MQ8,82
|
|
@@ -381,8 +380,8 @@ akshare/utils/token_process.py,sha256=K4rGXjh_tgugbRcyOK2h2x0jP3PT65IIK7nxhUKhOe
|
|
|
381
380
|
akshare/utils/tqdm.py,sha256=MuPNwcswkOGjwWQOMWXi9ZvQ_RmW4obCWRj2i7HM7FE,847
|
|
382
381
|
tests/__init__.py,sha256=gNzhlO0UPjFq6Ieb38kaVIODXv4cTDByrdohAZnDYt4,82
|
|
383
382
|
tests/test_func.py,sha256=tfvy_YnYmDra2dkKZ5JvprU1gNW5X9T634PszdSdH1A,944
|
|
384
|
-
akshare-1.14.
|
|
385
|
-
akshare-1.14.
|
|
386
|
-
akshare-1.14.
|
|
387
|
-
akshare-1.14.
|
|
388
|
-
akshare-1.14.
|
|
383
|
+
akshare-1.14.58.dist-info/LICENSE,sha256=mmSZCPgfHiVw34LXuFArd-SUgQtBJ_QsIlh-kWlDHfs,1073
|
|
384
|
+
akshare-1.14.58.dist-info/METADATA,sha256=em4scNdU-rHJiWUvVU5a6sCMwwVUbpBXjH6hu2XCMqI,13961
|
|
385
|
+
akshare-1.14.58.dist-info/WHEEL,sha256=R0nc6qTxuoLk7ShA2_Y-UWkN8ZdfDBG2B6Eqpz2WXbs,91
|
|
386
|
+
akshare-1.14.58.dist-info/top_level.txt,sha256=jsf9ZzZPmHaISTVumQPsAw7vv7Yv-PdEVW70SMEelQQ,14
|
|
387
|
+
akshare-1.14.58.dist-info/RECORD,,
|
akshare/bond/bond_futures.py
DELETED
|
@@ -1,50 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env python
|
|
2
|
-
# -*- coding:utf-8 -*-
|
|
3
|
-
"""
|
|
4
|
-
Date: 2020/10/10 13:42
|
|
5
|
-
Desc: 国债期货可交割券相关指标
|
|
6
|
-
http://www.csindex.com.cn/zh-CN/bond-valuation/bond-futures-deliverable-coupons-related-indicators?date=2020-09-22
|
|
7
|
-
"""
|
|
8
|
-
import pandas as pd
|
|
9
|
-
import requests
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
def bond_futures_deliverable_coupons(trade_date: str = "20200923") -> pd.DataFrame:
|
|
13
|
-
"""
|
|
14
|
-
国债期货可交割券相关指标
|
|
15
|
-
http://www.csindex.com.cn/zh-CN/bond-valuation/bond-futures-deliverable-coupons-related-indicators
|
|
16
|
-
:param trade_date: 交易日
|
|
17
|
-
:type trade_date: str
|
|
18
|
-
:return: 国债期货可交割券相关指标
|
|
19
|
-
:rtype: pandas.DataFrame
|
|
20
|
-
"""
|
|
21
|
-
trade_date = '-'.join([trade_date[:4], trade_date[4:6], trade_date[6:]])
|
|
22
|
-
url = "http://www.csindex.com.cn/zh-CN/bond-valuation/bond-futures-deliverable-coupons-related-indicators"
|
|
23
|
-
params = {
|
|
24
|
-
"date": trade_date
|
|
25
|
-
}
|
|
26
|
-
headers = {
|
|
27
|
-
'Accept': 'text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3;q=0.9',
|
|
28
|
-
'Accept-Encoding': 'gzip, deflate',
|
|
29
|
-
'Accept-Language': 'zh-CN,zh;q=0.9,en;q=0.8',
|
|
30
|
-
'Cache-Control': 'no-cache',
|
|
31
|
-
'Host': 'www.csindex.com.cn',
|
|
32
|
-
'Pragma': 'no-cache',
|
|
33
|
-
'Proxy-Connection': 'keep-alive',
|
|
34
|
-
'Referer': f'http://www.csindex.com.cn/zh-CN/bond-valuation/bond-futures-deliverable-coupons-related-indicators?date={trade_date}',
|
|
35
|
-
'Upgrade-Insecure-Requests': '1',
|
|
36
|
-
'User-Agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/92.0.4515.159 Safari/537.36',
|
|
37
|
-
}
|
|
38
|
-
r = requests.get(url, params=params, headers=headers)
|
|
39
|
-
temp_df = pd.read_html(r.text)[0]
|
|
40
|
-
temp_df['日期'] = temp_df['日期'].astype(str)
|
|
41
|
-
temp_df['银行间代码'] = temp_df['银行间代码'].astype(str)
|
|
42
|
-
temp_df['上交所代码'] = temp_df['上交所代码'].astype(str)
|
|
43
|
-
temp_df['深交所代码'] = temp_df['深交所代码'].astype(str)
|
|
44
|
-
temp_df.rename({"中证估值(净价)": "中证估值", "隐含回购利率(%)": "隐含回购利率"}, inplace=True, axis=1)
|
|
45
|
-
return temp_df
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
if __name__ == '__main__':
|
|
49
|
-
bond_futures_deliverable_coupons_df = bond_futures_deliverable_coupons(trade_date="20210823")
|
|
50
|
-
print(bond_futures_deliverable_coupons_df)
|
|
File without changes
|
|
File without changes
|
|
File without changes
|