akshare 1.15.77__py3-none-any.whl → 1.15.78__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
@@ -2987,9 +2987,10 @@ amac_manager_cancelled_info # 中国证券投资基金业协会-信息公示-诚
2987
2987
  1.15.75 feat: add futures_hist_em interface
2988
2988
  1.15.76 fix: fix futures_zh_minute_sina interface
2989
2989
  1.15.77 fix: fix option_czce_daily interface
2990
+ 1.15.78 fix: fix stock_yzxdr_em interface
2990
2991
  """
2991
2992
 
2992
- __version__ = "1.15.77"
2993
+ __version__ = "1.15.78"
2993
2994
  __author__ = "AKFamily"
2994
2995
 
2995
2996
  import sys
@@ -3,26 +3,30 @@
3
3
  """
4
4
  Date: 2022/4/27 19:18
5
5
  Desc: 东方财富网-数据中心-特色数据-一致行动人
6
- http://data.eastmoney.com/yzxdr/
6
+ https://data.eastmoney.com/yzxdr/
7
7
  """
8
+
8
9
  import pandas as pd
9
10
  import requests
10
- from tqdm import tqdm
11
+ from akshare.utils.tqdm import get_tqdm
11
12
 
12
13
  from akshare.utils import demjson
13
14
 
14
15
 
15
- def stock_yzxdr_em(date: str = "20200930") -> pd.DataFrame:
16
+ def stock_yzxdr_em(date: str = "20240930") -> pd.DataFrame:
16
17
  """
17
18
  东方财富网-数据中心-特色数据-一致行动人
18
- http://data.eastmoney.com/yzxdr/
19
+ https://data.eastmoney.com/yzxdr/
19
20
  :param date: 每年的季度末时间点
20
21
  :type date: str
21
22
  :return: 一致行动人
22
23
  :rtype: pandas.DataFrame
