akshare 1.14.36__py3-none-any.whl → 1.14.37__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 +2 -1
- akshare/air/air_zhenqi.py +3 -3
- akshare/bond/bond_issue_cninfo.py +1 -1
- akshare/bond/bond_zh_cov.py +1 -1
- akshare/bond/bond_zh_sina.py +1 -1
- akshare/fund/fund_etf_sina.py +2 -1
- akshare/fund/fund_report_cninfo.py +41 -30
- akshare/futures/futures_zh_sina.py +1 -1
- akshare/index/index_fear_greed_funddb.py +1 -1
- akshare/index/index_stock_hk.py +1 -1
- akshare/index/index_stock_us_sina.py +1 -1
- akshare/index/index_stock_zh.py +1 -1
- akshare/movie/artist_yien.py +32 -5
- akshare/movie/movie_yien.py +1 -1
- akshare/movie/video_yien.py +28 -5
- akshare/stock/stock_allotment_cninfo.py +1 -1
- akshare/stock/stock_cg_equity_mortgage.py +5 -2
- akshare/stock/stock_cg_guarantee.py +1 -1
- akshare/stock/stock_cg_lawsuit.py +36 -35
- akshare/stock/stock_dividend_cninfo.py +1 -1
- akshare/stock/stock_hk_sina.py +8 -7
- akshare/stock/stock_hold_control_cninfo.py +2 -1
- akshare/stock/stock_hold_num_cninfo.py +8 -3
- akshare/stock/stock_industry_cninfo.py +1 -1
- akshare/stock/stock_industry_pe_cninfo.py +1 -1
- akshare/stock/stock_ipo_summary_cninfo.py +1 -1
- akshare/stock/stock_new_cninfo.py +17 -6
- akshare/stock/stock_profile_cninfo.py +1 -1
- akshare/stock/stock_rank_forecast.py +2 -1
- akshare/stock/stock_share_changes_cninfo.py +1 -1
- akshare/stock/stock_us_sina.py +8 -9
- akshare/stock/stock_zh_a_sina.py +1 -1
- akshare/stock/stock_zh_b_sina.py +10 -9
- akshare/stock/stock_zh_kcb_report.py +11 -9
- akshare/stock_feature/stock_a_pe_and_pb.py +1 -1
- akshare/stock_feature/stock_board_industry_ths.py +52 -324
- akshare/stock_feature/stock_cyq_em.py +1 -1
- akshare/stock_feature/stock_fund_flow.py +8 -3
- akshare/stock_feature/stock_technology_ths.py +44 -57
- akshare/tool/trade_date_hist.py +1 -1
- {akshare-1.14.36.dist-info → akshare-1.14.37.dist-info}/METADATA +2 -3
- {akshare-1.14.36.dist-info → akshare-1.14.37.dist-info}/RECORD +45 -45
- {akshare-1.14.36.dist-info → akshare-1.14.37.dist-info}/WHEEL +1 -1
- {akshare-1.14.36.dist-info → akshare-1.14.37.dist-info}/LICENSE +0 -0
- {akshare-1.14.36.dist-info → akshare-1.14.37.dist-info}/top_level.txt +0 -0
|
@@ -5,9 +5,10 @@ Date: 2023/6/12 17:29
|
|
|
5
5
|
Desc: 巨潮资讯-数据中心-新股数据
|
|
6
6
|
http://webapi.cninfo.com.cn/#/xinguList
|
|
7
7
|
"""
|
|
8
|
+
|
|
8
9
|
import pandas as pd
|
|
9
10
|
import requests
|
|
10
|
-
|
|
11
|
+
import py_mini_racer
|
|
11
12
|
|
|
12
13
|
from akshare.datasets import get_ths_js
|
|
13
14
|
|
|
@@ -65,7 +66,9 @@ def stock_new_gh_cninfo() -> pd.DataFrame:
|
|
|
65
66
|
"审核公告日",
|
|
66
67
|
]
|
|
67
68
|
temp_df["上会日期"] = pd.to_datetime(temp_df["上会日期"], errors="coerce").dt.date
|
|
68
|
-
temp_df["审核公告日"] = pd.to_datetime(
|
|
69
|
+
temp_df["审核公告日"] = pd.to_datetime(
|
|
70
|
+
temp_df["审核公告日"], errors="coerce"
|
|
71
|
+
).dt.date
|
|
69
72
|
return temp_df
|
|
70
73
|
|
|
71
74
|
|
|
@@ -135,13 +138,21 @@ def stock_new_ipo_cninfo() -> pd.DataFrame:
|
|
|
135
138
|
"上网发行数量",
|
|
136
139
|
]
|
|
137
140
|
]
|
|
138
|
-
temp_df["摇号结果公告日"] = pd.to_datetime(
|
|
139
|
-
|
|
141
|
+
temp_df["摇号结果公告日"] = pd.to_datetime(
|
|
142
|
+
temp_df["摇号结果公告日"], errors="coerce"
|
|
143
|
+
).dt.date
|
|
144
|
+
temp_df["中签公告日"] = pd.to_datetime(
|
|
145
|
+
temp_df["中签公告日"], errors="coerce"
|
|
146
|
+
).dt.date
|
|
140
147
|
temp_df["上市日期"] = pd.to_datetime(temp_df["上市日期"], errors="coerce").dt.date
|
|
141
|
-
temp_df["中签缴款日"] = pd.to_datetime(
|
|
148
|
+
temp_df["中签缴款日"] = pd.to_datetime(
|
|
149
|
+
temp_df["中签缴款日"], errors="coerce"
|
|
150
|
+
).dt.date
|
|
142
151
|
temp_df["申购日期"] = pd.to_datetime(temp_df["申购日期"], errors="coerce").dt.date
|
|
143
152
|
temp_df["发行价"] = pd.to_numeric(temp_df["发行价"], errors="coerce")
|
|
144
|
-
temp_df["上网发行中签率"] = pd.to_numeric(
|
|
153
|
+
temp_df["上网发行中签率"] = pd.to_numeric(
|
|
154
|
+
temp_df["上网发行中签率"], errors="coerce"
|
|
155
|
+
)
|
|
145
156
|
temp_df["总发行数量"] = pd.to_numeric(temp_df["总发行数量"], errors="coerce")
|
|
146
157
|
temp_df["发行市盈率"] = pd.to_numeric(temp_df["发行市盈率"], errors="coerce")
|
|
147
158
|
temp_df["上网发行数量"] = pd.to_numeric(temp_df["上网发行数量"], errors="coerce")
|
|
@@ -5,9 +5,10 @@ Date: 2023/8/18 15:29
|
|
|
5
5
|
Desc: 巨潮资讯-数据中心-评级预测-投资评级
|
|
6
6
|
http://webapi.cninfo.com.cn/#/thematicStatistics?name=%E6%8A%95%E8%B5%84%E8%AF%84%E7%BA%A7
|
|
7
7
|
"""
|
|
8
|
+
|
|
8
9
|
import pandas as pd
|
|
9
10
|
import requests
|
|
10
|
-
|
|
11
|
+
import py_mini_racer
|
|
11
12
|
|
|
12
13
|
from akshare.datasets import get_ths_js
|
|
13
14
|
|
akshare/stock/stock_us_sina.py
CHANGED
|
@@ -5,12 +5,13 @@ Date: 2023/12/7 15:30
|
|
|
5
5
|
Desc: 新浪财经-美股实时行情数据和历史行情数据
|
|
6
6
|
https://finance.sina.com.cn/stock/usstock/sector.shtml
|
|
7
7
|
"""
|
|
8
|
+
|
|
8
9
|
import json
|
|
9
10
|
from functools import lru_cache
|
|
10
11
|
|
|
11
12
|
import pandas as pd
|
|
12
13
|
import requests
|
|
13
|
-
|
|
14
|
+
import py_mini_racer
|
|
14
15
|
from tqdm import tqdm
|
|
15
16
|
|
|
16
17
|
from akshare.stock.cons import (
|
|
@@ -42,7 +43,7 @@ def __get_us_page_count() -> int:
|
|
|
42
43
|
us_sina_stock_list_url.format(dict_list),
|
|
43
44
|
params=us_sina_stock_dict_payload,
|
|
44
45
|
)
|
|
45
|
-
data_json = json.loads(res.text[res.text.find("({") + 1: res.text.rfind(");")])
|
|
46
|
+
data_json = json.loads(res.text[res.text.find("({") + 1 : res.text.rfind(");")])
|
|
46
47
|
if not isinstance(int(data_json["count"]) / 20, int):
|
|
47
48
|
page_count = int(int(data_json["count"]) / 20) + 1
|
|
48
49
|
else:
|
|
@@ -75,7 +76,7 @@ def get_us_stock_name() -> pd.DataFrame:
|
|
|
75
76
|
us_sina_stock_list_url.format(dict_list),
|
|
76
77
|
params=us_sina_stock_dict_payload,
|
|
77
78
|
)
|
|
78
|
-
data_json = json.loads(res.text[res.text.find("({") + 1: res.text.rfind(");")])
|
|
79
|
+
data_json = json.loads(res.text[res.text.find("({") + 1 : res.text.rfind(");")])
|
|
79
80
|
big_df = pd.concat([big_df, pd.DataFrame(data_json["data"])], ignore_index=True)
|
|
80
81
|
return big_df[["name", "cname", "symbol"]]
|
|
81
82
|
|
|
@@ -104,7 +105,7 @@ def stock_us_spot() -> pd.DataFrame:
|
|
|
104
105
|
us_sina_stock_list_url.format(dict_list),
|
|
105
106
|
params=us_sina_stock_dict_payload,
|
|
106
107
|
)
|
|
107
|
-
data_json = json.loads(res.text[res.text.find("({") + 1: res.text.rfind(");")])
|
|
108
|
+
data_json = json.loads(res.text[res.text.find("({") + 1 : res.text.rfind(");")])
|
|
108
109
|
big_df = pd.concat([big_df, pd.DataFrame(data_json["data"])], ignore_index=True)
|
|
109
110
|
return big_df
|
|
110
111
|
|
|
@@ -127,9 +128,7 @@ def stock_us_daily(symbol: str = "FB", adjust: str = "") -> pd.DataFrame:
|
|
|
127
128
|
res = requests.get(url)
|
|
128
129
|
js_code = py_mini_racer.MiniRacer()
|
|
129
130
|
js_code.eval(zh_js_decode)
|
|
130
|
-
dict_list = js_code.call(
|
|
131
|
-
"d", res.text.split("=")[1].split(";")[0].replace('"', "")
|
|
132
|
-
)
|
|
131
|
+
dict_list = js_code.call("d", res.text.split("=")[1].split(";")[0].replace('"', ""))
|
|
133
132
|
data_df = pd.DataFrame(dict_list)
|
|
134
133
|
data_df["date"] = pd.to_datetime(data_df["date"]).dt.date
|
|
135
134
|
data_df.index = pd.to_datetime(data_df["date"])
|
|
@@ -168,7 +167,7 @@ def stock_us_daily(symbol: str = "FB", adjust: str = "") -> pd.DataFrame:
|
|
|
168
167
|
try:
|
|
169
168
|
# try for pandas >= 2.1.0
|
|
170
169
|
temp_df.ffill(inplace=True)
|
|
171
|
-
except Exception
|
|
170
|
+
except Exception:
|
|
172
171
|
try:
|
|
173
172
|
# try for pandas < 2.1.0
|
|
174
173
|
temp_df.fillna(method="ffill", inplace=True)
|
|
@@ -177,7 +176,7 @@ def stock_us_daily(symbol: str = "FB", adjust: str = "") -> pd.DataFrame:
|
|
|
177
176
|
try:
|
|
178
177
|
# try for pandas >= 2.1.0
|
|
179
178
|
temp_df.bfill(inplace=True)
|
|
180
|
-
except Exception
|
|
179
|
+
except Exception:
|
|
181
180
|
try:
|
|
182
181
|
# try for pandas < 2.1.0
|
|
183
182
|
temp_df.fillna(method="bfill", inplace=True)
|
akshare/stock/stock_zh_a_sina.py
CHANGED
akshare/stock/stock_zh_b_sina.py
CHANGED
|
@@ -5,13 +5,14 @@ Date: 2023/7/20 13:28
|
|
|
5
5
|
Desc: 新浪财经-B股-实时行情数据和历史行情数据(包含前复权和后复权因子)
|
|
6
6
|
https://finance.sina.com.cn/realstock/company/sh689009/nc.shtml
|
|
7
7
|
"""
|
|
8
|
+
|
|
8
9
|
import json
|
|
9
10
|
import re
|
|
10
11
|
from functools import lru_cache
|
|
11
12
|
|
|
12
13
|
import pandas as pd
|
|
13
14
|
import requests
|
|
14
|
-
|
|
15
|
+
import py_mini_racer
|
|
15
16
|
|
|
16
17
|
from akshare.stock.cons import (
|
|
17
18
|
zh_sina_a_stock_url,
|
|
@@ -188,12 +189,12 @@ def stock_zh_b_daily(
|
|
|
188
189
|
try:
|
|
189
190
|
# try for pandas >= 2.1.0
|
|
190
191
|
temp_df.ffill(inplace=True)
|
|
191
|
-
except Exception
|
|
192
|
+
except Exception:
|
|
192
193
|
try:
|
|
193
|
-
|
|
194
|
+
# try for pandas < 2.1.0
|
|
194
195
|
temp_df.fillna(method="ffill", inplace=True)
|
|
195
196
|
except Exception as e:
|
|
196
|
-
|
|
197
|
+
print("Error:", e)
|
|
197
198
|
temp_df = temp_df.astype(float)
|
|
198
199
|
temp_df["amount"] = temp_df["amount"] * 10000
|
|
199
200
|
temp_df["turnover"] = temp_df["volume"] / temp_df["amount"]
|
|
@@ -234,9 +235,9 @@ def stock_zh_b_daily(
|
|
|
234
235
|
try:
|
|
235
236
|
# try for pandas >= 2.1.0
|
|
236
237
|
temp_df.ffill(inplace=True)
|
|
237
|
-
except Exception
|
|
238
|
+
except Exception:
|
|
238
239
|
try:
|
|
239
|
-
|
|
240
|
+
# try for pandas < 2.1.0
|
|
240
241
|
temp_df.fillna(method="ffill", inplace=True)
|
|
241
242
|
except Exception as e:
|
|
242
243
|
print("Error:", e)
|
|
@@ -274,9 +275,9 @@ def stock_zh_b_daily(
|
|
|
274
275
|
try:
|
|
275
276
|
# try for pandas >= 2.1.0
|
|
276
277
|
temp_df.ffill(inplace=True)
|
|
277
|
-
except Exception
|
|
278
|
+
except Exception:
|
|
278
279
|
try:
|
|
279
|
-
|
|
280
|
+
# try for pandas < 2.1.0
|
|
280
281
|
temp_df.fillna(method="ffill", inplace=True)
|
|
281
282
|
except Exception as e:
|
|
282
283
|
print("Error:", e)
|
|
@@ -330,7 +331,7 @@ def stock_zh_b_minute(
|
|
|
330
331
|
return None
|
|
331
332
|
try:
|
|
332
333
|
stock_zh_b_daily(symbol=symbol, adjust="qfq")
|
|
333
|
-
except:
|
|
334
|
+
except: # noqa: E722
|
|
334
335
|
return temp_df
|
|
335
336
|
|
|
336
337
|
if adjust == "":
|
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
#!/usr/bin/env python
|
|
2
2
|
# -*- coding:utf-8 -*-
|
|
3
3
|
"""
|
|
4
|
-
Date:
|
|
4
|
+
Date: 2024/7/21 18:00
|
|
5
5
|
Desc: 科创板报告
|
|
6
|
-
|
|
6
|
+
https://data.eastmoney.com/notices/kcb.html
|
|
7
7
|
"""
|
|
8
|
+
|
|
8
9
|
import pandas as pd
|
|
9
10
|
import requests
|
|
10
11
|
from tqdm import tqdm
|
|
@@ -13,11 +14,11 @@ from tqdm import tqdm
|
|
|
13
14
|
def _stock_zh_kcb_report_em_page() -> int:
|
|
14
15
|
"""
|
|
15
16
|
科创板报告的页数
|
|
16
|
-
|
|
17
|
+
https://data.eastmoney.com/notices/kcb.html
|
|
17
18
|
:return: 科创板报告的页数
|
|
18
19
|
:rtype: int
|
|
19
20
|
"""
|
|
20
|
-
url = "
|
|
21
|
+
url = "https://np-anotice-stock.eastmoney.com/api/security/ann"
|
|
21
22
|
params = {
|
|
22
23
|
"sr": "-1",
|
|
23
24
|
"page_size": "100",
|
|
@@ -38,7 +39,7 @@ def _stock_zh_kcb_report_em_page() -> int:
|
|
|
38
39
|
def stock_zh_kcb_report_em(from_page: int = 1, to_page: int = 100) -> pd.DataFrame:
|
|
39
40
|
"""
|
|
40
41
|
科创板报告内容
|
|
41
|
-
|
|
42
|
+
https://data.eastmoney.com/notices/kcb.html
|
|
42
43
|
:param from_page: 开始获取的页码
|
|
43
44
|
:type from_page: int
|
|
44
45
|
:param to_page: 结束获取的页码
|
|
@@ -46,9 +47,9 @@ def stock_zh_kcb_report_em(from_page: int = 1, to_page: int = 100) -> pd.DataFra
|
|
|
46
47
|
:return: 科创板报告内容
|
|
47
48
|
:rtype: pandas.DataFrame
|
|
48
49
|
"""
|
|
49
|
-
|
|
50
|
-
url = "http://np-anotice-stock.eastmoney.com/api/security/ann"
|
|
50
|
+
url = "https://np-anotice-stock.eastmoney.com/api/security/ann"
|
|
51
51
|
total_page = _stock_zh_kcb_report_em_page()
|
|
52
|
+
big_df = pd.DataFrame()
|
|
52
53
|
if to_page >= total_page:
|
|
53
54
|
to_page = total_page
|
|
54
55
|
for i in tqdm(range(from_page, to_page + 1), leave=False):
|
|
@@ -76,7 +77,8 @@ def stock_zh_kcb_report_em(from_page: int = 1, to_page: int = 100) -> pd.DataFra
|
|
|
76
77
|
[item["art_code"] for item in data_json["data"]["list"]],
|
|
77
78
|
]
|
|
78
79
|
).T
|
|
79
|
-
big_df =
|
|
80
|
+
big_df = pd.concat(objs=[big_df, temp_df], ignore_index=True)
|
|
81
|
+
|
|
80
82
|
big_df.columns = [
|
|
81
83
|
"代码",
|
|
82
84
|
"名称",
|
|
@@ -85,7 +87,7 @@ def stock_zh_kcb_report_em(from_page: int = 1, to_page: int = 100) -> pd.DataFra
|
|
|
85
87
|
"公告日期",
|
|
86
88
|
"公告代码",
|
|
87
89
|
]
|
|
88
|
-
big_df[
|
|
90
|
+
big_df["公告日期"] = pd.to_datetime(big_df["公告日期"], errors="coerce").dt.date
|
|
89
91
|
return big_df
|
|
90
92
|
|
|
91
93
|
|