akshare 1.14.49__py3-none-any.whl → 1.14.51__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 CHANGED
@@ -2860,9 +2860,11 @@ amac_manager_cancelled_info # 中国证券投资基金业协会-信息公示-诚
2860
2860
  1.14.47 fix: fix spot_hog_soozhu interface
2861
2861
  1.14.48 add: add spot_hog_year_trend_soozhu interface
2862
2862
  1.14.49 fix: fix fortune_rank interface
2863
+ 1.14.50 add: add spot_hog_lean_price_soozhu interface
2864
+ 1.14.51 add: add stock_news_main_cx interface
2863
2865
  """
2864
2866
 
2865
- __version__ = "1.14.49"
2867
+ __version__ = "1.14.51"
2866
2868
  __author__ = "AKFamily"
2867
2869
 
2868
2870
  import sys
@@ -2884,10 +2886,15 @@ if sys.version_info < (3, 9):
2884
2886
 
2885
2887
  del sys
2886
2888
 
2889
+ """
2890
+ 财新网-财新数据通
2891
+ """
2892
+ from akshare.stock.stock_news_cx import stock_news_main_cx
2893
+
2887
2894
  """
2888
2895
  搜猪-生猪大数据-各省均价实时排行榜
2889
2896
  """
2890
- from akshare.spot.spot_hog_soozhu import spot_hog_soozhu, spot_hog_year_trend_soozhu
2897
+ from akshare.spot.spot_hog_soozhu import spot_hog_soozhu, spot_hog_year_trend_soozhu, spot_hog_lean_price_soozhu
2891
2898
 
2892
2899
  """
2893
2900
  知名港股
@@ -4885,11 +4892,6 @@ from akshare.fund.fund_amac import (
4885
4892
  amac_person_bond_org_list,
4886
4893
  )
4887
4894
 
4888
- """
4889
- 世界五百强公司排名接口
4890
- """
4891
- from akshare.fortune.fortune_500 import fortune_rank, fortune_rank_eng
4892
-
4893
4895
  """
4894
4896
  申万行业一级
4895
4897
  """
@@ -1,14 +1,13 @@
1
1
  #!/usr/bin/env python
2
2
  # -*- coding:utf-8 -*-
3
3
  """
4
- Date: 2024/3/11 17:22
4
+ Date: 2024/8/4 17:22
5
5
  Desc: 历年世界 500 强榜单数据
6
6
  https://www.fortunechina.com/fortune500/index.htm
7
7
  特殊情况说明:
8
8
  2010年由于网页端没有公布公司所属的国家, 故 2010 年数据没有国家这列
9
9
  """
10
10
 
11
- import json
12
11
  from functools import lru_cache
13
12
  from io import StringIO
14
13
 
@@ -69,42 +68,7 @@ def fortune_rank(year: str = "2015") -> pd.DataFrame:
69
68
  return df
70
69
 
71
70
 
72
- def fortune_rank_eng(year: str = "2023") -> pd.DataFrame:
73
- """
74
- 注意你的网速
75
- https://fortune.com/ranking/global500/
76
- https://fortune.com/global500/2012/search/
77
- :param year: "1995"
78
- :type year: str
79
- :return: 历年排名
80
- :rtype: pandas.DataFrame
81
- """
82
- url = f"https://fortune.com/ranking/global500/{year}/search/"
83
- r = requests.get(url)
84
- soup = BeautifulSoup(r.text, features="lxml")
85
- code = json.loads(
86
- soup.find(name="script", attrs={"type": "application/ld+json"}).string
87
- )["identifier"]
88
- url = "https://content.fortune.com/wp-json/irving/v1/data/franchise-search-results"
89
- params = {
90
- "list_id": code,
91
- "token": "Zm9ydHVuZTpCcHNyZmtNZCN5SndjWkkhNHFqMndEOTM=",
92
- }
93
- r = requests.get(url, params=params)
94
- big_df = pd.DataFrame()
95
- for i in range(len(r.json()[1]["items"][0]["fields"])):
96
- temp_df = pd.DataFrame([item["fields"][i] for item in r.json()[1]["items"]])
97
- big_df[temp_df["key"].values[0]] = temp_df["value"]
98
- big_df["rank"] = big_df["rank"].astype(int)
99
- big_df.sort_values(by="rank", inplace=True)
100
- big_df.reset_index(drop=True, inplace=True)
101
- return big_df
102
-
103
-
104
71
  if __name__ == "__main__":
105
- fortune_rank_eng_df = fortune_rank_eng(year="2022")
106
- print(fortune_rank_eng_df)
107
-
108
72
  fortune_rank_df = fortune_rank(year="2023") # 2010 不一样
109
73
  print(fortune_rank_df)
110
74
 
@@ -62,9 +62,36 @@ def spot_hog_year_trend_soozhu() -> pd.DataFrame:
62
62
  return temp_df
63
63
 
64
64
 
