akshare 1.14.50__py3-none-any.whl → 1.14.52__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
@@ -2861,9 +2861,11 @@ amac_manager_cancelled_info # 中国证券投资基金业协会-信息公示-诚
2861
2861
  1.14.48 add: add spot_hog_year_trend_soozhu interface
2862
2862
  1.14.49 fix: fix fortune_rank interface
2863
2863
  1.14.50 add: add spot_hog_lean_price_soozhu interface
2864
+ 1.14.51 add: add stock_news_main_cx interface
2865
+ 1.14.52 fix: fix stock_esg_hz_sina interface
2864
2866
  """
2865
2867
 
2866
- __version__ = "1.14.50"
2868
+ __version__ = "1.14.52"
2867
2869
  __author__ = "AKFamily"
2868
2870
 
2869
2871
  import sys
@@ -2885,6 +2887,11 @@ if sys.version_info < (3, 9):
2885
2887
 
2886
2888
  del sys
2887
2889
 
2890
+ """
2891
+ 财新网-财新数据通
2892
+ """
2893
+ from akshare.stock.stock_news_cx import stock_news_main_cx
2894
+
2888
2895
  """
2889
2896
  搜猪-生猪大数据-各省均价实时排行榜
2890
2897
  """
@@ -0,0 +1,39 @@
1
+ #!/usr/bin/env python
2
+ # -*- coding:utf-8 -*-
3
+ """
4
+ Date: 2024/8/05 15:30
5
+ Desc: 财新网-财新数据通
6
+ https://cxdata.caixin.com/pc/
7
+ """
8
+
9
+ import pandas as pd
10
+ import requests
11
+
12
+
13
+ def stock_news_main_cx() -> pd.DataFrame:
14
+ """
15
+ 财新网-财新数据通
16
+ https://cxdata.caixin.com/pc/
17
+ :return: 特定时间表示的字典
18
+ :rtype: pandas.DataFrame
19
+ """
20
+ url = "https://cxdata.caixin.com/api/dataplus/sjtPc/jxNews"
21
+ params = {
22
+ "pageNum": "1",
23
+ "pageSize": "20000",
24
+ "showLabels": "true",
25
+ }
26
+ r = requests.get(url, params=params)
27
+ data_json = r.json()
28
+ temp_df = pd.DataFrame(data_json["data"]["data"])
29
+ temp_df = temp_df[["tag", "summary", "intervalTime", "pubTime", "url"]]
30
+ temp_df.columns = ["tag", "summary", "interval_time", "pub_time", "url"]
31
+ temp_df["pub_time"] = pd.to_datetime(
32
+ temp_df["pub_time"], errors="coerce", unit="ms"
33
+ ).astype(str)
34
+ return temp_df
35
+
36
+
37
+ if __name__ == "__main__":
38
+ stock_news_main_cx_df = stock_news_main_cx()
39
+ print(stock_news_main_cx_df)
@@ -259,10 +259,19 @@ def stock_esg_hz_sina() -> pd.DataFrame:
259
259
  :return: 华证指数
260
260
  :rtype: pandas.DataFrame
261
261
  """
262
- url = "https://global.finance.sina.com.cn/api/openapi.php/EsgService.getHzEsgStocks?p=1&num=20000"
263
- r = requests.get(url)
262
+ url = "https://global.finance.sina.com.cn/api/openapi.php/EsgService.getHzEsgStocks"
263
+ params = {"p": 1, "num": "100"}
264
+ r = requests.get(url, params=params)
264
265
  data_json = r.json()
