akshare 1.14.68__py3-none-any.whl → 1.14.70__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
@@ -2879,9 +2879,11 @@ amac_manager_cancelled_info # 中国证券投资基金业协会-信息公示-诚
2879
2879
  1.14.66 fix: fix stock_profit_forecast_ths interface
2880
2880
  1.14.67 fix: fix futures_foreign_commodity_realtime interface
2881
2881
  1.14.68 fix: fix fund_scale_open_sina interface
2882
+ 1.14.69 fix: fix stock_zygc_ym interface
2883
+ 1.14.70 fix: fix setup.py
2882
2884
  """
2883
2885
 
2884
- __version__ = "1.14.68"
2886
+ __version__ = "1.14.70"
2885
2887
  __author__ = "AKFamily"
2886
2888
 
2887
2889
  import sys
akshare/datasets.py CHANGED
@@ -1,43 +1,32 @@
1
1
  # -*- coding:utf-8 -*-
2
2
  # !/usr/bin/env python
3
3
  """
4
- Date: 2023/9/24 16:08
4
+ Date: 2024/9/3 15:30
5
5
  Desc: 导入文件工具,可以正确处理路径问题
6
6
  """
7
+
7
8
  import pathlib
8
9
  from importlib import resources
9
10
 
10
11
 
11
12
  def get_ths_js(file: str = "ths.js") -> pathlib.Path:
12
- """Get path to data "ths.js" text file.
13
-
14
- Returns
15
- -------
16
- pathlib.PosixPath
17
- Path to file.
18
-
19
- References
20
- ----------
21
- .. [1] E.A.Abbott, ”Flatland”, Seeley & Co., 1884.
22
13
  """
23
- with resources.path("akshare.data", file) as f:
14
+ get path to data "ths.js" text file.
15
+ :return: 文件路径
16
+ :rtype: pathlib.Path
17
+ """
18
+ with resources.path(package="akshare.data", resource=file) as f:
24
19
  data_file_path = f
25
20
  return data_file_path
26
21
 
27
22
 
28
23
  def get_crypto_info_csv(file: str = "crypto_info.zip") -> pathlib.Path:
29
- """Get path to data "ths.js" text file.
30
-
31
- Returns
32
- -------
33
- pathlib.PosixPath
34
- Path to file.
35
-
36
- References
37
- ----------
38
- .. [1] E.A.Abbott, ”Flatland”, Seeley & Co., 1884.
39
24
  """
40
- with resources.path("akshare.data", file) as f:
25
+ get path to data "ths.js" text file.
26
+ :return: 文件路径
27
+ :rtype: pathlib.Path
28
+ """
29
+ with resources.path(package="akshare.data", resource=file) as f:
41
30
  data_file_path = f
42
31
  return data_file_path
43
32
 
@@ -1,11 +1,12 @@
1
1
  # -*- coding:utf-8 -*-
2
2
  # !/usr/bin/env python
3
3
  """
4
- Date: 2023/11/27 16:30
4
+ Date: 2024/9/3 16:30
5
5
  Desc: 主营构成
6
6
  https://emweb.securities.eastmoney.com/PC_HSF10/BusinessAnalysis/Index?type=web&code=SH688041#
7
- http://f10.emoney.cn/f10/zbyz/1000001
7
+ https://f10.emoney.cn/f10/zbyz/1000001
8
8
  """
9
+
9
10
  from io import StringIO
10
11
 
11
12
  import pandas as pd
@@ -16,7 +17,7 @@ from bs4 import BeautifulSoup
16
17
  def stock_zygc_ym(symbol: str = "000001") -> pd.DataFrame:
17
18
  """
18
19
  益盟-F10-主营构成
19
- http://f10.emoney.cn/f10/zbyz/1000001
20
+ https://f10.emoney.cn/f10/zbyz/1000001
20
21
  :param symbol: 股票代码
21
22
  :type symbol: str
22
23
  :return: 主营构成