23
24
  """
25
+ import warnings
26
+
27
+ warnings.simplefilter(action="ignore", category=FutureWarning) # 忽略所有
24
28
  date = "-".join([date[:4], date[4:6], date[6:]])
25
- url = "http://datacenter.eastmoney.com/api/data/get"
29
+ url = "https://datacenter.eastmoney.com/api/data/get"
26
30
  params = {
27
31
  "type": "RPTA_WEB_YZXDRINDEX",
28
32
  "sty": "ALL",
@@ -40,24 +44,19 @@ def stock_yzxdr_em(date: str = "20200930") -> pd.DataFrame:
40
44
  data_json = demjson.decode(data_text[data_text.find("{") : -1])
41
45
  total_pages = data_json["result"]["pages"]
42
46
  big_df = pd.DataFrame()
47
+ tqdm = get_tqdm()
43
48
  for page in tqdm(range(1, total_pages + 1), leave=False):
44
- params = {
45
- "type": "RPTA_WEB_YZXDRINDEX",
46
- "sty": "ALL",
47
- "source": "WEB",
48
- "p": str(page),
49
- "ps": "500",
50
- "st": "noticedate",
51
- "sr": "-1",
52
- "var": "mwUyirVm",
53
- "filter": f"(enddate='{date}')",
54
- "rt": "53575609",
55
- }
49
+ params.update(
50
+ {
51
+ "p": str(page),
52
+ "filter": f"(enddate='{date}')",
53
+ }
54
+ )
56
55
  r = requests.get(url, params=params)
57
56
  data_text = r.text
58
57
  data_json = demjson.decode(data_text[data_text.find("{") : -1])
59
58
  temp_df = pd.DataFrame(data_json["result"]["data"])
60
- big_df = pd.concat([big_df, temp_df], ignore_index=True)
59
+ big_df = pd.concat(objs=[big_df, temp_df], ignore_index=True)
61
60
 
62
61
  big_df.reset_index(inplace=True)
63
62
  big_df["index"] = range(1, len(big_df) + 1)
@@ -78,8 +77,8 @@ def stock_yzxdr_em(date: str = "20200930") -> pd.DataFrame:
78
77
  "数据日期",
79
78
  "股票市场",
80
79
  ]
81
- big_df["数据日期"] = pd.to_datetime(big_df["数据日期"])
82
- big_df["公告日期"] = pd.to_datetime(big_df["公告日期"])
80
+ big_df["数据日期"] = pd.to_datetime(big_df["数据日期"], errors="coerce")
81
+ big_df["公告日期"] = pd.to_datetime(big_df["公告日期"], errors="coerce")
83
82
 
84
83
  big_df = big_df[
85
84
  [
@@ -95,10 +94,13 @@ def stock_yzxdr_em(date: str = "20200930") -> pd.DataFrame:
95
94
  "公告日期",
96
95
  ]
97
96
  ]
98
- big_df['公告日期'] = pd.to_datetime(big_df['公告日期']).dt.date
97
+ big_df["公告日期"] = pd.to_datetime(big_df["公告日期"], errors="coerce").dt.date
98
+ big_df["持股数量"] = pd.to_numeric(big_df["持股数量"], errors="coerce")
99
+ big_df["持股比例"] = pd.to_numeric(big_df["持股比例"], errors="coerce")
100
+ big_df["持股数量变动"] = pd.to_numeric(big_df["持股数量变动"], errors="coerce")
99
101
  return big_df
100
102
 
101
103
 
102
104
  if __name__ == "__main__":
103
- stock_yzxdr_em_df = stock_yzxdr_em(date="20220331")
105
+ stock_yzxdr_em_df = stock_yzxdr_em(date="20240930")
104
106
  print(stock_yzxdr_em_df)
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.2
2
2
  Name: akshare
3
- Version: 1.15.77
3
+ Version: 1.15.78
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=Tw63TSaxmNRk4Dqn31HBPBdqlyACvjPVjMderWtdnVg,186462
1
+ akshare/__init__.py,sha256=-xflBH3XZXXgK0kLNDPW1RBds87h6NkFkgUYNf4aMns,186504
2
2
  akshare/datasets.py,sha256=rKuRNZrqi6IMsZ9nyvO3Rx02js0tH3zMLjz8HQNAoPQ,963
3
3
  akshare/exceptions.py,sha256=WEJjIhSmJ_xXNW6grwV4nufE_cfmmyuhmueVGiN1VAg,878
4
4
  akshare/request.py,sha256=HtFFf9MhfEibR-ETWe-1Tts6ELU4VKSqA-ghaXjegQM,4252
@@ -344,7 +344,7 @@ akshare/stock_feature/stock_wencai.py,sha256=KPwt72SOnK4dHh2vpWOHYynkj8Vrbv3AW-E
344
344
  akshare/stock_feature/stock_yjbb_em.py,sha256=J-JFnRy4M1DlM46J2ccJTdnkUrI3M2lTYj4CpzqgADo,4275
345
345
  akshare/stock_feature/stock_yjyg_cninfo.py,sha256=DveTsc-DhLzRDBJZQ7yv8KogzG-vo3Pmr2oRgCzaH1E,2870
346
346
  akshare/stock_feature/stock_yjyg_em.py,sha256=CnpSNyOUYVzoduFTVwsERtdp_uJimlHddw4uWV0iDmc,12184
347
- akshare/stock_feature/stock_yzxdr_em.py,sha256=2hn2dutiKphyopjlekSfcNCsmf1oy99S60iRjov3Jm4,2951
347
+ akshare/stock_feature/stock_yzxdr_em.py,sha256=-16KDPtBDXkbHRs7aNAyPy35XurDj7LIcbWAtmgvP64,3219
348
348
  akshare/stock_feature/stock_zdhtmx_em.py,sha256=2BpJQntGgUlEIOmDlepOiOkw-e-tKLRaY-O7bNSbiIo,4153
349
349
  akshare/stock_feature/stock_zf_pg.py,sha256=nYJ1uLOBdzM_PDyq4MNeWoCTripFMAPoAiaPfhDqkcg,6343
350
350
  akshare/stock_feature/stock_zh_valuation_baidu.py,sha256=oxYIHP68pFvAYyqjCvZp3a9tpczTFiWhSxZ0w4eyo7I,1904
@@ -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.15.77.dist-info/LICENSE,sha256=mmSZCPgfHiVw34LXuFArd-SUgQtBJ_QsIlh-kWlDHfs,1073
384
- akshare-1.15.77.dist-info/METADATA,sha256=buksHKO4RHQGvgpPHGGHNwa5_yxTuXb8bU9OmZMUZAs,13679
385
- akshare-1.15.77.dist-info/WHEEL,sha256=In9FTNxeP60KnTkGw7wk6mJPYd_dQSjEZmXdBdMCI-8,91
386
- akshare-1.15.77.dist-info/top_level.txt,sha256=jsf9ZzZPmHaISTVumQPsAw7vv7Yv-PdEVW70SMEelQQ,14
387
- akshare-1.15.77.dist-info/RECORD,,
383
+ akshare-1.15.78.dist-info/LICENSE,sha256=mmSZCPgfHiVw34LXuFArd-SUgQtBJ_QsIlh-kWlDHfs,1073
384
+ akshare-1.15.78.dist-info/METADATA,sha256=wTcOdPsGAuAdBsVKqUb6MLsnMy-THtLDijeRF4oJXQk,13679
385
+ akshare-1.15.78.dist-info/WHEEL,sha256=In9FTNxeP60KnTkGw7wk6mJPYd_dQSjEZmXdBdMCI-8,91
386
+ akshare-1.15.78.dist-info/top_level.txt,sha256=jsf9ZzZPmHaISTVumQPsAw7vv7Yv-PdEVW70SMEelQQ,14
387
+ akshare-1.15.78.dist-info/RECORD,,