akshare 1.14.51__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
@@ -2862,9 +2862,10 @@ amac_manager_cancelled_info # 中国证券投资基金业协会-信息公示-诚
2862
2862
  1.14.49 fix: fix fortune_rank interface
2863
2863
  1.14.50 add: add spot_hog_lean_price_soozhu interface
2864
2864
  1.14.51 add: add stock_news_main_cx interface
2865
+ 1.14.52 fix: fix stock_esg_hz_sina interface
2865
2866
  """
2866
2867
 
2867
- __version__ = "1.14.51"
2868
+ __version__ = "1.14.52"
2868
2869
  __author__ = "AKFamily"
2869
2870
 
2870
2871
  import sys
@@ -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.51
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
@@ -1,4 +1,4 @@
1
- akshare/__init__.py,sha256=Q7TgPYHEt0Xnq6Ebf4fK-ksy-3W2wt8U5G61G8uOH6Q,180337
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
@@ -304,7 +304,7 @@ akshare/stock_feature/stock_cyq_em.py,sha256=ijHL6BWGDLI8dctYQ4pYWDK2UHOSfn5mRu0
304
304
  akshare/stock_feature/stock_disclosure_cninfo.py,sha256=1Eje6abqk6HNOlpCueGnaR_r1-aqTv2f51h4QAHCQzo,10661
305
305
  akshare/stock_feature/stock_dxsyl_em.py,sha256=9d5tfHCB9Ls1FQdyOCElZt8YF5ltKwPa4AvnXL8u48o,18789
306
306
  akshare/stock_feature/stock_ebs_lg.py,sha256=rnFbOHnZPZUJ3K7-QdTZXqbIFazL1wSkTvn4Mpwn7bI,1750
307
- akshare/stock_feature/stock_esg_sina.py,sha256=MCTfn2uGG3GO0mUDz3Av_YBC2IUcxymbqaUTXT7kJzA,10629
307
+ akshare/stock_feature/stock_esg_sina.py,sha256=RJmeYi2YDns3Do-vydtKgJEQsLVgmmV1GVZtTXlxKqk,11029
308
308
  akshare/stock_feature/stock_fhps_em.py,sha256=85gfdMP3OtA3wsEGlB2RkdHiOEZjFff1ls5x1oWSQPQ,9469
309
309
  akshare/stock_feature/stock_fhps_ths.py,sha256=NosH1xyT1Pif4T9tchdtJTBEpe6g1Wq2kjvxJDsZD_Y,1805
310
310
  akshare/stock_feature/stock_fund_flow.py,sha256=Skc5xFICwU7dwU_oWfrFNUQkuwgRFOXlSd6tBjRdds0,18471
@@ -381,8 +381,8 @@ akshare/utils/token_process.py,sha256=K4rGXjh_tgugbRcyOK2h2x0jP3PT65IIK7nxhUKhOe
381
381
  akshare/utils/tqdm.py,sha256=MuPNwcswkOGjwWQOMWXi9ZvQ_RmW4obCWRj2i7HM7FE,847
382
382
  tests/__init__.py,sha256=gNzhlO0UPjFq6Ieb38kaVIODXv4cTDByrdohAZnDYt4,82
383
383
  tests/test_func.py,sha256=tfvy_YnYmDra2dkKZ5JvprU1gNW5X9T634PszdSdH1A,944
384
- akshare-1.14.51.dist-info/LICENSE,sha256=mmSZCPgfHiVw34LXuFArd-SUgQtBJ_QsIlh-kWlDHfs,1073
385
- akshare-1.14.51.dist-info/METADATA,sha256=I5XC3dXiGYVmOChTN-0yYGV6A0JWytJuYHKzPQNusRQ,13961
386
- akshare-1.14.51.dist-info/WHEEL,sha256=R0nc6qTxuoLk7ShA2_Y-UWkN8ZdfDBG2B6Eqpz2WXbs,91
387
- akshare-1.14.51.dist-info/top_level.txt,sha256=jsf9ZzZPmHaISTVumQPsAw7vv7Yv-PdEVW70SMEelQQ,14
388
- akshare-1.14.51.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,,