akshare 1.14.35__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 +3 -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/option/option_commodity.py +22 -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 +54 -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.35.dist-info → akshare-1.14.37.dist-info}/METADATA +2 -3
- {akshare-1.14.35.dist-info → akshare-1.14.37.dist-info}/RECORD +46 -46
- {akshare-1.14.35.dist-info → akshare-1.14.37.dist-info}/WHEEL +1 -1
- {akshare-1.14.35.dist-info → akshare-1.14.37.dist-info}/LICENSE +0 -0
- {akshare-1.14.35.dist-info → akshare-1.14.37.dist-info}/top_level.txt +0 -0
akshare/__init__.py
CHANGED
|
@@ -2846,9 +2846,11 @@ amac_manager_cancelled_info # 中国证券投资基金业协会-信息公示-诚
|
|
|
2846
2846
|
1.14.33 fix: fix stock_concept_cons_futu interface
|
|
2847
2847
|
1.14.34 add: add macro_rmb_loan interface
|
|
2848
2848
|
1.14.35 add: add macro_rmb_deposit interface
|
|
2849
|
+
1.14.36 fix: fix option_czce_daily interface
|
|
2850
|
+
1.14.37 fix: fix stock_zh_kcb_report_em interface
|
|
2849
2851
|
"""
|
|
2850
2852
|
|
|
2851
|
-
__version__ = "1.14.
|
|
2853
|
+
__version__ = "1.14.37"
|
|
2852
2854
|
__author__ = "AKFamily"
|
|
2853
2855
|
|
|
2854
2856
|
import sys
|
akshare/air/air_zhenqi.py
CHANGED
|
@@ -15,7 +15,7 @@ from io import StringIO
|
|
|
15
15
|
|
|
16
16
|
import pandas as pd
|
|
17
17
|
import requests
|
|
18
|
-
from py_mini_racer import
|
|
18
|
+
from py_mini_racer import MiniRacer
|
|
19
19
|
|
|
20
20
|
from akshare.utils import demjson
|
|
21
21
|
|
|
@@ -116,7 +116,7 @@ def air_quality_watch_point(
|
|
|
116
116
|
end_date = "-".join([end_date[:4], end_date[4:6], end_date[6:]])
|
|
117
117
|
url = "https://www.zq12369.com/api/zhenqiapi.php"
|
|
118
118
|
file_data = _get_file_content(file_name="crypto.js")
|
|
119
|
-
ctx =
|
|
119
|
+
ctx = MiniRacer()
|
|
120
120
|
ctx.eval(file_data)
|
|
121
121
|
method = "GETCITYPOINTAVG"
|
|
122
122
|
ctx.call("encode_param", method)
|
|
@@ -167,7 +167,7 @@ def air_quality_hist(
|
|
|
167
167
|
end_date = "-".join([end_date[:4], end_date[4:6], end_date[6:]])
|
|
168
168
|
url = "https://www.zq12369.com/api/newzhenqiapi.php"
|
|
169
169
|
file_data = _get_file_content(file_name="outcrypto.js")
|
|
170
|
-
ctx =
|
|
170
|
+
ctx = MiniRacer()
|
|
171
171
|
ctx.eval(file_data)
|
|
172
172
|
app_id = "4f0e3a273d547ce6b7147bfa7ceb4b6e"
|
|
173
173
|
method = "CETCITYPERIOD"
|
akshare/bond/bond_zh_cov.py
CHANGED
akshare/bond/bond_zh_sina.py
CHANGED
akshare/fund/fund_etf_sina.py
CHANGED
|
@@ -5,9 +5,10 @@ Date: 2022/2/15 17:33
|
|
|
5
5
|
Desc: 新浪财经-基金行情
|
|
6
6
|
http://vip.stock.finance.sina.com.cn/fund_center/index.html#jjhqetf
|
|
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.stock.cons import hk_js_decode
|
|
13
14
|
from akshare.utils import demjson
|
|
@@ -5,9 +5,10 @@ Date: 2023/6/13 16:12
|
|
|
5
5
|
Desc: 巨潮资讯-数据中心-专题统计-基金报表
|
|
6
6
|
http://webapi.cninfo.com.cn/#/thematicStatistics
|
|
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
|
|
|
@@ -128,23 +129,23 @@ def fund_report_industry_allocation_cninfo(date: str = "20210630") -> pd.DataFra
|
|
|
128
129
|
temp_df = pd.DataFrame(data_json["records"])
|
|
129
130
|
temp_df.rename(
|
|
130
131
|
columns={
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
132
|
+
"F004N": "行业规模",
|
|
133
|
+
"F003N": "基金覆盖家数",
|
|
134
|
+
"F002V": "证监会行业名称",
|
|
135
|
+
"F001V": "行业编码",
|
|
136
|
+
"ENDDATE": "报告期",
|
|
137
|
+
"F005N": "占净资产比例",
|
|
137
138
|
},
|
|
138
139
|
inplace=True,
|
|
139
140
|
)
|
|
140
141
|
temp_df = temp_df[
|
|
141
142
|
[
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
143
|
+
"行业编码",
|
|
144
|
+
"证监会行业名称",
|
|
145
|
+
"报告期",
|
|
146
|
+
"基金覆盖家数",
|
|
147
|
+
"行业规模",
|
|
148
|
+
"占净资产比例",
|
|
148
149
|
]
|
|
149
150
|
]
|
|
150
151
|
temp_df["报告期"] = pd.to_datetime(temp_df["报告期"], errors="coerce").dt.date
|
|
@@ -186,31 +187,39 @@ def fund_report_asset_allocation_cninfo() -> pd.DataFrame:
|
|
|
186
187
|
temp_df = pd.DataFrame(data_json["records"])
|
|
187
188
|
temp_df.rename(
|
|
188
189
|
columns={
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
190
|
+
"F001N": "基金覆盖家数",
|
|
191
|
+
"F008N": "现金货币类占净资产比例",
|
|
192
|
+
"F007N": "债券固定收益类占净资产比例",
|
|
193
|
+
"F006N": "股票权益类占净资产比例",
|
|
194
|
+
"ENDDATE": "报告期",
|
|
195
|
+
"F005N": "基金市场净资产规模",
|
|
195
196
|
},
|
|
196
197
|
inplace=True,
|
|
197
198
|
)
|
|
198
199
|
temp_df = temp_df[
|
|
199
200
|
[
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
201
|
+
"报告期",
|
|
202
|
+
"基金覆盖家数",
|
|
203
|
+
"股票权益类占净资产比例",
|
|
204
|
+
"债券固定收益类占净资产比例",
|
|
205
|
+
"现金货币类占净资产比例",
|
|
206
|
+
"基金市场净资产规模",
|
|
206
207
|
]
|
|
207
208
|
]
|
|
208
209
|
temp_df["报告期"] = pd.to_datetime(temp_df["报告期"], errors="coerce").dt.date
|
|
209
210
|
temp_df["基金覆盖家数"] = pd.to_numeric(temp_df["基金覆盖家数"], errors="coerce")
|
|
210
|
-
temp_df["股票权益类占净资产比例"] = pd.to_numeric(
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
temp_df["
|
|
211
|
+
temp_df["股票权益类占净资产比例"] = pd.to_numeric(
|
|
212
|
+
temp_df["股票权益类占净资产比例"], errors="coerce"
|
|
213
|
+
)
|
|
214
|
+
temp_df["债券固定收益类占净资产比例"] = pd.to_numeric(
|
|
215
|
+
temp_df["债券固定收益类占净资产比例"], errors="coerce"
|
|
216
|
+
)
|
|
217
|
+
temp_df["现金货币类占净资产比例"] = pd.to_numeric(
|
|
218
|
+
temp_df["现金货币类占净资产比例"], errors="coerce"
|
|
219
|
+
)
|
|
220
|
+
temp_df["基金市场净资产规模"] = pd.to_numeric(
|
|
221
|
+
temp_df["基金市场净资产规模"], errors="coerce"
|
|
222
|
+
)
|
|
214
223
|
return temp_df
|
|
215
224
|
|
|
216
225
|
|
|
@@ -218,7 +227,9 @@ if __name__ == "__main__":
|
|
|
218
227
|
fund_report_stock_cninfo_df = fund_report_stock_cninfo(date="20210630")
|
|
219
228
|
print(fund_report_stock_cninfo_df)
|
|
220
229
|
|
|
221
|
-
fund_report_industry_allocation_cninfo_df = fund_report_industry_allocation_cninfo(
|
|
230
|
+
fund_report_industry_allocation_cninfo_df = fund_report_industry_allocation_cninfo(
|
|
231
|
+
date="20210930"
|
|
232
|
+
)
|
|
222
233
|
print(fund_report_industry_allocation_cninfo_df)
|
|
223
234
|
|
|
224
235
|
fund_report_asset_allocation_cninfo_df = fund_report_asset_allocation_cninfo()
|
akshare/index/index_stock_hk.py
CHANGED
akshare/index/index_stock_zh.py
CHANGED
akshare/movie/artist_yien.py
CHANGED
|
@@ -7,13 +7,14 @@ Desc: 艺恩-艺人
|
|
|
7
7
|
艺人流量价值
|
|
8
8
|
https://www.endata.com.cn/Marketing/Artist/business.html
|
|
9
9
|
"""
|
|
10
|
+
|
|
10
11
|
import datetime
|
|
11
12
|
import json
|
|
12
13
|
import os
|
|
13
14
|
|
|
14
15
|
import pandas as pd # type: ignore
|
|
15
16
|
import requests
|
|
16
|
-
|
|
17
|
+
import py_mini_racer # type: ignore
|
|
17
18
|
|
|
18
19
|
|
|
19
20
|
def _get_js_path(name: str = "", module_file: str = "") -> str:
|
|
@@ -80,8 +81,21 @@ def business_value_artist() -> pd.DataFrame:
|
|
|
80
81
|
r.encoding = "utf8"
|
|
81
82
|
data_json = json.loads(decrypt(r.text))
|
|
82
83
|
temp_df = pd.DataFrame(data_json["Data"]["Table"])
|
|
83
|
-
temp_df.columns = [
|
|
84
|
-
|
|
84
|
+
temp_df.columns = [
|
|
85
|
+
"排名",
|
|
86
|
+
"-",
|
|
87
|
+
"艺人",
|
|
88
|
+
"商业价值",
|
|
89
|
+
"-",
|
|
90
|
+
"专业热度",
|
|
91
|
+
"关注热度",
|
|
92
|
+
"预测热度",
|
|
93
|
+
"美誉度",
|
|
94
|
+
"-",
|
|
95
|
+
]
|
|
96
|
+
temp_df = temp_df[
|
|
97
|
+
["排名", "艺人", "商业价值", "专业热度", "关注热度", "预测热度", "美誉度"]
|
|
98
|
+
]
|
|
85
99
|
temp_df["统计日期"] = datetime.datetime.now().date().isoformat()
|
|
86
100
|
return temp_df
|
|
87
101
|
|
|
@@ -105,8 +119,21 @@ def online_value_artist() -> pd.DataFrame:
|
|
|
105
119
|
r.encoding = "utf8"
|
|
106
120
|
data_json = json.loads(decrypt(r.text))
|
|
107
121
|
temp_df = pd.DataFrame(data_json["Data"]["Table"])
|
|
108
|
-
temp_df.columns = [
|
|
109
|
-
|
|
122
|
+
temp_df.columns = [
|
|
123
|
+
"排名",
|
|
124
|
+
"-",
|
|
125
|
+
"艺人",
|
|
126
|
+
"-",
|
|
127
|
+
"流量价值",
|
|
128
|
+
"专业热度",
|
|
129
|
+
"关注热度",
|
|
130
|
+
"预测热度",
|
|
131
|
+
"-",
|
|
132
|
+
"带货力",
|
|
133
|
+
]
|
|
134
|
+
temp_df = temp_df[
|
|
135
|
+
["排名", "艺人", "流量价值", "专业热度", "关注热度", "预测热度", "带货力"]
|
|
136
|
+
]
|
|
110
137
|
temp_df["统计日期"] = datetime.datetime.now().date().isoformat()
|
|
111
138
|
return temp_df
|
|
112
139
|
|
akshare/movie/movie_yien.py
CHANGED
akshare/movie/video_yien.py
CHANGED
|
@@ -8,12 +8,13 @@ Desc: 艺恩
|
|
|
8
8
|
综艺节目
|
|
9
9
|
https://www.endata.com.cn/Video/index.html
|
|
10
10
|
"""
|
|
11
|
+
|
|
11
12
|
import json
|
|
12
13
|
import os
|
|
13
14
|
|
|
14
15
|
import pandas as pd
|
|
15
16
|
import requests
|
|
16
|
-
|
|
17
|
+
import py_mini_racer
|
|
17
18
|
|
|
18
19
|
|
|
19
20
|
def _get_js_path(name: str = "", module_file: str = "") -> str:
|
|
@@ -75,8 +76,19 @@ def video_tv() -> pd.DataFrame:
|
|
|
75
76
|
data_json = json.loads(decrypt(r.text))
|
|
76
77
|
temp_df = pd.DataFrame(data_json["Data"]["Table"])
|
|
77
78
|
report_date = data_json["Data"]["Table1"][0]["MaxDate"]
|
|
78
|
-
temp_df.columns = [
|
|
79
|
-
|
|
79
|
+
temp_df.columns = [
|
|
80
|
+
"排序",
|
|
81
|
+
"名称",
|
|
82
|
+
"类型",
|
|
83
|
+
"播映指数",
|
|
84
|
+
"用户热度",
|
|
85
|
+
"媒体热度",
|
|
86
|
+
"观看度",
|
|
87
|
+
"好评度",
|
|
88
|
+
]
|
|
89
|
+
temp_df = temp_df[
|
|
90
|
+
["排序", "名称", "类型", "播映指数", "媒体热度", "用户热度", "好评度", "观看度"]
|
|
91
|
+
]
|
|
80
92
|
temp_df["统计日期"] = report_date
|
|
81
93
|
return temp_df
|
|
82
94
|
|
|
@@ -95,8 +107,19 @@ def video_variety_show() -> pd.DataFrame:
|
|
|
95
107
|
data_json = json.loads(decrypt(r.text))
|
|
96
108
|
temp_df = pd.DataFrame(data_json["Data"]["Table"])
|
|
97
109
|
report_date = data_json["Data"]["Table1"][0]["MaxDate"]
|
|
98
|
-
temp_df.columns = [
|
|
99
|
-
|
|
110
|
+
temp_df.columns = [
|
|
111
|
+
"排序",
|
|
112
|
+
"名称",
|
|
113
|
+
"类型",
|
|
114
|
+
"播映指数",
|
|
115
|
+
"用户热度",
|
|
116
|
+
"媒体热度",
|
|
117
|
+
"观看度",
|
|
118
|
+
"好评度",
|
|
119
|
+
]
|
|
120
|
+
temp_df = temp_df[
|
|
121
|
+
["排序", "名称", "类型", "播映指数", "媒体热度", "用户热度", "好评度", "观看度"]
|
|
122
|
+
]
|
|
100
123
|
temp_df["统计日期"] = report_date
|
|
101
124
|
return temp_df
|
|
102
125
|
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
#!/usr/bin/env python
|
|
2
2
|
# -*- coding:utf-8 -*-
|
|
3
3
|
"""
|
|
4
|
-
Date:
|
|
4
|
+
Date: 2024/7/19 14:00
|
|
5
5
|
Desc: 商品期权数据
|
|
6
6
|
说明:
|
|
7
7
|
(1) 价格:自2019年12月02日起,纤维板报价单位由元/张改为元/立方米
|
|
@@ -144,10 +144,11 @@ def option_czce_daily(
|
|
|
144
144
|
) -> pd.DataFrame:
|
|
145
145
|
"""
|
|
146
146
|
郑州商品交易所-期权-日频行情数据
|
|
147
|
-
|
|
147
|
+
http://www.czce.com.cn/cn/sspz/dejbqhqq/H770227index_1.htm#tabs-2
|
|
148
148
|
:param trade_date: 交易日
|
|
149
149
|
:type trade_date: str
|
|
150
|
-
:param symbol: choice of {"白糖期权", "棉花期权", "甲醇期权", "PTA期权",
|
|
150
|
+
:param symbol: choice of {"白糖期权", "棉花期权", "甲醇期权", "PTA期权", "菜籽粕期权", "动力煤期权", "短纤期权",
|
|
151
|
+
"菜籽油期权", "花生期权", "棉花期权", "短纤期权", "纯碱期权", "锰硅期权", "硅铁期权", "尿素期权", "对二甲苯期权", "烧碱期权", "玻璃期权"}
|
|
151
152
|
:type symbol: str
|
|
152
153
|
:return: 日频行情数据
|
|
153
154
|
:rtype: pandas.DataFrame
|
|
@@ -157,7 +158,7 @@ def option_czce_daily(
|
|
|
157
158
|
if day.strftime("%Y%m%d") not in calendar:
|
|
158
159
|
warnings.warn("{}非交易日".format(day.strftime("%Y%m%d")))
|
|
159
160
|
return pd.DataFrame()
|
|
160
|
-
if day > datetime.date(2010, 8, 24):
|
|
161
|
+
if day > datetime.date(year=2010, month=8, day=24):
|
|
161
162
|
url = CZCE_DAILY_OPTION_URL_3.format(day.strftime("%Y"), day.strftime("%Y%m%d"))
|
|
162
163
|
try:
|
|
163
164
|
r = requests.get(url)
|
|
@@ -215,6 +216,22 @@ def option_czce_daily(
|
|
|
215
216
|
temp_df = table_df[table_df.iloc[:, 0].str.contains("UR")]
|
|
216
217
|
temp_df.reset_index(inplace=True, drop=True)
|
|
217
218
|
return temp_df.iloc[:-1, :]
|
|
219
|
+
elif symbol == "对二甲苯期权":
|
|
220
|
+
temp_df = table_df[table_df.iloc[:, 0].str.contains("PX")]
|
|
221
|
+
temp_df.reset_index(inplace=True, drop=True)
|
|
222
|
+
return temp_df.iloc[:-1, :]
|
|
223
|
+
elif symbol == "烧碱期权":
|
|
224
|
+
temp_df = table_df[table_df.iloc[:, 0].str.contains("SH")]
|
|
225
|
+
temp_df.reset_index(inplace=True, drop=True)
|
|
226
|
+
return temp_df.iloc[:-1, :]
|
|
227
|
+
elif symbol == "玻璃期权":
|
|
228
|
+
temp_df = table_df[table_df.iloc[:, 0].str.contains("FG")]
|
|
229
|
+
temp_df.reset_index(inplace=True, drop=True)
|
|
230
|
+
return temp_df.iloc[:-1, :]
|
|
231
|
+
elif symbol == "短纤期权":
|
|
232
|
+
temp_df = table_df[table_df.iloc[:, 0].str.contains("PF")]
|
|
233
|
+
temp_df.reset_index(inplace=True, drop=True)
|
|
234
|
+
return temp_df.iloc[:-1, :]
|
|
218
235
|
else:
|
|
219
236
|
temp_df = table_df[table_df.iloc[:, 0].str.contains("AP")]
|
|
220
237
|
temp_df.reset_index(inplace=True, drop=True)
|
|
@@ -485,7 +502,7 @@ def option_gfex_vol_daily(symbol: str = "碳酸锂", trade_date: str = "20230724
|
|
|
485
502
|
|
|
486
503
|
|
|
487
504
|
if __name__ == "__main__":
|
|
488
|
-
option_czce_daily_df = option_czce_daily(symbol="
|
|
505
|
+
option_czce_daily_df = option_czce_daily(symbol="短纤期权", trade_date="20240718")
|
|
489
506
|
print(option_czce_daily_df)
|
|
490
507
|
|
|
491
508
|
option_dce_daily_one, option_dce_daily_two = option_dce_daily(
|
|
@@ -5,9 +5,10 @@ Date: 2023/5/29 23:34
|
|
|
5
5
|
Desc: 巨潮资讯-数据中心-专题统计-公司治理-股权质押
|
|
6
6
|
http://webapi.cninfo.com.cn/#/thematicStatistics
|
|
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
|
|
|
@@ -91,7 +92,9 @@ def stock_cg_equity_mortgage_cninfo(date: str = "20210930") -> pd.DataFrame:
|
|
|
91
92
|
temp_df["质押数量"] = pd.to_numeric(temp_df["质押数量"], errors="coerce")
|
|
92
93
|
temp_df["占总股本比例"] = pd.to_numeric(temp_df["占总股本比例"], errors="coerce")
|
|
93
94
|
temp_df["质押解除数量"] = pd.to_numeric(temp_df["质押解除数量"], errors="coerce")
|
|
94
|
-
temp_df["累计质押占总股本比例"] = pd.to_numeric(
|
|
95
|
+
temp_df["累计质押占总股本比例"] = pd.to_numeric(
|
|
96
|
+
temp_df["累计质押占总股本比例"], errors="coerce"
|
|
97
|
+
)
|
|
95
98
|
return temp_df
|
|
96
99
|
|
|
97
100
|
|
|
@@ -5,45 +5,46 @@ Date: 2021/9/29 16:19
|
|
|
5
5
|
Desc: 巨潮资讯-数据中心-专题统计-公司治理-公司诉讼
|
|
6
6
|
http://webapi.cninfo.com.cn/#/thematicStatistics
|
|
7
7
|
"""
|
|
8
|
+
|
|
8
9
|
import time
|
|
9
10
|
|
|
10
11
|
import pandas as pd
|
|
11
12
|
import requests
|
|
12
|
-
|
|
13
|
+
import py_mini_racer
|
|
13
14
|
|
|
14
15
|
js_str = """
|
|
15
|
-
function mcode(input) {
|
|
16
|
-
var keyStr = "ABCDEFGHIJKLMNOP" + "QRSTUVWXYZabcdef" + "ghijklmnopqrstuv" + "wxyz0123456789+/" + "=";
|
|
17
|
-
var output = "";
|
|
18
|
-
var chr1, chr2, chr3 = "";
|
|
19
|
-
var enc1, enc2, enc3, enc4 = "";
|
|
20
|
-
var i = 0;
|
|
21
|
-
do {
|
|
22
|
-
chr1 = input.charCodeAt(i++);
|
|
23
|
-
chr2 = input.charCodeAt(i++);
|
|
24
|
-
chr3 = input.charCodeAt(i++);
|
|
25
|
-
enc1 = chr1 >> 2;
|
|
26
|
-
enc2 = ((chr1 & 3) << 4) | (chr2 >> 4);
|
|
27
|
-
enc3 = ((chr2 & 15) << 2) | (chr3 >> 6);
|
|
28
|
-
enc4 = chr3 & 63;
|
|
29
|
-
if (isNaN(chr2)) {
|
|
30
|
-
enc3 = enc4 = 64;
|
|
31
|
-
} else if (isNaN(chr3)) {
|
|
32
|
-
enc4 = 64;
|
|
33
|
-
}
|
|
34
|
-
output = output + keyStr.charAt(enc1) + keyStr.charAt(enc2)
|
|
35
|
-
+ keyStr.charAt(enc3) + keyStr.charAt(enc4);
|
|
36
|
-
chr1 = chr2 = chr3 = "";
|
|
37
|
-
enc1 = enc2 = enc3 = enc4 = "";
|
|
38
|
-
} while (i < input.length);
|
|
39
|
-
|
|
40
|
-
return output;
|
|
41
|
-
}
|
|
16
|
+
function mcode(input) {
|
|
17
|
+
var keyStr = "ABCDEFGHIJKLMNOP" + "QRSTUVWXYZabcdef" + "ghijklmnopqrstuv" + "wxyz0123456789+/" + "=";
|
|
18
|
+
var output = "";
|
|
19
|
+
var chr1, chr2, chr3 = "";
|
|
20
|
+
var enc1, enc2, enc3, enc4 = "";
|
|
21
|
+
var i = 0;
|
|
22
|
+
do {
|
|
23
|
+
chr1 = input.charCodeAt(i++);
|
|
24
|
+
chr2 = input.charCodeAt(i++);
|
|
25
|
+
chr3 = input.charCodeAt(i++);
|
|
26
|
+
enc1 = chr1 >> 2;
|
|
27
|
+
enc2 = ((chr1 & 3) << 4) | (chr2 >> 4);
|
|
28
|
+
enc3 = ((chr2 & 15) << 2) | (chr3 >> 6);
|
|
29
|
+
enc4 = chr3 & 63;
|
|
30
|
+
if (isNaN(chr2)) {
|
|
31
|
+
enc3 = enc4 = 64;
|
|
32
|
+
} else if (isNaN(chr3)) {
|
|
33
|
+
enc4 = 64;
|
|
34
|
+
}
|
|
35
|
+
output = output + keyStr.charAt(enc1) + keyStr.charAt(enc2)
|
|
36
|
+
+ keyStr.charAt(enc3) + keyStr.charAt(enc4);
|
|
37
|
+
chr1 = chr2 = chr3 = "";
|
|
38
|
+
enc1 = enc2 = enc3 = enc4 = "";
|
|
39
|
+
} while (i < input.length);
|
|
40
|
+
|
|
41
|
+
return output;
|
|
42
|
+
}
|
|
42
43
|
"""
|
|
43
44
|
|
|
44
45
|
|
|
45
46
|
def stock_cg_lawsuit_cninfo(
|
|
46
|
-
|
|
47
|
+
symbol: str = "全部", start_date: str = "20180630", end_date: str = "20210927"
|
|
47
48
|
) -> pd.DataFrame:
|
|
48
49
|
"""
|
|
49
50
|
巨潮资讯-数据中心-专题统计-公司治理-公司诉讼
|
|
@@ -58,11 +59,11 @@ def stock_cg_lawsuit_cninfo(
|
|
|
58
59
|
:rtype: pandas.DataFrame
|
|
59
60
|
"""
|
|
60
61
|
symbol_map = {
|
|
61
|
-
"全部":
|
|
62
|
-
"深市主板":
|
|
63
|
-
"沪市":
|
|
64
|
-
"创业板":
|
|
65
|
-
"科创板":
|
|
62
|
+
"全部": "",
|
|
63
|
+
"深市主板": "012002",
|
|
64
|
+
"沪市": "012001",
|
|
65
|
+
"创业板": "012015",
|
|
66
|
+
"科创板": "012029",
|
|
66
67
|
}
|
|
67
68
|
url = "http://webapi.cninfo.com.cn/api/sysapi/p_sysapi1055"
|
|
68
69
|
random_time_str = str(int(time.time()))
|
|
@@ -117,4 +118,4 @@ if __name__ == "__main__":
|
|
|
117
118
|
stock_cg_lawsuit_cninfo_df = stock_cg_lawsuit_cninfo(
|
|
118
119
|
symbol="全部", start_date="20180928", end_date="20210927"
|
|
119
120
|
)
|
|
120
|
-
print(stock_cg_lawsuit_cninfo_df)
|
|
121
|
+
print(stock_cg_lawsuit_cninfo_df)
|