akshare 1.16.64__py3-none-any.whl → 1.16.65__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/cons.py +1 -0
- akshare/air/crypto.js +1 -1
- akshare/air/outcrypto.js +1 -1
- akshare/article/cons.py +1 -0
- akshare/article/epu_index.py +4 -3
- akshare/article/ff_factor.py +19 -8
- akshare/article/fred_md.py +4 -1
- akshare/article/risk_rv.py +3 -8
- akshare/bond/bond_cb_sina.py +1 -0
- akshare/bond/bond_cbond.py +19 -14
- akshare/bond/bond_em.py +34 -15
- akshare/bond/bond_summary.py +38 -37
- akshare/bond/bond_zh_cov.py +0 -6
- akshare/bond/cons.py +14 -11
- akshare/crypto/__init__.py +1 -1
- akshare/crypto/crypto_bitcoin_cme.py +7 -7
- akshare/crypto/crypto_hold.py +4 -1
- akshare/currency/currency.py +1 -0
- akshare/currency/currency_china_bank_sina.py +6 -3
- akshare/data/__init__.py +1 -1
- akshare/data/cninfo.js +1 -1
- akshare/economic/cons.py +10 -3
- akshare/economic/macro_australia.py +0 -7
- akshare/economic/macro_canada.py +92 -81
- akshare/economic/macro_china.py +0 -34
- akshare/economic/macro_china_hk.py +0 -1
- akshare/economic/macro_euro.py +103 -56
- akshare/economic/macro_germany.py +1 -1
- akshare/economic/macro_japan.py +0 -1
- akshare/economic/macro_other.py +1 -6
- akshare/economic/macro_swiss.py +2 -3
- akshare/economic/macro_uk.py +1 -1
- akshare/economic/macro_usa.py +0 -2
- akshare/energy/energy_carbon.py +0 -1
- akshare/energy/energy_oil_em.py +1 -2
- akshare/event/cons.py +1 -0
- akshare/forex/forex_em.py +0 -1
- akshare/fortune/fortune_bloomberg.py +6 -3
- akshare/fortune/fortune_forbes_500.py +3 -6
- akshare/fortune/fortune_hurun.py +2 -1
- akshare/fortune/fortune_xincaifu_500.py +17 -14
- akshare/fund/fund_announcement.py +1 -0
- akshare/fund/fund_aum_em.py +47 -35
- akshare/fund/fund_em.py +0 -7
- akshare/fund/fund_etf_em.py +0 -5
- akshare/fund/fund_fhsp_em.py +27 -20
- akshare/fund/fund_init_em.py +8 -5
- akshare/fund/fund_lof_em.py +0 -5
- akshare/fund/fund_manager.py +18 -7
- akshare/fund/fund_portfolio_em.py +0 -1
- akshare/fund/fund_position_lg.py +19 -8
- akshare/fund/fund_rank_em.py +0 -3
- akshare/fund/fund_rating.py +28 -9
- akshare/fund/fund_scale_em.py +24 -13
- akshare/futures/futures_comex_em.py +1 -0
- akshare/futures/futures_contract_detail.py +11 -8
- akshare/futures/futures_inventory_em.py +0 -2
- akshare/futures/futures_rule.py +5 -1
- akshare/futures/futures_settlement_price_sgx.py +21 -6
- akshare/futures/futures_stock_js.py +0 -1
- akshare/futures/receipt.py +279 -153
- akshare/futures/requests_fun.py +16 -3
- akshare/futures_derivative/cons.py +100 -103
- akshare/futures_derivative/futures_contract_info_cffex.py +53 -39
- akshare/futures_derivative/futures_contract_info_dce.py +16 -9
- akshare/futures_derivative/futures_contract_info_gfex.py +43 -31
- akshare/futures_derivative/futures_index_sina.py +25 -13
- akshare/fx/cons.py +12 -7
- akshare/fx/fx_quote.py +1 -0
- akshare/fx/fx_quote_baidu.py +2 -1
- akshare/hf/__init__.py +1 -1
- akshare/hf/hf_sp500.py +8 -7
- akshare/index/index_eri.py +1 -0
- akshare/index/index_global_em.py +0 -1
- akshare/index/index_kq_fz.py +17 -14
- akshare/index/index_kq_ss.py +1 -0
- akshare/index/index_stock_hk.py +0 -1
- akshare/index/index_stock_zh.py +0 -3
- akshare/index/index_sugar.py +18 -4
- akshare/index/index_zh_em.py +0 -15
- akshare/interest_rate/interbank_rate_em.py +0 -1
- akshare/movie/jm.js +0 -1
- akshare/news/__init__.py +1 -1
- akshare/news/news_stock.py +0 -1
- akshare/option/option_commodity_sina.py +22 -26
- akshare/option/option_daily_stats_sse_szse.py +0 -1
- akshare/option/option_em.py +0 -1
- akshare/option/option_lhb_em.py +0 -1
- akshare/option/option_risk_indicator_sse.py +0 -1
- akshare/other/__init__.py +1 -1
- akshare/pro/__init__.py +0 -1
- akshare/pro/client.py +6 -4
- akshare/pro/cons.py +3 -2
- akshare/pro/data_pro.py +6 -5
- akshare/qhkc/qhkc_api.py +63 -21
- akshare/qhkc_web/qhkc_fund.py +1 -0
- akshare/qhkc_web/qhkc_index.py +1 -0
- akshare/qhkc_web/qhkc_tool.py +55 -54
- akshare/rate/__init__.py +1 -1
- akshare/rate/repo_rate.py +36 -32
- akshare/reits/__init__.py +1 -1
- akshare/reits/reits_basic.py +44 -2
- akshare/sport/__init__.py +1 -1
- akshare/sport/sport_olympic.py +1 -0
- akshare/spot/__init__.py +1 -1
- akshare/stock/cons.py +19 -12
- akshare/stock/stock_board_concept_em.py +0 -6
- akshare/stock/stock_board_industry_em.py +0 -6
- akshare/stock/stock_dzjy_em.py +1 -1
- akshare/stock/stock_fund_em.py +0 -2
- akshare/stock/stock_fund_hold.py +1 -2
- akshare/stock/stock_gsrl_em.py +1 -0
- akshare/stock/stock_hk_famous.py +0 -1
- akshare/stock/stock_hk_fhpx_ths.py +2 -1
- akshare/stock/stock_hk_hot_rank_em.py +1 -0
- akshare/stock/stock_hold_control_em.py +0 -2
- akshare/stock/stock_hot_up_em.py +4 -1
- akshare/stock/stock_hsgt_em.py +0 -2
- akshare/stock/stock_industry.py +1 -0
- akshare/stock/stock_info.py +0 -2
- akshare/stock/stock_info_em.py +0 -1
- akshare/stock/stock_repurchase_em.py +7 -2
- akshare/stock/stock_share_hold.py +0 -1
- akshare/stock/stock_stop.py +0 -1
- akshare/stock/stock_summary.py +0 -2
- akshare/stock/stock_us_famous.py +0 -1
- akshare/stock/stock_us_js.py +3 -2
- akshare/stock/stock_us_pink.py +0 -1
- akshare/stock/stock_weibo_nlp.py +18 -20
- akshare/stock/stock_zh_a_special.py +0 -3
- akshare/stock/stock_zh_a_tick_tx.py +11 -3
- akshare/stock_a/stock_board_concept_name_em.py +0 -1
- akshare/stock_a/stock_zh_a_spot.py +0 -1
- akshare/stock_feature/cons.py +1 -0
- akshare/stock_feature/stock_account_em.py +0 -1
- akshare/stock_feature/stock_all_pb.py +2 -1
- akshare/stock_feature/stock_analyst_em.py +0 -3
- akshare/stock_feature/stock_buffett_index_lg.py +7 -6
- akshare/stock_feature/stock_classify_sina.py +3 -6
- akshare/stock_feature/stock_comment_em.py +0 -2
- akshare/stock_feature/stock_congestion_lg.py +2 -1
- akshare/stock_feature/stock_dxsyl_em.py +116 -71
- akshare/stock_feature/stock_gdzjc_em.py +16 -5
- akshare/stock_feature/stock_gxl_lg.py +3 -2
- akshare/stock_feature/stock_hist_em.py +0 -20
- akshare/stock_feature/stock_hist_tx.py +10 -8
- akshare/stock_feature/stock_hot_xq.py +4 -6
- akshare/stock_feature/stock_hsgt_em.py +0 -2
- akshare/stock_feature/stock_hsgt_exchange_rate.py +0 -2
- akshare/stock_feature/stock_hsgt_min_em.py +13 -16
- akshare/stock_feature/stock_inner_trade_xq.py +0 -1
- akshare/stock_feature/stock_lhb_em.py +0 -1
- akshare/stock_feature/stock_margin_em.py +0 -1
- akshare/stock_feature/stock_margin_sse.py +0 -2
- akshare/stock_feature/stock_pankou_em.py +0 -2
- akshare/stock_feature/stock_qsjy_em.py +13 -4
- akshare/stock_feature/stock_research_report_em.py +0 -1
- akshare/stock_feature/stock_yjyg_cninfo.py +4 -1
- akshare/stock_feature/stock_zh_vote_baidu.py +4 -1
- akshare/stock_feature/stock_ztb_em.py +0 -6
- akshare/stock_fundamental/__init__.py +1 -1
- akshare/stock_fundamental/stock_hold.py +26 -17
- akshare/stock_fundamental/stock_ipo_declare.py +1 -0
- akshare/stock_fundamental/stock_kcb_detail_sse.py +10 -10
- akshare/stock_fundamental/stock_kcb_sse.py +26 -25
- akshare/stock_fundamental/stock_profit_forecast_hk_etnet.py +64 -41
- akshare/stock_fundamental/stock_recommend.py +20 -4
- akshare/utils/demjson.py +2005 -1334
- akshare/utils/token_process.py +6 -5
- {akshare-1.16.64.dist-info → akshare-1.16.65.dist-info}/METADATA +3 -8
- {akshare-1.16.64.dist-info → akshare-1.16.65.dist-info}/RECORD +175 -175
- {akshare-1.16.64.dist-info → akshare-1.16.65.dist-info}/WHEEL +0 -0
- {akshare-1.16.64.dist-info → akshare-1.16.65.dist-info}/licenses/LICENSE +0 -0
- {akshare-1.16.64.dist-info → akshare-1.16.65.dist-info}/top_level.txt +0 -0
@@ -5,13 +5,16 @@ Date: 2024/1/7 15:00
|
|
5
5
|
Desc: 东方财富网-数据中心-研究报告-盈利预测
|
6
6
|
https://data.eastmoney.com/report/profitforecast.jshtml
|
7
7
|
"""
|
8
|
+
|
8
9
|
from io import StringIO
|
9
10
|
|
10
11
|
import pandas as pd
|
11
12
|
import requests
|
12
13
|
|
13
14
|
|
14
|
-
def stock_hk_profit_forecast_et(
|
15
|
+
def stock_hk_profit_forecast_et(
|
16
|
+
symbol: str = "09999", indicator: str = "盈利预测概览"
|
17
|
+
) -> pd.DataFrame:
|
15
18
|
"""
|
16
19
|
经济通-公司资料-盈利预测
|
17
20
|
https://www.etnet.com.hk/www/sc/stocks/realtime/quote_profit.php?code=9999
|
@@ -46,58 +49,78 @@ def stock_hk_profit_forecast_et(symbol: str = "09999", indicator: str = "盈利
|
|
46
49
|
return temp_df
|
47
50
|
elif indicator == "综合盈利预测":
|
48
51
|
temp_df = pd.read_html(StringIO(r.text), header=0)[3]
|
49
|
-
temp_df.rename(
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
|
64
|
-
|
65
|
-
|
66
|
-
temp_df[
|
67
|
-
temp_df[
|
68
|
-
|
52
|
+
temp_df.rename(
|
53
|
+
columns={
|
54
|
+
"纯利/(亏损) (百万元人民币)": "纯利/亏损",
|
55
|
+
"纯利/(亏损) (百万港元)": "纯利/亏损",
|
56
|
+
"每股盈利/ (亏损)(分)": "每股盈利/每股亏损",
|
57
|
+
"每股盈利/ (亏损)(港仙)": "每股盈利/每股亏损",
|
58
|
+
"每股派息 (分)": "每股派息",
|
59
|
+
"每股派息 (港仙)": "每股派息",
|
60
|
+
"每股资产净值 (人民币元)": "每股资产净值",
|
61
|
+
"每股资产净值 (港元)": "每股资产净值",
|
62
|
+
"最高 (百万元人民币)": "最高",
|
63
|
+
"最高 (百万港元)": "最高",
|
64
|
+
"最低 (百万元人民币)": "最低",
|
65
|
+
"最低 (百万港元)": "最低",
|
66
|
+
},
|
67
|
+
inplace=True,
|
68
|
+
)
|
69
|
+
temp_df["纯利/亏损"] = pd.to_numeric(temp_df["纯利/亏损"], errors="coerce")
|
70
|
+
temp_df["每股盈利/每股亏损"] = pd.to_numeric(
|
71
|
+
temp_df["每股盈利/每股亏损"], errors="coerce"
|
72
|
+
)
|
73
|
+
temp_df["每股派息"] = pd.to_numeric(temp_df["每股派息"], errors="coerce")
|
74
|
+
temp_df["每股资产净值"] = pd.to_numeric(
|
75
|
+
temp_df["每股资产净值"], errors="coerce"
|
76
|
+
)
|
77
|
+
temp_df["最高"] = pd.to_numeric(temp_df["最高"], errors="coerce")
|
78
|
+
temp_df["最低"] = pd.to_numeric(temp_df["最低"], errors="coerce")
|
69
79
|
return temp_df
|
70
80
|
elif indicator == "盈利预测概览":
|
71
81
|
temp_df = pd.read_html(StringIO(r.text), header=0)[4]
|
72
|
-
del temp_df[
|
73
|
-
temp_df.rename(
|
74
|
-
|
75
|
-
|
76
|
-
|
77
|
-
|
78
|
-
|
79
|
-
|
80
|
-
|
81
|
-
|
82
|
+
del temp_df["目标价* (港元).1"]
|
83
|
+
temp_df.rename(
|
84
|
+
columns={
|
85
|
+
"纯利/(亏损) (百万元人民币)": "纯利/亏损",
|
86
|
+
"纯利/(亏损) (百万港元)": "纯利/亏损",
|
87
|
+
"每股盈利*/ (亏损) (港仙)": "每股盈利",
|
88
|
+
"每股盈利*/ (亏损) (分)": "每股盈利",
|
89
|
+
"每股派息* (分)": "每股派息",
|
90
|
+
"每股派息* (港仙)": "每股派息",
|
91
|
+
"目标价* (港元)": "目标价",
|
92
|
+
},
|
93
|
+
inplace=True,
|
94
|
+
)
|
82
95
|
temp_df.dropna(inplace=True)
|
83
|
-
temp_df[
|
84
|
-
temp_df[
|
85
|
-
temp_df[
|
86
|
-
temp_df[
|
87
|
-
temp_df[
|
88
|
-
|
96
|
+
temp_df["纯利/亏损"] = pd.to_numeric(temp_df["纯利/亏损"], errors="coerce")
|
97
|
+
temp_df["每股盈利"] = pd.to_numeric(temp_df["每股盈利"], errors="coerce")
|
98
|
+
temp_df["每股派息"] = pd.to_numeric(temp_df["每股派息"], errors="coerce")
|
99
|
+
temp_df["目标价"] = pd.to_numeric(temp_df["目标价"], errors="coerce")
|
100
|
+
temp_df["更新日期"] = pd.to_datetime(
|
101
|
+
temp_df["更新日期"], errors="coerce", dayfirst=True
|
102
|
+
).dt.date
|
103
|
+
temp_df["财政年度"] = temp_df["财政年度"].astype(int).astype(str)
|
89
104
|
return temp_df
|
90
105
|
|
91
106
|
|
92
107
|
if __name__ == "__main__":
|
93
|
-
stock_hk_profit_forecast_et_df = stock_hk_profit_forecast_et(
|
108
|
+
stock_hk_profit_forecast_et_df = stock_hk_profit_forecast_et(
|
109
|
+
symbol="09999", indicator="评级总览"
|
110
|
+
)
|
94
111
|
print(stock_hk_profit_forecast_et_df)
|
95
112
|
|
96
|
-
stock_hk_profit_forecast_et_df = stock_hk_profit_forecast_et(
|
113
|
+
stock_hk_profit_forecast_et_df = stock_hk_profit_forecast_et(
|
114
|
+
symbol="09999", indicator="去年度业绩表现"
|
115
|
+
)
|
97
116
|
print(stock_hk_profit_forecast_et_df)
|
98
117
|
|
99
|
-
stock_hk_profit_forecast_et_df = stock_hk_profit_forecast_et(
|
118
|
+
stock_hk_profit_forecast_et_df = stock_hk_profit_forecast_et(
|
119
|
+
symbol="09999", indicator="综合盈利预测"
|
120
|
+
)
|
100
121
|
print(stock_hk_profit_forecast_et_df)
|
101
122
|
|
102
|
-
stock_hk_profit_forecast_et_df = stock_hk_profit_forecast_et(
|
123
|
+
stock_hk_profit_forecast_et_df = stock_hk_profit_forecast_et(
|
124
|
+
symbol="09999", indicator="盈利预测概览"
|
125
|
+
)
|
103
126
|
print(stock_hk_profit_forecast_et_df)
|
@@ -5,6 +5,7 @@ Date: 2022/1/7 13:40
|
|
5
5
|
Desc: 新浪财经-机构推荐池
|
6
6
|
http://stock.finance.sina.com.cn/stock/go.php/vIR_RatingNewest/index.phtml
|
7
7
|
"""
|
8
|
+
|
8
9
|
import pandas as pd
|
9
10
|
import requests
|
10
11
|
from bs4 import BeautifulSoup
|
@@ -26,7 +27,10 @@ def stock_institute_recommend(symbol: str = "投资评级选股") -> pd.DataFram
|
|
26
27
|
}
|
27
28
|
r = requests.get(url, params=params)
|
28
29
|
soup = BeautifulSoup(r.text, "lxml")
|
29
|
-
indicator_map = {
|
30
|
+
indicator_map = {
|
31
|
+
item.find("a").text: item.find("a")["href"]
|
32
|
+
for item in soup.find(attrs={"id": "leftMenu"}).find_all("dd")[1].find_all("li")
|
33
|
+
}
|
30
34
|
url = indicator_map[symbol]
|
31
35
|
params = {
|
32
36
|
"num": "10000",
|
@@ -90,10 +94,22 @@ def stock_institute_recommend_detail(symbol: str = "000001") -> pd.DataFrame:
|
|
90
94
|
return temp_df
|
91
95
|
|
92
96
|
|
93
|
-
if __name__ ==
|
94
|
-
for item in [
|
97
|
+
if __name__ == "__main__":
|
98
|
+
for item in [
|
99
|
+
"最新投资评级",
|
100
|
+
"上调评级股票",
|
101
|
+
"下调评级股票",
|
102
|
+
"股票综合评级",
|
103
|
+
"首次评级股票",
|
104
|
+
"目标涨幅排名",
|
105
|
+
"机构关注度",
|
106
|
+
"行业关注度",
|
107
|
+
"投资评级选股",
|
108
|
+
]:
|
95
109
|
stock_institute_recommend_df = stock_institute_recommend(symbol=item)
|
96
110
|
print(stock_institute_recommend_df)
|
97
111
|
|
98
|
-
stock_institute_recommend_detail_df = stock_institute_recommend_detail(
|
112
|
+
stock_institute_recommend_detail_df = stock_institute_recommend_detail(
|
113
|
+
symbol="002709"
|
114
|
+
)
|
99
115
|
print(stock_institute_recommend_detail_df)
|