65
+ def spot_hog_lean_price_soozhu() -> pd.DataFrame:
66
+ """
67
+ 搜猪-生猪大数据-全国瘦肉型肉猪
68
+ https://www.soozhu.com/price/data/center/
69
+ :return: 全国瘦肉型肉猪
70
+ :rtype: pd.DataFrame
71
+ """
72
+ session = requests.session()
73
+ url = "https://www.soozhu.com/price/data/center/"
74
+ r = session.get(url)
75
+ soup = BeautifulSoup(r.text, features="lxml")
76
+ token = soup.find(name="input", attrs={"name": "csrfmiddlewaretoken"})["value"]
77
+ url = "https://www.soozhu.com/price/data/center/"
78
+ payload = {"act": "pricetrend", "indid": "", "csrfmiddlewaretoken": token}
79
+ r = session.post(url, data=payload)
80
+ data_json = r.json()
81
+ temp_df = pd.DataFrame(data_json["datalist"])
82
+ temp_df.columns = ["日期", "价格"]
83
+ temp_df["日期"] = pd.to_datetime(temp_df["日期"], errors="coerce").dt.date
84
+ temp_df["价格"] = pd.to_numeric(temp_df["价格"], errors="coerce")
85
+ temp_df.sort_values(by=["日期"], ignore_index=True, inplace=True)
86
+ return temp_df
87
+
88
+
65
89
  if __name__ == "__main__":
66
90
  spot_hog_soozhu_df = spot_hog_soozhu()
67
91
  print(spot_hog_soozhu_df)
68
92
 
69
93
  spot_hog_year_trend_soozhu_df = spot_hog_year_trend_soozhu()
70
94
  print(spot_hog_year_trend_soozhu_df)
95
+
96
+ spot_hog_lean_price_soozhu_df = spot_hog_lean_price_soozhu()
97
+ print(spot_hog_lean_price_soozhu_df)
@@ -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)
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: akshare
3
- Version: 1.14.49
3
+ Version: 1.14.51
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=pEmZLvGV4WCO1j-1Zxi6NeOAG2U-z5g8Rxbq2oxaRv4,180229
1
+ akshare/__init__.py,sha256=Q7TgPYHEt0Xnq6Ebf4fK-ksy-3W2wt8U5G61G8uOH6Q,180337
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
@@ -75,7 +75,7 @@ akshare/event/migration.py,sha256=2lR3D_XHRlOKiarBSbjQVEIm3Spj5hbZIwDOvcyKsEU,37
75
75
  akshare/file_fold/__init__.py,sha256=RMTf1bT5EOE3ttWpn3hGu1LtUmsVxDoa0W7W0gXHOy8,81
76
76
  akshare/file_fold/calendar.json,sha256=gKqhd5CrXPGbhfztADaT6WjDDGrxGoxIOKGjB1VUsLk,116370
77
77
  akshare/fortune/__init__.py,sha256=4OCuVKMykUB3Ubm8WogA814U5EGLdrexmfTAOcBnYM4,82
78
- akshare/fortune/fortune_500.py,sha256=V3d3KDHn89j3CItVtSDtDvj1RbHX-OJ4rYRhFTMT0kI,4485
78
+ akshare/fortune/fortune_500.py,sha256=QqF3dLdDiCcSoDxsyEgJf8CHu72Ppsu7u0EajbXr6mg,3197
79
79
  akshare/fortune/fortune_bloomberg.py,sha256=i5HqnICYXKmwy3rOvMLDzJPDJA_am8imKsXzNlLLU6g,3673
80
80
  akshare/fortune/fortune_forbes_500.py,sha256=GiHFZ_dLHkc3K03H1rfVQ0FEGbwOWjdF4CFlRXXWBIM,1437
81
81
  akshare/fortune/fortune_hurun.py,sha256=B2BMDdwsatY5Yo2hX03GBqMJyifPhQzsRTXhelVNs6s,11512
@@ -227,7 +227,7 @@ akshare/reits/reits_basic.py,sha256=gxQeP8_K7SYjBT9zkKuVRRi8B4SPOHNqVdXe_UvTWTY,
227
227
  akshare/sport/__init__.py,sha256=aMsxmuOMZFkcI8tGmQanhPyPwyBpdeApAWyCtDRKMeg,81
228
228
  akshare/sport/sport_olympic.py,sha256=CB1cvLpz2BWuadfonhHuQ17Qxt9X_3ks0Zc5Bff2w9k,818
229
229
  akshare/spot/__init__.py,sha256=VGuha94pXYoezmMs3F3Q_ofaN8RZIrkJ2NtVv8hWCjY,83
230
- akshare/spot/spot_hog_soozhu.py,sha256=4l040e30BIaqheivlQv-0H6AqR1zwvN5JKYYrZxfqlk,2641
230
+ akshare/spot/spot_hog_soozhu.py,sha256=5Lo7AUgUP8CvdeDJCmSVpsiRbSpON6jtm61aKmQeS78,3756
231
231
  akshare/spot/spot_price_qh.py,sha256=rRv09vR8K0U_x6x8AiLgGluxytIXkLatFNVkFbIh8eQ,3756
232
232
  akshare/spot/spot_sge.py,sha256=Ta5EHUlGCSpNDlufIJcwgCErsJEUgH6HJHzYxoYtaMk,6313
233
233
  akshare/stock/__init__.py,sha256=jSa9260d6aNZajaW68chI2mpPkDSXLOgi3eXrqo4MQ8,82
@@ -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
@@ -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.49.dist-info/LICENSE,sha256=mmSZCPgfHiVw34LXuFArd-SUgQtBJ_QsIlh-kWlDHfs,1073
384
- akshare-1.14.49.dist-info/METADATA,sha256=XEyUrgLciEc2YOB6U9tmiaD1US6deNhqAPO26RWL3aI,13976
385
- akshare-1.14.49.dist-info/WHEEL,sha256=R0nc6qTxuoLk7ShA2_Y-UWkN8ZdfDBG2B6Eqpz2WXbs,91
386
- akshare-1.14.49.dist-info/top_level.txt,sha256=jsf9ZzZPmHaISTVumQPsAw7vv7Yv-PdEVW70SMEelQQ,14
387
- akshare-1.14.49.dist-info/RECORD,,
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,,