@@ -24,12 +25,11 @@ def stock_zygc_ym(symbol: str = "000001") -> pd.DataFrame:
24
25
  """
25
26
  url = f"http://f10.emoney.cn/f10/zygc/{symbol}"
26
27
  r = requests.get(url)
27
- soup = BeautifulSoup(r.text, "lxml")
28
+ soup = BeautifulSoup(r.text, features="lxml")
28
29
  year_list = [
29
30
  item.text.strip()
30
31
  for item in soup.find(attrs={"class": "swlab_t"}).find_all("li")
31
32
  ]
32
-
33
33
  big_df = pd.DataFrame()
34
34
  for i, item in enumerate(year_list, 2):
35
35
  temp_df = pd.read_html(StringIO(r.text), header=0)[i]
@@ -113,8 +113,10 @@ def stock_zygc_em(symbol: str = "SH688041") -> pd.DataFrame:
113
113
  "毛利率",
114
114
  ]
115
115
  ]
116
- temp_df["报告日期"] = pd.to_datetime(temp_df["报告日期"]).dt.date
117
- temp_df["分类类型"] = temp_df["分类类型"].map({"2": "按产品分类", "3": "按地区分类"})
116
+ temp_df["报告日期"] = pd.to_datetime(temp_df["报告日期"], errors="coerce").dt.date
117
+ temp_df["分类类型"] = temp_df["分类类型"].map(
118
+ {"2": "按产品分类", "3": "按地区分类"}
119
+ )
118
120
  temp_df["主营收入"] = pd.to_numeric(temp_df["主营收入"], errors="coerce")
119
121
  temp_df["收入比例"] = pd.to_numeric(temp_df["收入比例"], errors="coerce")
120
122
  temp_df["主营成本"] = pd.to_numeric(temp_df["主营成本"], errors="coerce")
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: akshare
3
- Version: 1.14.68
3
+ Version: 1.14.70
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
@@ -29,7 +29,9 @@ Requires-Dist: openpyxl>=3.0.3
29
29
  Requires-Dist: jsonpath>=0.82
30
30
  Requires-Dist: tabulate>=0.8.6
31
31
  Requires-Dist: decorator>=4.4.2
32
- Requires-Dist: mini-racer>=0.12.4
32
+ Requires-Dist: mini-racer>=0.12.4; platform_system != "Linux"
33
+ Requires-Dist: py-mini-racer>=0.6.0; platform_system == "Linux"
34
+ Requires-Dist: akracer>=0.0.13; platform_system == "Linux"
33
35
  Provides-Extra: full
34
36
  Requires-Dist: akqmt; extra == "full"
35
37
  Provides-Extra: qmt
@@ -1,5 +1,5 @@
1
- akshare/__init__.py,sha256=sI9wMWeuOVe3fXi07QfD7EvoEAtkPKSjfz4gLjjb294,181261
2
- akshare/datasets.py,sha256=oIu1zC7o_LMHY22lQmdM7vCnryHibKrJLBqJwQiitlI,1167
1
+ akshare/__init__.py,sha256=4t5aZoVtHq3iU5fd2nqa4sRE1Jw57BjOglHAweEXG2s,181328
2
+ akshare/datasets.py,sha256=-qdwaQjgBlftX84uM74KJqCYJYkQ50PV416_neA4uls,995
3
3
  akshare/air/__init__.py,sha256=RMTf1bT5EOE3ttWpn3hGu1LtUmsVxDoa0W7W0gXHOy8,81
4
4
  akshare/air/air_hebei.py,sha256=xIXNGLK7IGYqrkteM9fxnHAwWqk6PCQs6D9-ggZ7byY,4442
5
5
  akshare/air/air_zhenqi.py,sha256=FurRxuYyoZpTa2lsP6BgUJfbfMgOO26_VPuc-ekKZXs,9636
@@ -368,7 +368,7 @@ akshare/stock_fundamental/stock_profit_forecast_ths.py,sha256=ZTShEB5w1y5j6TsHzW
368
368
  akshare/stock_fundamental/stock_recommend.py,sha256=44l1uLofwO-nsDB4oAYWpHQA7_qhXLOo1BurjUvmXzY,4501
369
369
  akshare/stock_fundamental/stock_register_em.py,sha256=QxQh7kddjXLainVVugvOCYG8nDyOv31I8npQmXw3Ccs,15643
370
370
  akshare/stock_fundamental/stock_restricted_em.py,sha256=e5G3oiZBf9d_a8quX5nLzn3RggeF4yX3j-h3nAZBRmA,13378
371
- akshare/stock_fundamental/stock_zygc.py,sha256=Mn3_0WdJzGMc6GJQvx48iPRfjfP88iFGYB16-9ax5Hw,4431
371
+ akshare/stock_fundamental/stock_zygc.py,sha256=L3DPbmvTm-ysDtGiEHCgnkLMkNPduY_awFStmVxppu8,4471
372
372
  akshare/stock_fundamental/stock_zyjs_ths.py,sha256=5aniSf9Wp-j0fsCna9dBU8SA2M4CHTpN-GABUv6YWUM,1538
373
373
  akshare/tool/__init__.py,sha256=RMTf1bT5EOE3ttWpn3hGu1LtUmsVxDoa0W7W0gXHOy8,81
374
374
  akshare/tool/trade_date_hist.py,sha256=o9021QHdOEVucjynFl0jLEi1PEMlNxvDKnMsFSwRfqg,1431
@@ -380,8 +380,8 @@ akshare/utils/token_process.py,sha256=K4rGXjh_tgugbRcyOK2h2x0jP3PT65IIK7nxhUKhOe
380
380
  akshare/utils/tqdm.py,sha256=MuPNwcswkOGjwWQOMWXi9ZvQ_RmW4obCWRj2i7HM7FE,847
381
381
  tests/__init__.py,sha256=gNzhlO0UPjFq6Ieb38kaVIODXv4cTDByrdohAZnDYt4,82
382
382
  tests/test_func.py,sha256=j1MGYbZI2if2j_LY1S4FLsf4qfq4NwVqD5wmRlv5Log,832
383
- akshare-1.14.68.dist-info/LICENSE,sha256=mmSZCPgfHiVw34LXuFArd-SUgQtBJ_QsIlh-kWlDHfs,1073
384
- akshare-1.14.68.dist-info/METADATA,sha256=kuTDxIEegv9P5_hEnw7bpKMewRf80s-J2PsdS5Oi-W4,13961
385
- akshare-1.14.68.dist-info/WHEEL,sha256=UvcQYKBHoFqaQd6LKyqHw9fxEolWLQnlzP0h_LgJAfI,91
386
- akshare-1.14.68.dist-info/top_level.txt,sha256=jsf9ZzZPmHaISTVumQPsAw7vv7Yv-PdEVW70SMEelQQ,14
387
- akshare-1.14.68.dist-info/RECORD,,
383
+ akshare-1.14.70.dist-info/LICENSE,sha256=mmSZCPgfHiVw34LXuFArd-SUgQtBJ_QsIlh-kWlDHfs,1073
384
+ akshare-1.14.70.dist-info/METADATA,sha256=O98oSuxcEkofDddTucExJt-_lUnnGcU-UkR_awLvFuY,14112
385
+ akshare-1.14.70.dist-info/WHEEL,sha256=ixB2d4u7mugx_bCBycvM9OzZ5yD7NmPXFRtKlORZS2Y,91
386
+ akshare-1.14.70.dist-info/top_level.txt,sha256=jsf9ZzZPmHaISTVumQPsAw7vv7Yv-PdEVW70SMEelQQ,14
387
+ akshare-1.14.70.dist-info/RECORD,,
@@ -1,5 +1,5 @@
1
1
  Wheel-Version: 1.0
2
- Generator: setuptools (74.0.0)
2
+ Generator: setuptools (74.1.0)
3
3
  Root-Is-Purelib: true
4
4
  Tag: py3-none-any
5
5