akshare 1.15.16__py3-none-any.whl → 1.15.18__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/news/news_baidu.py +32 -22
- akshare/stock/stock_share_hold.py +22 -14
- {akshare-1.15.16.dist-info → akshare-1.15.18.dist-info}/METADATA +1 -1
- {akshare-1.15.16.dist-info → akshare-1.15.18.dist-info}/RECORD +8 -8
- {akshare-1.15.16.dist-info → akshare-1.15.18.dist-info}/LICENSE +0 -0
- {akshare-1.15.16.dist-info → akshare-1.15.18.dist-info}/WHEEL +0 -0
- {akshare-1.15.16.dist-info → akshare-1.15.18.dist-info}/top_level.txt +0 -0
akshare/__init__.py
CHANGED
|
@@ -2926,9 +2926,11 @@ amac_manager_cancelled_info # 中国证券投资基金业协会-信息公示-诚
|
|
|
2926
2926
|
1.15.14 fix: fix macro_bank_usa_interest_rate indicator
|
|
2927
2927
|
1.15.15 add: add macro_bank_china_interest_rate indicator
|
|
2928
2928
|
1.15.16 fix: fix macro_bank_usa_interest_rate indicator
|
|
2929
|
+
1.15.17 fix: fix news_trade_notify_dividend_baidu indicator
|
|
2930
|
+
1.15.18 fix: fix stock_share_hold_change_sse indicator
|
|
2929
2931
|
"""
|
|
2930
2932
|
|
|
2931
|
-
__version__ = "1.15.
|
|
2933
|
+
__version__ = "1.15.18"
|
|
2932
2934
|
__author__ = "AKFamily"
|
|
2933
2935
|
|
|
2934
2936
|
import sys
|
akshare/news/news_baidu.py
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
# -*- coding:utf-8 -*-
|
|
2
2
|
# !/usr/bin/env python
|
|
3
3
|
"""
|
|
4
|
-
Date: 2024/
|
|
4
|
+
Date: 2024/11/07 17:00
|
|
5
5
|
Desc: 百度股市通-经济数据
|
|
6
6
|
https://gushitong.baidu.com/calendar
|
|
7
7
|
"""
|
|
@@ -11,10 +11,9 @@ import json
|
|
|
11
11
|
from urllib.parse import urlencode
|
|
12
12
|
|
|
13
13
|
import pandas as pd
|
|
14
|
-
import requests
|
|
15
14
|
|
|
16
15
|
|
|
17
|
-
def news_economic_baidu(date: str = "
|
|
16
|
+
def news_economic_baidu(date: str = "20241107") -> pd.DataFrame:
|
|
18
17
|
"""
|
|
19
18
|
百度股市通-经济数据
|
|
20
19
|
https://gushitong.baidu.com/calendar
|
|
@@ -25,18 +24,20 @@ def news_economic_baidu(date: str = "20240327") -> pd.DataFrame:
|
|
|
25
24
|
"""
|
|
26
25
|
start_date = "-".join([date[:4], date[4:6], date[6:]])
|
|
27
26
|
end_date = "-".join([date[:4], date[4:6], date[6:]])
|
|
28
|
-
|
|
27
|
+
conn = http.client.HTTPSConnection("finance.pae.baidu.com")
|
|
29
28
|
params = {
|
|
30
29
|
"start_date": start_date,
|
|
31
30
|
"end_date": end_date,
|
|
32
31
|
"market": "",
|
|
33
32
|
"cate": "economic_data",
|
|
34
|
-
# "rn": "500",
|
|
35
|
-
# "pn": "0",
|
|
36
33
|
"finClientType": "pc",
|
|
37
34
|
}
|
|
38
|
-
|
|
39
|
-
|
|
35
|
+
query_string = urlencode(params)
|
|
36
|
+
url = "/api/financecalendar" + "?" + query_string
|
|
37
|
+
conn.request(method="GET", url=url)
|
|
38
|
+
r = conn.getresponse()
|
|
39
|
+
data = r.read()
|
|
40
|
+
data_json = json.loads(data)
|
|
40
41
|
big_df = pd.DataFrame()
|
|
41
42
|
for item in data_json["Result"]:
|
|
42
43
|
if not item["list"] == []:
|
|
@@ -72,13 +73,13 @@ def news_economic_baidu(date: str = "20240327") -> pd.DataFrame:
|
|
|
72
73
|
temp_df["前值"] = pd.to_numeric(temp_df["前值"], errors="coerce")
|
|
73
74
|
temp_df["重要性"] = pd.to_numeric(temp_df["重要性"], errors="coerce")
|
|
74
75
|
temp_df["日期"] = pd.to_datetime(temp_df["日期"], errors="coerce").dt.date
|
|
75
|
-
big_df = pd.concat([big_df, temp_df], ignore_index=True)
|
|
76
|
+
big_df = pd.concat(objs=[big_df, temp_df], ignore_index=True)
|
|
76
77
|
else:
|
|
77
78
|
continue
|
|
78
79
|
return big_df
|
|
79
80
|
|
|
80
81
|
|
|
81
|
-
def news_trade_notify_suspend_baidu(date: str = "
|
|
82
|
+
def news_trade_notify_suspend_baidu(date: str = "20241107") -> pd.DataFrame:
|
|
82
83
|
"""
|
|
83
84
|
百度股市通-交易提醒-停复牌
|
|
84
85
|
https://gushitong.baidu.com/calendar
|
|
@@ -89,15 +90,20 @@ def news_trade_notify_suspend_baidu(date: str = "20220513") -> pd.DataFrame:
|
|
|
89
90
|
"""
|
|
90
91
|
start_date = "-".join([date[:4], date[4:6], date[6:]])
|
|
91
92
|
end_date = "-".join([date[:4], date[4:6], date[6:]])
|
|
92
|
-
|
|
93
|
+
conn = http.client.HTTPSConnection("finance.pae.baidu.com")
|
|
93
94
|
params = {
|
|
94
95
|
"start_date": start_date,
|
|
95
96
|
"end_date": end_date,
|
|
96
97
|
"market": "",
|
|
97
98
|
"cate": "notify_suspend",
|
|
99
|
+
"finClientType": "pc",
|
|
98
100
|
}
|
|
99
|
-
|
|
100
|
-
|
|
101
|
+
query_string = urlencode(params)
|
|
102
|
+
url = "/api/financecalendar" + "?" + query_string
|
|
103
|
+
conn.request(method="GET", url=url)
|
|
104
|
+
r = conn.getresponse()
|
|
105
|
+
data = r.read()
|
|
106
|
+
data_json = json.loads(data)
|
|
101
107
|
big_df = pd.DataFrame()
|
|
102
108
|
for item in data_json["Result"]:
|
|
103
109
|
if not item["list"] == []:
|
|
@@ -134,7 +140,7 @@ def news_trade_notify_suspend_baidu(date: str = "20220513") -> pd.DataFrame:
|
|
|
134
140
|
return big_df
|
|
135
141
|
|
|
136
142
|
|
|
137
|
-
def news_trade_notify_dividend_baidu(date: str = "
|
|
143
|
+
def news_trade_notify_dividend_baidu(date: str = "20241107") -> pd.DataFrame:
|
|
138
144
|
"""
|
|
139
145
|
百度股市通-交易提醒-分红派息
|
|
140
146
|
https://gushitong.baidu.com/calendar
|
|
@@ -206,7 +212,7 @@ def news_trade_notify_dividend_baidu(date: str = "20240621") -> pd.DataFrame:
|
|
|
206
212
|
return big_df
|
|
207
213
|
|
|
208
214
|
|
|
209
|
-
def news_report_time_baidu(date: str = "
|
|
215
|
+
def news_report_time_baidu(date: str = "20241107") -> pd.DataFrame:
|
|
210
216
|
"""
|
|
211
217
|
百度股市通-财报发行
|
|
212
218
|
https://gushitong.baidu.com/calendar
|
|
@@ -217,7 +223,7 @@ def news_report_time_baidu(date: str = "20220514") -> pd.DataFrame:
|
|
|
217
223
|
"""
|
|
218
224
|
start_date = "-".join([date[:4], date[4:6], date[6:]])
|
|
219
225
|
end_date = "-".join([date[:4], date[4:6], date[6:]])
|
|
220
|
-
|
|
226
|
+
conn = http.client.HTTPSConnection("finance.pae.baidu.com")
|
|
221
227
|
params = {
|
|
222
228
|
"start_date": start_date,
|
|
223
229
|
"end_date": end_date,
|
|
@@ -225,8 +231,12 @@ def news_report_time_baidu(date: str = "20220514") -> pd.DataFrame:
|
|
|
225
231
|
"cate": "report_time",
|
|
226
232
|
"finClientType": "pc",
|
|
227
233
|
}
|
|
228
|
-
|
|
229
|
-
|
|
234
|
+
query_string = urlencode(params)
|
|
235
|
+
url = "/api/financecalendar" + "?" + query_string
|
|
236
|
+
conn.request(method="GET", url=url)
|
|
237
|
+
r = conn.getresponse()
|
|
238
|
+
data = r.read()
|
|
239
|
+
data_json = json.loads(data)
|
|
230
240
|
big_df = pd.DataFrame()
|
|
231
241
|
for item in data_json["Result"]:
|
|
232
242
|
if not item["list"] == []:
|
|
@@ -255,18 +265,18 @@ def news_report_time_baidu(date: str = "20220514") -> pd.DataFrame:
|
|
|
255
265
|
|
|
256
266
|
|
|
257
267
|
if __name__ == "__main__":
|
|
258
|
-
news_economic_baidu_df = news_economic_baidu(date="
|
|
268
|
+
news_economic_baidu_df = news_economic_baidu(date="20241107")
|
|
259
269
|
print(news_economic_baidu_df)
|
|
260
270
|
|
|
261
271
|
news_trade_notify_suspend_baidu_df = news_trade_notify_suspend_baidu(
|
|
262
|
-
date="
|
|
272
|
+
date="20241107"
|
|
263
273
|
)
|
|
264
274
|
print(news_trade_notify_suspend_baidu_df)
|
|
265
275
|
|
|
266
276
|
news_trade_notify_dividend_baidu_df = news_trade_notify_dividend_baidu(
|
|
267
|
-
date="
|
|
277
|
+
date="20241107"
|
|
268
278
|
)
|
|
269
279
|
print(news_trade_notify_dividend_baidu_df)
|
|
270
280
|
|
|
271
|
-
news_report_time_baidu_df = news_report_time_baidu(date="
|
|
281
|
+
news_report_time_baidu_df = news_report_time_baidu(date="20241107")
|
|
272
282
|
print(news_report_time_baidu_df)
|
|
@@ -1,18 +1,19 @@
|
|
|
1
1
|
#!/usr/bin/env python
|
|
2
2
|
# -*- coding:utf-8 -*-
|
|
3
3
|
"""
|
|
4
|
-
Date:
|
|
4
|
+
Date: 2024/11/8 17:00
|
|
5
5
|
Desc: 董监高及相关人员持股变动
|
|
6
6
|
|
|
7
7
|
北京证券交易所-信息披露-监管信息-董监高及相关人员持股变动
|
|
8
8
|
https://www.bse.cn/disclosure/djg_sharehold_change.html
|
|
9
9
|
|
|
10
10
|
深圳证券交易所-信息披露-监管信息公开-董监高人员股份变动
|
|
11
|
-
|
|
11
|
+
https://www.szse.cn/disclosure/supervision/change/index.html
|
|
12
12
|
|
|
13
13
|
上海证券交易所-披露-监管信息公开-公司监管-董董监高人员股份变动
|
|
14
|
-
|
|
14
|
+
https://www.sse.com.cn/disclosure/credibility/supervision/change/
|
|
15
15
|
"""
|
|
16
|
+
|
|
16
17
|
import json
|
|
17
18
|
|
|
18
19
|
import pandas as pd
|
|
@@ -23,13 +24,13 @@ from tqdm import tqdm
|
|
|
23
24
|
def stock_share_hold_change_sse(symbol: str = "600000") -> pd.DataFrame:
|
|
24
25
|
"""
|
|
25
26
|
上海证券交易所-披露-监管信息公开-公司监管-董董监高人员股份变动
|
|
26
|
-
|
|
27
|
+
https://www.sse.com.cn/disclosure/credibility/supervision/change/
|
|
27
28
|
:param symbol: choice of {"全部", "具体股票代码"}
|
|
28
29
|
:type symbol: str
|
|
29
30
|
:return: 董监高人员股份变动
|
|
30
31
|
:rtype: pandas.DataFrame
|
|
31
32
|
"""
|
|
32
|
-
url = "
|
|
33
|
+
url = "https://query.sse.com.cn/commonQuery.do"
|
|
33
34
|
params = {
|
|
34
35
|
"isPagination": "true",
|
|
35
36
|
"pageHelp.pageSize": "100",
|
|
@@ -48,8 +49,9 @@ def stock_share_hold_change_sse(symbol: str = "600000") -> pd.DataFrame:
|
|
|
48
49
|
params if symbol == "全部" else params.update({"COMPANY_CODE": symbol})
|
|
49
50
|
headers = {
|
|
50
51
|
"Host": "query.sse.com.cn",
|
|
51
|
-
"Referer": "
|
|
52
|
-
"User-Agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko)
|
|
52
|
+
"Referer": "https://www.sse.com.cn/",
|
|
53
|
+
"User-Agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) "
|
|
54
|
+
"Chrome/93.0.4577.63 Safari/537.36",
|
|
53
55
|
}
|
|
54
56
|
r = requests.get(url, headers=headers, params=params)
|
|
55
57
|
data_json = r.json()
|
|
@@ -106,9 +108,13 @@ def stock_share_hold_change_sse(symbol: str = "600000") -> pd.DataFrame:
|
|
|
106
108
|
big_df["变动日期"] = pd.to_datetime(big_df["变动日期"], errors="coerce").dt.date
|
|
107
109
|
big_df["填报日期"] = pd.to_datetime(big_df["填报日期"], errors="coerce").dt.date
|
|
108
110
|
|
|
109
|
-
big_df["本次变动前持股数"] = pd.to_numeric(
|
|
111
|
+
big_df["本次变动前持股数"] = pd.to_numeric(
|
|
112
|
+
big_df["本次变动前持股数"], errors="coerce"
|
|
113
|
+
)
|
|
110
114
|
big_df["变动数"] = pd.to_numeric(big_df["变动数"], errors="coerce")
|
|
111
|
-
big_df["本次变动平均价格"] = pd.to_numeric(
|
|
115
|
+
big_df["本次变动平均价格"] = pd.to_numeric(
|
|
116
|
+
big_df["本次变动平均价格"], errors="coerce"
|
|
117
|
+
)
|
|
112
118
|
big_df["变动后持股数"] = pd.to_numeric(big_df["变动后持股数"], errors="coerce")
|
|
113
119
|
return big_df
|
|
114
120
|
|
|
@@ -116,7 +122,7 @@ def stock_share_hold_change_sse(symbol: str = "600000") -> pd.DataFrame:
|
|
|
116
122
|
def stock_share_hold_change_szse(symbol: str = "全部") -> pd.DataFrame:
|
|
117
123
|
"""
|
|
118
124
|
深圳证券交易所-信息披露-监管信息公开-董监高人员股份变动
|
|
119
|
-
|
|
125
|
+
https://www.szse.cn/disclosure/supervision/change/index.html
|
|
120
126
|
:param symbol: choice of {"全部", "具体股票代码"}
|
|
121
127
|
:type symbol: str
|
|
122
128
|
:return: 董监高人员股份变动
|
|
@@ -130,15 +136,16 @@ def stock_share_hold_change_szse(symbol: str = "全部") -> pd.DataFrame:
|
|
|
130
136
|
"random": "0.7874198771222201",
|
|
131
137
|
}
|
|
132
138
|
params if symbol == "全部" else params.update({"txtDMorJC": symbol})
|
|
133
|
-
url = "
|
|
139
|
+
url = "https://www.szse.cn/api/report/ShowReport/data"
|
|
134
140
|
headers = {
|
|
135
|
-
"User-Agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko)
|
|
141
|
+
"User-Agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) "
|
|
142
|
+
"Chrome/93.0.4577.63 Safari/537.36",
|
|
136
143
|
}
|
|
137
144
|
r = requests.get(url, headers=headers, params=params)
|
|
138
145
|
data_json = r.json()
|
|
139
146
|
total_page = data_json[0]["metadata"]["pagecount"]
|
|
140
147
|
big_df = pd.DataFrame()
|
|
141
|
-
for page in tqdm(range(1, total_page+1), leave=False):
|
|
148
|
+
for page in tqdm(range(1, total_page + 1), leave=False):
|
|
142
149
|
params.update(
|
|
143
150
|
{
|
|
144
151
|
"PAGENO": page,
|
|
@@ -212,7 +219,8 @@ def stock_share_hold_change_bse(symbol: str = "430489") -> pd.DataFrame:
|
|
|
212
219
|
}
|
|
213
220
|
url = "https://www.bse.cn/djgCgbdController/getDjgCgbdList.do"
|
|
214
221
|
headers = {
|
|
215
|
-
"User-Agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko)
|
|
222
|
+
"User-Agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) "
|
|
223
|
+
"Chrome/93.0.4577.63 Safari/537.36",
|
|
216
224
|
}
|
|
217
225
|
r = requests.get(url, headers=headers, params=params)
|
|
218
226
|
data_text = r.text
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
akshare/__init__.py,sha256=
|
|
1
|
+
akshare/__init__.py,sha256=08otwDA6vfJZScOIapZlnwi-49xA9GI_c4T06nL6wnk,183593
|
|
2
2
|
akshare/datasets.py,sha256=-qdwaQjgBlftX84uM74KJqCYJYkQ50PV416_neA4uls,995
|
|
3
3
|
akshare/exceptions.py,sha256=WEJjIhSmJ_xXNW6grwV4nufE_cfmmyuhmueVGiN1VAg,878
|
|
4
4
|
akshare/request.py,sha256=HtFFf9MhfEibR-ETWe-1Tts6ELU4VKSqA-ghaXjegQM,4252
|
|
@@ -186,7 +186,7 @@ akshare/movie/jm.js,sha256=od-zfkhbVDzBOXP0kMR53gVsnXMxI4INZrGRsEiBSUk,117172
|
|
|
186
186
|
akshare/movie/movie_yien.py,sha256=BP3eGmGeTJerlIIF-sOq-TsssZiKM-DiX3vwV3dwi8o,13574
|
|
187
187
|
akshare/movie/video_yien.py,sha256=2JsyKTwiP4RTuDNzQR6d9V9fzMnByH2ATJFzdtPyXSQ,3524
|
|
188
188
|
akshare/news/__init__.py,sha256=wMQSX_sI4rN8LxN8pTxQ2m7AJDkrYykmNFKSponTt0I,83
|
|
189
|
-
akshare/news/news_baidu.py,sha256=
|
|
189
|
+
akshare/news/news_baidu.py,sha256=yPp7xgZUOUmIi05nLemIWYv4QDv6f5WK5VX8cJdVR0k,8901
|
|
190
190
|
akshare/news/news_cctv.py,sha256=MRODE1qilypQijyCZedgC1Ctju_3ySdJlhT2nuJcuwc,7389
|
|
191
191
|
akshare/news/news_stock.py,sha256=m70qTKYl1gwbXZe6rCETituyOBlmjzUa8h8TaN_OBls,2896
|
|
192
192
|
akshare/nlp/__init__.py,sha256=F-1D7ifZQ4RiE2zsQuPc4Aj_C7RhqxGPvObcRNcLPGs,79
|
|
@@ -270,7 +270,7 @@ akshare/stock/stock_profile_cninfo.py,sha256=UgUH3GK52Xl25s3WIXlFmVTlKzDd6QGiTTj
|
|
|
270
270
|
akshare/stock/stock_rank_forecast.py,sha256=5U0fa4tzhqKrw5kDRahUCFSrbrEx_aRtlqZq2mpeJaU,3199
|
|
271
271
|
akshare/stock/stock_repurchase_em.py,sha256=XVAUD_yd48wqxbMbfU0Ne2SNFOSG9NBklUhf3pl6cKc,5000
|
|
272
272
|
akshare/stock/stock_share_changes_cninfo.py,sha256=siy4PiZgYuNQn5jUUg2G7CyZ_yvuXNi3MVUDFhe5npY,4923
|
|
273
|
-
akshare/stock/stock_share_hold.py,sha256=
|
|
273
|
+
akshare/stock/stock_share_hold.py,sha256=O4y63hh7s6WpAiIDjPxzHtYSP_WzBvV21TRzFVgtLZM,11031
|
|
274
274
|
akshare/stock/stock_stop.py,sha256=8HyazJAFj-s12ujUtrxO8VPXyA5bF9-3eNEj0qzGwMg,1185
|
|
275
275
|
akshare/stock/stock_summary.py,sha256=tfyTgc-a_VZV6K4uMcTKySDkrBPQOvCTB0th7tpUCRc,22839
|
|
276
276
|
akshare/stock/stock_us_famous.py,sha256=enx_-EzEJWAhrMVQZaN83ETY_YEWO2xEStRm6z3upO0,3655
|
|
@@ -383,8 +383,8 @@ akshare/utils/token_process.py,sha256=K4rGXjh_tgugbRcyOK2h2x0jP3PT65IIK7nxhUKhOe
|
|
|
383
383
|
akshare/utils/tqdm.py,sha256=MuPNwcswkOGjwWQOMWXi9ZvQ_RmW4obCWRj2i7HM7FE,847
|
|
384
384
|
tests/__init__.py,sha256=gNzhlO0UPjFq6Ieb38kaVIODXv4cTDByrdohAZnDYt4,82
|
|
385
385
|
tests/test_func.py,sha256=j1MGYbZI2if2j_LY1S4FLsf4qfq4NwVqD5wmRlv5Log,832
|
|
386
|
-
akshare-1.15.
|
|
387
|
-
akshare-1.15.
|
|
388
|
-
akshare-1.15.
|
|
389
|
-
akshare-1.15.
|
|
390
|
-
akshare-1.15.
|
|
386
|
+
akshare-1.15.18.dist-info/LICENSE,sha256=mmSZCPgfHiVw34LXuFArd-SUgQtBJ_QsIlh-kWlDHfs,1073
|
|
387
|
+
akshare-1.15.18.dist-info/METADATA,sha256=ekGCYiivJCuZOS2YlXk2M-QSAOqUEPT1QC4ijS3aa44,14244
|
|
388
|
+
akshare-1.15.18.dist-info/WHEEL,sha256=P9jw-gEje8ByB7_hXoICnHtVCrEwMQh-630tKvQWehc,91
|
|
389
|
+
akshare-1.15.18.dist-info/top_level.txt,sha256=jsf9ZzZPmHaISTVumQPsAw7vv7Yv-PdEVW70SMEelQQ,14
|
|
390
|
+
akshare-1.15.18.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|
|
File without changes
|