akshare 1.15.16__py3-none-any.whl → 1.15.17__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 CHANGED
@@ -2926,9 +2926,10 @@ 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
2929
2930
  """
2930
2931
 
2931
- __version__ = "1.15.16"
2932
+ __version__ = "1.15.17"
2932
2933
  __author__ = "AKFamily"
2933
2934
 
2934
2935
  import sys
@@ -1,7 +1,7 @@
1
1
  # -*- coding:utf-8 -*-
2
2
  # !/usr/bin/env python
3
3
  """
4
- Date: 2024/3/27 10:00
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 = "20240327") -> pd.DataFrame:
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
- url = "https://finance.pae.baidu.com/api/financecalendar"
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
- r = requests.get(url, params=params)
39
- data_json = r.json()
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 = "20220513") -> pd.DataFrame:
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
- url = "https://finance.pae.baidu.com/api/financecalendar"
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
- r = requests.get(url, params=params)
100
- data_json = r.json()
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 = "20240621") -> pd.DataFrame:
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 = "20220514") -> pd.DataFrame:
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
- url = "https://finance.pae.baidu.com/api/financecalendar"
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
- r = requests.get(url, params=params)
229
- data_json = r.json()
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="20240326")
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="20240327"
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="20240621"
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="20240326")
281
+ news_report_time_baidu_df = news_report_time_baidu(date="20241107")
272
282
  print(news_report_time_baidu_df)
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: akshare
3
- Version: 1.15.16
3
+ Version: 1.15.17
4
4
  Summary: AKShare is an elegant and simple financial data interface library for Python, built for human beings!
5
5
  Home-page: https://github.com/akfamily/akshare
6
6
  Author: AKFamily
@@ -1,4 +1,4 @@
1
- akshare/__init__.py,sha256=T-NxPIS3nWRW0tlhh-94-FUPh8xg8QF8n5Ckidrwq0U,183478
1
+ akshare/__init__.py,sha256=Vg3AVCVcr8PMTFomK2-6n50H20DkgEQqNU6bHlMrsxk,183538
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=ZQWi55nuLdi6TUuQv78SSagBo82I0oRC9IeWxVqewOQ,8483
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
@@ -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.16.dist-info/LICENSE,sha256=mmSZCPgfHiVw34LXuFArd-SUgQtBJ_QsIlh-kWlDHfs,1073
387
- akshare-1.15.16.dist-info/METADATA,sha256=-5IJphK-JcsDaJNl0fe3EfHxn_ay-TX6oW1M6FMalfA,14244
388
- akshare-1.15.16.dist-info/WHEEL,sha256=P9jw-gEje8ByB7_hXoICnHtVCrEwMQh-630tKvQWehc,91
389
- akshare-1.15.16.dist-info/top_level.txt,sha256=jsf9ZzZPmHaISTVumQPsAw7vv7Yv-PdEVW70SMEelQQ,14
390
- akshare-1.15.16.dist-info/RECORD,,
386
+ akshare-1.15.17.dist-info/LICENSE,sha256=mmSZCPgfHiVw34LXuFArd-SUgQtBJ_QsIlh-kWlDHfs,1073
387
+ akshare-1.15.17.dist-info/METADATA,sha256=hh_CnY0zoFmceLr2CPETNZ4vfqobC_BtbrVoFq1_K9o,14244
388
+ akshare-1.15.17.dist-info/WHEEL,sha256=P9jw-gEje8ByB7_hXoICnHtVCrEwMQh-630tKvQWehc,91
389
+ akshare-1.15.17.dist-info/top_level.txt,sha256=jsf9ZzZPmHaISTVumQPsAw7vv7Yv-PdEVW70SMEelQQ,14
390
+ akshare-1.15.17.dist-info/RECORD,,