akshare 1.16.31__py3-none-any.whl → 1.16.32__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.
- akshare/__init__.py +2 -1
- akshare/news/news_baidu.py +15 -34
- {akshare-1.16.31.dist-info → akshare-1.16.32.dist-info}/METADATA +1 -1
- {akshare-1.16.31.dist-info → akshare-1.16.32.dist-info}/RECORD +7 -7
- {akshare-1.16.31.dist-info → akshare-1.16.32.dist-info}/LICENSE +0 -0
- {akshare-1.16.31.dist-info → akshare-1.16.32.dist-info}/WHEEL +0 -0
- {akshare-1.16.31.dist-info → akshare-1.16.32.dist-info}/top_level.txt +0 -0
akshare/__init__.py
CHANGED
@@ -3040,9 +3040,10 @@ amac_manager_cancelled_info # 中国证券投资基金业协会-信息公示-诚
|
|
3040
3040
|
1.16.29 fix: fix futures_global_hist_em interface
|
3041
3041
|
1.16.30 add: add forex_hist_em interface
|
3042
3042
|
1.16.31 add: add index_global_hist_em interface
|
3043
|
+
1.16.32 fix: fix news_economic_baidu interface
|
3043
3044
|
"""
|
3044
3045
|
|
3045
|
-
__version__ = "1.16.
|
3046
|
+
__version__ = "1.16.32"
|
3046
3047
|
__author__ = "AKFamily"
|
3047
3048
|
|
3048
3049
|
import sys
|
akshare/news/news_baidu.py
CHANGED
@@ -1,16 +1,13 @@
|
|
1
1
|
# -*- coding:utf-8 -*-
|
2
2
|
# !/usr/bin/env python
|
3
3
|
"""
|
4
|
-
Date:
|
4
|
+
Date: 2025/3/7 20:30
|
5
5
|
Desc: 百度股市通-经济数据
|
6
6
|
https://gushitong.baidu.com/calendar
|
7
7
|
"""
|
8
8
|
|
9
|
-
import http.client
|
10
|
-
import json
|
11
|
-
from urllib.parse import urlencode
|
12
|
-
|
13
9
|
import pandas as pd
|
10
|
+
import requests
|
14
11
|
|
15
12
|
|
16
13
|
def news_economic_baidu(date: str = "20241107") -> pd.DataFrame:
|
@@ -24,7 +21,7 @@ def news_economic_baidu(date: str = "20241107") -> pd.DataFrame:
|
|
24
21
|
"""
|
25
22
|
start_date = "-".join([date[:4], date[4:6], date[6:]])
|
26
23
|
end_date = "-".join([date[:4], date[4:6], date[6:]])
|
27
|
-
|
24
|
+
url = "https://finance.pae.baidu.com/api/financecalendar"
|
28
25
|
params = {
|
29
26
|
"start_date": start_date,
|
30
27
|
"end_date": end_date,
|
@@ -32,12 +29,8 @@ def news_economic_baidu(date: str = "20241107") -> pd.DataFrame:
|
|
32
29
|
"cate": "economic_data",
|
33
30
|
"finClientType": "pc",
|
34
31
|
}
|
35
|
-
|
36
|
-
|
37
|
-
conn.request(method="GET", url=url)
|
38
|
-
r = conn.getresponse()
|
39
|
-
data = r.read()
|
40
|
-
data_json = json.loads(data)
|
32
|
+
r = requests.get(url=url, params=params)
|
33
|
+
data_json = r.json()
|
41
34
|
big_df = pd.DataFrame()
|
42
35
|
for item in data_json["Result"]:
|
43
36
|
if not item["list"] == []:
|
@@ -90,7 +83,7 @@ def news_trade_notify_suspend_baidu(date: str = "20241107") -> pd.DataFrame:
|
|
90
83
|
"""
|
91
84
|
start_date = "-".join([date[:4], date[4:6], date[6:]])
|
92
85
|
end_date = "-".join([date[:4], date[4:6], date[6:]])
|
93
|
-
|
86
|
+
url = "https://finance.pae.baidu.com/api/financecalendar"
|
94
87
|
params = {
|
95
88
|
"start_date": start_date,
|
96
89
|
"end_date": end_date,
|
@@ -98,12 +91,8 @@ def news_trade_notify_suspend_baidu(date: str = "20241107") -> pd.DataFrame:
|
|
98
91
|
"cate": "notify_suspend",
|
99
92
|
"finClientType": "pc",
|
100
93
|
}
|
101
|
-
|
102
|
-
|
103
|
-
conn.request(method="GET", url=url)
|
104
|
-
r = conn.getresponse()
|
105
|
-
data = r.read()
|
106
|
-
data_json = json.loads(data)
|
94
|
+
r = requests.get(url=url, params=params)
|
95
|
+
data_json = r.json()
|
107
96
|
big_df = pd.DataFrame()
|
108
97
|
for item in data_json["Result"]:
|
109
98
|
if not item["list"] == []:
|
@@ -151,7 +140,7 @@ def news_trade_notify_dividend_baidu(date: str = "20241107") -> pd.DataFrame:
|
|
151
140
|
"""
|
152
141
|
start_date = "-".join([date[:4], date[4:6], date[6:]])
|
153
142
|
end_date = "-".join([date[:4], date[4:6], date[6:]])
|
154
|
-
|
143
|
+
url = "https://finance.pae.baidu.com/api/financecalendar"
|
155
144
|
params = {
|
156
145
|
"start_date": start_date,
|
157
146
|
"end_date": end_date,
|
@@ -160,12 +149,8 @@ def news_trade_notify_dividend_baidu(date: str = "20241107") -> pd.DataFrame:
|
|
160
149
|
"rn": 500,
|
161
150
|
"pn": 0,
|
162
151
|
}
|
163
|
-
|
164
|
-
|
165
|
-
conn.request(method="GET", url=url)
|
166
|
-
r = conn.getresponse()
|
167
|
-
data = r.read()
|
168
|
-
data_json = json.loads(data)
|
152
|
+
r = requests.get(url=url, params=params)
|
153
|
+
data_json = r.json()
|
169
154
|
big_df = pd.DataFrame()
|
170
155
|
for item in data_json["Result"]:
|
171
156
|
if not item["list"] == []:
|
@@ -223,7 +208,7 @@ def news_report_time_baidu(date: str = "20241107") -> pd.DataFrame:
|
|
223
208
|
"""
|
224
209
|
start_date = "-".join([date[:4], date[4:6], date[6:]])
|
225
210
|
end_date = "-".join([date[:4], date[4:6], date[6:]])
|
226
|
-
|
211
|
+
url = "https://finance.pae.baidu.com/api/financecalendar"
|
227
212
|
params = {
|
228
213
|
"start_date": start_date,
|
229
214
|
"end_date": end_date,
|
@@ -231,12 +216,8 @@ def news_report_time_baidu(date: str = "20241107") -> pd.DataFrame:
|
|
231
216
|
"cate": "report_time",
|
232
217
|
"finClientType": "pc",
|
233
218
|
}
|
234
|
-
|
235
|
-
|
236
|
-
conn.request(method="GET", url=url)
|
237
|
-
r = conn.getresponse()
|
238
|
-
data = r.read()
|
239
|
-
data_json = json.loads(data)
|
219
|
+
r = requests.get(url=url, params=params)
|
220
|
+
data_json = r.json()
|
240
221
|
big_df = pd.DataFrame()
|
241
222
|
for item in data_json["Result"]:
|
242
223
|
if not item["list"] == []:
|
@@ -265,7 +246,7 @@ def news_report_time_baidu(date: str = "20241107") -> pd.DataFrame:
|
|
265
246
|
|
266
247
|
|
267
248
|
if __name__ == "__main__":
|
268
|
-
news_economic_baidu_df = news_economic_baidu(date="
|
249
|
+
news_economic_baidu_df = news_economic_baidu(date="20250307")
|
269
250
|
print(news_economic_baidu_df)
|
270
251
|
|
271
252
|
news_trade_notify_suspend_baidu_df = news_trade_notify_suspend_baidu(
|
@@ -1,4 +1,4 @@
|
|
1
|
-
akshare/__init__.py,sha256=
|
1
|
+
akshare/__init__.py,sha256=dcNGHEfoPmloF34FYwbkqeaWyqPMW0Ak39QTrXr11xw,190182
|
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
|
@@ -187,7 +187,7 @@ akshare/movie/jm.js,sha256=od-zfkhbVDzBOXP0kMR53gVsnXMxI4INZrGRsEiBSUk,117172
|
|
187
187
|
akshare/movie/movie_yien.py,sha256=BP3eGmGeTJerlIIF-sOq-TsssZiKM-DiX3vwV3dwi8o,13574
|
188
188
|
akshare/movie/video_yien.py,sha256=2JsyKTwiP4RTuDNzQR6d9V9fzMnByH2ATJFzdtPyXSQ,3524
|
189
189
|
akshare/news/__init__.py,sha256=wMQSX_sI4rN8LxN8pTxQ2m7AJDkrYykmNFKSponTt0I,83
|
190
|
-
akshare/news/news_baidu.py,sha256=
|
190
|
+
akshare/news/news_baidu.py,sha256=WjrRWkPZRdJ00o4w3M_rB8s2Yxd2OWdDRCJm8QCIOeU,8276
|
191
191
|
akshare/news/news_cctv.py,sha256=MRODE1qilypQijyCZedgC1Ctju_3ySdJlhT2nuJcuwc,7389
|
192
192
|
akshare/news/news_stock.py,sha256=m70qTKYl1gwbXZe6rCETituyOBlmjzUa8h8TaN_OBls,2896
|
193
193
|
akshare/nlp/__init__.py,sha256=F-1D7ifZQ4RiE2zsQuPc4Aj_C7RhqxGPvObcRNcLPGs,79
|
@@ -388,8 +388,8 @@ akshare/utils/token_process.py,sha256=K4rGXjh_tgugbRcyOK2h2x0jP3PT65IIK7nxhUKhOe
|
|
388
388
|
akshare/utils/tqdm.py,sha256=MuPNwcswkOGjwWQOMWXi9ZvQ_RmW4obCWRj2i7HM7FE,847
|
389
389
|
tests/__init__.py,sha256=gNzhlO0UPjFq6Ieb38kaVIODXv4cTDByrdohAZnDYt4,82
|
390
390
|
tests/test_func.py,sha256=j1MGYbZI2if2j_LY1S4FLsf4qfq4NwVqD5wmRlv5Log,832
|
391
|
-
akshare-1.16.
|
392
|
-
akshare-1.16.
|
393
|
-
akshare-1.16.
|
394
|
-
akshare-1.16.
|
395
|
-
akshare-1.16.
|
391
|
+
akshare-1.16.32.dist-info/LICENSE,sha256=mmSZCPgfHiVw34LXuFArd-SUgQtBJ_QsIlh-kWlDHfs,1073
|
392
|
+
akshare-1.16.32.dist-info/METADATA,sha256=BZYfY19c10fPWzEIbBcAFMchnzrimBdfKNW65XDE8cs,13653
|
393
|
+
akshare-1.16.32.dist-info/WHEEL,sha256=jB7zZ3N9hIM9adW7qlTAyycLYW9npaWKLRzaoVcLKcM,91
|
394
|
+
akshare-1.16.32.dist-info/top_level.txt,sha256=jsf9ZzZPmHaISTVumQPsAw7vv7Yv-PdEVW70SMEelQQ,14
|
395
|
+
akshare-1.16.32.dist-info/RECORD,,
|
File without changes
|
File without changes
|
File without changes
|