265
- big_df = pd.DataFrame(data_json["result"]["data"]["data"])
266
+ total_page = math.ceil(int(data_json["result"]["data"]["total"]) / 100)
267
+ big_df = pd.DataFrame()
268
+ for page in tqdm(range(1, total_page + 1), leave=False):
269
+ params = {"p": str(page), "num": "100"}
270
+ r = requests.get(url, params=params)
271
+ data_json = r.json()
272
+ temp_df = pd.DataFrame(data_json["result"]["data"]["data"])
273
+ big_df = pd.concat(objs=[big_df, temp_df], ignore_index=True)
274
+
266
275
  big_df.rename(
267
276
  columns={
268
277
  "date": "日期",
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: akshare
3
- Version: 1.14.50
3
+ Version: 1.14.52
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
@@ -17,23 +17,23 @@ Classifier: Operating System :: OS Independent
17
17
  Requires-Python: >=3.8
18
18
  Description-Content-Type: text/markdown
19
19
  License-File: LICENSE
20
- Requires-Dist: beautifulsoup4 >=4.9.1
21
- Requires-Dist: lxml >=4.2.1
22
- Requires-Dist: pandas >=0.25
23
- Requires-Dist: requests >=2.22.0
24
- Requires-Dist: html5lib >=1.0.1
25
- Requires-Dist: xlrd >=1.2.0
26
- Requires-Dist: urllib3 >=1.25.8
27
- Requires-Dist: tqdm >=4.43.0
28
- Requires-Dist: openpyxl >=3.0.3
29
- Requires-Dist: jsonpath >=0.82
30
- Requires-Dist: tabulate >=0.8.6
31
- Requires-Dist: decorator >=4.4.2
32
- Requires-Dist: mini-racer >=0.12.4
20
+ Requires-Dist: beautifulsoup4>=4.9.1
21
+ Requires-Dist: lxml>=4.2.1
22
+ Requires-Dist: pandas>=0.25
23
+ Requires-Dist: requests>=2.22.0
24
+ Requires-Dist: html5lib>=1.0.1
25
+ Requires-Dist: xlrd>=1.2.0
26
+ Requires-Dist: urllib3>=1.25.8
27
+ Requires-Dist: tqdm>=4.43.0
28
+ Requires-Dist: openpyxl>=3.0.3
29
+ Requires-Dist: jsonpath>=0.82
30
+ Requires-Dist: tabulate>=0.8.6
31
+ Requires-Dist: decorator>=4.4.2
32
+ Requires-Dist: mini-racer>=0.12.4
33
33
  Provides-Extra: full
34
- Requires-Dist: akqmt ; extra == 'full'
34
+ Requires-Dist: akqmt; extra == "full"
35
35
  Provides-Extra: qmt
36
- Requires-Dist: akqmt ; extra == 'qmt'
36
+ Requires-Dist: akqmt; extra == "qmt"
37
37
 
38
38
  **欢迎加入专注于财经数据和量化投资的知识社区,请点击[了解更多](https://akshare.akfamily.xyz/learn.html)**
39
39
 
@@ -1,4 +1,4 @@
1
- akshare/__init__.py,sha256=EB-XN3cFOWPfD8DVjryY_6O60QLAzi3zjUMBIBLYZx0,180197
1
+ akshare/__init__.py,sha256=3qe39MVtN_NVChflg4zr06GbNUsHuJGPD-Xx4xSr06E,180382
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
@@ -264,6 +264,7 @@ akshare/stock/stock_intraday_em.py,sha256=r1DvqVpRMJH_Y14GmgbKXQUWYi_KFhnEvsHD0M
264
264
  akshare/stock/stock_intraday_sina.py,sha256=HMuAAO2Teu4NUrOcBvyJdxYgWx-51qJCdtcqFmFNQg8,2359
265
265
  akshare/stock/stock_ipo_summary_cninfo.py,sha256=Ma-54GsOOhRWxilLH-Qmm0VVbpJQGf2XWKaJ8NBSgAY,3847
266
266
  akshare/stock/stock_new_cninfo.py,sha256=EOuZowDLQSSHyPAwXcuPXbQkqhbz2nRBZsM7o2ZWILE,5725
267
+ akshare/stock/stock_news_cx.py,sha256=IuNo67ToW6SNT9aZVTDqQMnlLFw4QV-_FWSw-9vgfB4,1055
267
268
  akshare/stock/stock_profile_cninfo.py,sha256=tiEPnoH7IGp9DV1kMQNGIXuVOWpQFl_BS_RX_ijM4BI,3163
268
269
  akshare/stock/stock_rank_forecast.py,sha256=Qh7bwfQ_Dq8bEMuMLOzFOc_da_0n2GKr8tRFeFqTo5g,3168
269
270
  akshare/stock/stock_repurchase_em.py,sha256=XVAUD_yd48wqxbMbfU0Ne2SNFOSG9NBklUhf3pl6cKc,5000
@@ -303,7 +304,7 @@ akshare/stock_feature/stock_cyq_em.py,sha256=ijHL6BWGDLI8dctYQ4pYWDK2UHOSfn5mRu0
303
304
  akshare/stock_feature/stock_disclosure_cninfo.py,sha256=1Eje6abqk6HNOlpCueGnaR_r1-aqTv2f51h4QAHCQzo,10661
304
305
  akshare/stock_feature/stock_dxsyl_em.py,sha256=9d5tfHCB9Ls1FQdyOCElZt8YF5ltKwPa4AvnXL8u48o,18789
305
306
  akshare/stock_feature/stock_ebs_lg.py,sha256=rnFbOHnZPZUJ3K7-QdTZXqbIFazL1wSkTvn4Mpwn7bI,1750
306
- akshare/stock_feature/stock_esg_sina.py,sha256=MCTfn2uGG3GO0mUDz3Av_YBC2IUcxymbqaUTXT7kJzA,10629
307
+ akshare/stock_feature/stock_esg_sina.py,sha256=RJmeYi2YDns3Do-vydtKgJEQsLVgmmV1GVZtTXlxKqk,11029
307
308
  akshare/stock_feature/stock_fhps_em.py,sha256=85gfdMP3OtA3wsEGlB2RkdHiOEZjFff1ls5x1oWSQPQ,9469
308
309
  akshare/stock_feature/stock_fhps_ths.py,sha256=NosH1xyT1Pif4T9tchdtJTBEpe6g1Wq2kjvxJDsZD_Y,1805
309
310
  akshare/stock_feature/stock_fund_flow.py,sha256=Skc5xFICwU7dwU_oWfrFNUQkuwgRFOXlSd6tBjRdds0,18471
@@ -380,8 +381,8 @@ akshare/utils/token_process.py,sha256=K4rGXjh_tgugbRcyOK2h2x0jP3PT65IIK7nxhUKhOe
380
381
  akshare/utils/tqdm.py,sha256=MuPNwcswkOGjwWQOMWXi9ZvQ_RmW4obCWRj2i7HM7FE,847
381
382
  tests/__init__.py,sha256=gNzhlO0UPjFq6Ieb38kaVIODXv4cTDByrdohAZnDYt4,82
382
383
  tests/test_func.py,sha256=tfvy_YnYmDra2dkKZ5JvprU1gNW5X9T634PszdSdH1A,944
383
- akshare-1.14.50.dist-info/LICENSE,sha256=mmSZCPgfHiVw34LXuFArd-SUgQtBJ_QsIlh-kWlDHfs,1073
384
- akshare-1.14.50.dist-info/METADATA,sha256=W29RB_CxJjxSY2s8iFrlmq1A2G7eiXhJqW95mopNt7U,13976
385
- akshare-1.14.50.dist-info/WHEEL,sha256=R0nc6qTxuoLk7ShA2_Y-UWkN8ZdfDBG2B6Eqpz2WXbs,91
386
- akshare-1.14.50.dist-info/top_level.txt,sha256=jsf9ZzZPmHaISTVumQPsAw7vv7Yv-PdEVW70SMEelQQ,14
387
- akshare-1.14.50.dist-info/RECORD,,
384
+ akshare-1.14.52.dist-info/LICENSE,sha256=mmSZCPgfHiVw34LXuFArd-SUgQtBJ_QsIlh-kWlDHfs,1073
385
+ akshare-1.14.52.dist-info/METADATA,sha256=k0BiGMrR2L5Ezki6P1YVElq8uCbgm9L3ql1WDXY12Qk,13961
386
+ akshare-1.14.52.dist-info/WHEEL,sha256=R0nc6qTxuoLk7ShA2_Y-UWkN8ZdfDBG2B6Eqpz2WXbs,91
387
+ akshare-1.14.52.dist-info/top_level.txt,sha256=jsf9ZzZPmHaISTVumQPsAw7vv7Yv-PdEVW70SMEelQQ,14
388
+ akshare-1.14.52.dist-info/RECORD,,