mns-common 1.3.5.1__py3-none-any.whl → 1.3.5.3__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 mns-common might be problematic. Click here for more details.
- mns_common/api/em/east_money_debt_api.py +11 -0
- mns_common/api/em/east_money_etf_api.py +7 -0
- mns_common/api/em/east_money_stock_api.py +11 -1
- mns_common/api/em/east_money_stock_hk_api.py +10 -0
- mns_common/api/em/east_money_stock_us_api.py +7 -0
- mns_common/component/classify/symbol_classify_api.py +7 -7
- {mns_common-1.3.5.1.dist-info → mns_common-1.3.5.3.dist-info}/METADATA +1 -1
- {mns_common-1.3.5.1.dist-info → mns_common-1.3.5.3.dist-info}/RECORD +10 -10
- {mns_common-1.3.5.1.dist-info → mns_common-1.3.5.3.dist-info}/WHEEL +0 -0
- {mns_common-1.3.5.1.dist-info → mns_common-1.3.5.3.dist-info}/top_level.txt +0 -0
|
@@ -59,6 +59,17 @@ def get_debt_page_data(fields, pn) -> pd.DataFrame:
|
|
|
59
59
|
try:
|
|
60
60
|
r = requests.get(url, params)
|
|
61
61
|
data_text = r.text
|
|
62
|
+
|
|
63
|
+
if pn == 1:
|
|
64
|
+
try:
|
|
65
|
+
begin_index_total = data_text.index('"total":')
|
|
66
|
+
|
|
67
|
+
end_index_total = data_text.index('"diff"')
|
|
68
|
+
max_number = data_text[begin_index_total + 8:end_index_total - 1]
|
|
69
|
+
except Exception as e:
|
|
70
|
+
logger.error(f"获取第{pn}页可转债列表异常: {e}")
|
|
71
|
+
return pd.DataFrame()
|
|
72
|
+
|
|
62
73
|
begin_index = data_text.index('[')
|
|
63
74
|
end_index = data_text.index(']')
|
|
64
75
|
data_json = data_text[begin_index:end_index + 1]
|
|
@@ -54,6 +54,13 @@ def get_fund_etf_page_df(pn) -> pd.DataFrame:
|
|
|
54
54
|
try:
|
|
55
55
|
r = requests.get(url, timeout=15, params=params)
|
|
56
56
|
data_json = r.json()
|
|
57
|
+
if pn == 1:
|
|
58
|
+
try:
|
|
59
|
+
max_number = data_json['data']['total']
|
|
60
|
+
except Exception as e:
|
|
61
|
+
logger.error(f"获取第{pn}页ETF列表异常: {e}")
|
|
62
|
+
return pd.DataFrame()
|
|
63
|
+
|
|
57
64
|
temp_df = pd.DataFrame(data_json["data"]["diff"])
|
|
58
65
|
temp_df.rename(
|
|
59
66
|
columns={
|
|
@@ -14,7 +14,7 @@ import datetime
|
|
|
14
14
|
from loguru import logger
|
|
15
15
|
|
|
16
16
|
# 最大返回条数
|
|
17
|
-
max_number =
|
|
17
|
+
max_number = 5800
|
|
18
18
|
# 最小返回条数
|
|
19
19
|
min_number = 5600
|
|
20
20
|
# 分页条数
|
|
@@ -50,6 +50,16 @@ def get_stock_page_data(pn, fields, fs):
|
|
|
50
50
|
try:
|
|
51
51
|
r = requests.get(url, params)
|
|
52
52
|
data_text = r.text
|
|
53
|
+
if pn == 1:
|
|
54
|
+
try:
|
|
55
|
+
begin_index_total = data_text.index('"total":')
|
|
56
|
+
|
|
57
|
+
end_index_total = data_text.index('"diff"')
|
|
58
|
+
max_number = data_text[begin_index_total + 8:end_index_total - 1]
|
|
59
|
+
except Exception as e:
|
|
60
|
+
logger.error(f"获取第{pn}页股票列表异常: {e}")
|
|
61
|
+
return pd.DataFrame()
|
|
62
|
+
|
|
53
63
|
begin_index = data_text.index('[')
|
|
54
64
|
end_index = data_text.index(']')
|
|
55
65
|
data_json = data_text[begin_index:end_index + 1]
|
|
@@ -49,6 +49,16 @@ def hk_real_time_quotes_page_df(cookie, pn):
|
|
|
49
49
|
r = requests.get(url_new, headers=headers)
|
|
50
50
|
result = r.content.decode("utf-8")
|
|
51
51
|
|
|
52
|
+
if pn == 1:
|
|
53
|
+
try:
|
|
54
|
+
begin_index_total = result.index('"total":')
|
|
55
|
+
|
|
56
|
+
end_index_total = result.index('"diff"')
|
|
57
|
+
max_number = result[begin_index_total + 8:end_index_total - 1]
|
|
58
|
+
except Exception as e:
|
|
59
|
+
logger.error(f"获取第{pn}页港股列表异常: {e}")
|
|
60
|
+
return pd.DataFrame()
|
|
61
|
+
|
|
52
62
|
startIndex = result.index('"diff"')
|
|
53
63
|
endIndex = result.index('}]}')
|
|
54
64
|
|
|
@@ -46,6 +46,13 @@ def us_real_time_quotes_page_df(cookie, pn):
|
|
|
46
46
|
}
|
|
47
47
|
r = requests.get(url, params=params, headers=headers, timeout=15)
|
|
48
48
|
data_json = r.json()
|
|
49
|
+
if pn == 1:
|
|
50
|
+
try:
|
|
51
|
+
max_number = data_json['data']['total']
|
|
52
|
+
except Exception as e:
|
|
53
|
+
logger.error(f"获取第{pn}页美股列表异常: {e}")
|
|
54
|
+
return pd.DataFrame()
|
|
55
|
+
|
|
49
56
|
if not data_json["data"]["diff"]:
|
|
50
57
|
return pd.DataFrame()
|
|
51
58
|
temp_df = pd.DataFrame(data_json["data"]["diff"]).T
|
|
@@ -35,26 +35,26 @@ def set_stock_type_by_deal_days(real_time_quotes_now_init):
|
|
|
35
35
|
real_time_quotes_now.loc[:, "stock_type"] = stock_type_classify_param['normal_stock']
|
|
36
36
|
# 交易天数五个交易日的股票
|
|
37
37
|
real_time_quotes_now.loc[(real_time_quotes_now['name'].str.startswith('C'))
|
|
38
|
-
| (real_time_quotes_now['deal_days']
|
|
38
|
+
| (real_time_quotes_now['deal_days'] < stock_type_classify_param[
|
|
39
39
|
'sub_stock_new_min_deal_days']), "stock_type"] = stock_type_classify_param['new_stock']
|
|
40
40
|
|
|
41
41
|
# 交易上市6-100天的次新股票
|
|
42
42
|
real_time_quotes_now.loc[
|
|
43
43
|
(real_time_quotes_now['stock_type'] != stock_type_classify_param['new_stock'])
|
|
44
|
-
& (real_time_quotes_now['deal_days']
|
|
45
|
-
& (real_time_quotes_now['deal_days']
|
|
44
|
+
& (real_time_quotes_now['deal_days'] >= stock_type_classify_param['sub_stock_new_min_deal_days'])
|
|
45
|
+
& (real_time_quotes_now['deal_days'] < stock_type_classify_param['sub_new_stock_max_deal_days']),
|
|
46
46
|
"stock_type"] = stock_type_classify_param['sub_stock_new']
|
|
47
47
|
|
|
48
48
|
# 上市次新股 100-365
|
|
49
49
|
real_time_quotes_now.loc[
|
|
50
|
-
(real_time_quotes_now['deal_days']
|
|
51
|
-
& (real_time_quotes_now['deal_days']
|
|
50
|
+
(real_time_quotes_now['deal_days'] >= stock_type_classify_param['sub_new_stock_max_deal_days'])
|
|
51
|
+
& (real_time_quotes_now['deal_days'] < stock_type_classify_param['sub_stock_max_deal_days']),
|
|
52
52
|
"stock_type"] = stock_type_classify_param['sub_stock']
|
|
53
53
|
|
|
54
54
|
# 交易天数 366-730
|
|
55
55
|
real_time_quotes_now.loc[
|
|
56
|
-
(real_time_quotes_now['deal_days']
|
|
57
|
-
& (real_time_quotes_now['deal_days']
|
|
56
|
+
(real_time_quotes_now['deal_days'] >= stock_type_classify_param['sub_stock_max_deal_days'])
|
|
57
|
+
& (real_time_quotes_now['deal_days'] < stock_type_classify_param['normal_stock_max_deal_days']),
|
|
58
58
|
"stock_type"] = stock_type_classify_param['normal_sub_stock']
|
|
59
59
|
|
|
60
60
|
return real_time_quotes_now
|
|
@@ -8,12 +8,12 @@ mns_common/api/akshare/stock_zb_pool.py,sha256=ylcVgZTzsD3qz9WaItLtoqTf4t-Ex49MD
|
|
|
8
8
|
mns_common/api/akshare/stock_zt_pool_api.py,sha256=_4PG_Wd88S4zweKNwZprwxaMMHBF4OQSB77DGW1l9UQ,1929
|
|
9
9
|
mns_common/api/akshare/yjyg_sync_api.py,sha256=cvk50_XhJWUqduOiC15SYvQTCQqECt6td_L2Hvnl7Jg,4108
|
|
10
10
|
mns_common/api/em/__init__.py,sha256=2U9DiKslxsWwLLEcZKjS8UiQPN1QgALvnK3HiJNIZE0,163
|
|
11
|
-
mns_common/api/em/east_money_debt_api.py,sha256=
|
|
12
|
-
mns_common/api/em/east_money_etf_api.py,sha256=
|
|
13
|
-
mns_common/api/em/east_money_stock_api.py,sha256=
|
|
11
|
+
mns_common/api/em/east_money_debt_api.py,sha256=2_iGouYQggVwf0a_DoxXoD2LzZrSpHbZSiRvt_8PP1A,14549
|
|
12
|
+
mns_common/api/em/east_money_etf_api.py,sha256=axovA3gbNrsXCPEn4Yk_Qsf1IePGYeXi93JlB1unz-g,14233
|
|
13
|
+
mns_common/api/em/east_money_stock_api.py,sha256=XKk0DQ2xXMwsLZbTI5yivSki3rD7VutuV-qv1J0ZNWI,9852
|
|
14
14
|
mns_common/api/em/east_money_stock_gdfx_free_top_10_api.py,sha256=jVy3fNdrkLq3ri7yUwXWt0ItB8LCHzt9CPz91Fj8sPA,9198
|
|
15
|
-
mns_common/api/em/east_money_stock_hk_api.py,sha256=
|
|
16
|
-
mns_common/api/em/east_money_stock_us_api.py,sha256=
|
|
15
|
+
mns_common/api/em/east_money_stock_hk_api.py,sha256=WkQJOs_KV1mLWN-v_ZWr_ekNiJoWRFH_iSxfYA78Uao,14748
|
|
16
|
+
mns_common/api/em/east_money_stock_us_api.py,sha256=XwfvM4ZGxWJ_W8PMVAetXtJLltMrGEY1XE6z5xhqe9M,11260
|
|
17
17
|
mns_common/api/em/east_money_stock_v2_api.py,sha256=NsieWF7v-RGGQt7uhTOgH9-bghKWJRDSaqsO9-diKvU,16120
|
|
18
18
|
mns_common/api/em/em_concept_index_api.py,sha256=PP87ES8a_y0o3SKLzBsPrc7DCPI3MBCD-4SmoUUirl0,8285
|
|
19
19
|
mns_common/api/hk/__init__.py,sha256=wEg73KlZo-dU0yKGwpA1C2y6LZm4IBb94tNda1tqLeg,163
|
|
@@ -70,7 +70,7 @@ mns_common/component/common_service_fun_api.py,sha256=H7HZ-6uxup5unWe2JazNw_EBML
|
|
|
70
70
|
mns_common/component/cache/__init__.py,sha256=2U9DiKslxsWwLLEcZKjS8UiQPN1QgALvnK3HiJNIZE0,163
|
|
71
71
|
mns_common/component/cache/cache_service.py,sha256=QX7tjR1iGsoCyGt6O41w8aRbZ-3xXQ-53Ps3nmUzAGQ,809
|
|
72
72
|
mns_common/component/classify/__init__.py,sha256=wEg73KlZo-dU0yKGwpA1C2y6LZm4IBb94tNda1tqLeg,163
|
|
73
|
-
mns_common/component/classify/symbol_classify_api.py,sha256=
|
|
73
|
+
mns_common/component/classify/symbol_classify_api.py,sha256=uccN15MNvkZQX0l_oZ47FqjivjQFqidlyw68Xs8uDL8,8138
|
|
74
74
|
mns_common/component/classify/symbol_classify_param.py,sha256=ZOXoZeZ2grVACrpRCQyTF6_NEI9fI-tspYj7jubnkmc,1356
|
|
75
75
|
mns_common/component/company/__init__.py,sha256=2U9DiKslxsWwLLEcZKjS8UiQPN1QgALvnK3HiJNIZE0,163
|
|
76
76
|
mns_common/component/company/company_common_service_api.py,sha256=pqb11v5y0uFWJtqA7K-AMf6hzyrFUq_OVpvr7uaWOow,8252
|
|
@@ -136,7 +136,7 @@ mns_common/utils/date_handle_util.py,sha256=XS-MyA8_7k35LOCFAYOHgVcVkMft_Kc4Wa9U
|
|
|
136
136
|
mns_common/utils/db_util.py,sha256=hSmfNAN4vEeEaUva6_cicZEhb2jSnib-Gvk2reke1vc,2590
|
|
137
137
|
mns_common/utils/file_util.py,sha256=egWu6PenGPRp_ixrNTHKarT4dAnOT6FETR82EHUZJnQ,1042
|
|
138
138
|
mns_common/utils/ip_util.py,sha256=UTcYfz_uytB__6nlBf7T-izuI7hi4XdB6ET0sJgEel4,969
|
|
139
|
-
mns_common-1.3.5.
|
|
140
|
-
mns_common-1.3.5.
|
|
141
|
-
mns_common-1.3.5.
|
|
142
|
-
mns_common-1.3.5.
|
|
139
|
+
mns_common-1.3.5.3.dist-info/METADATA,sha256=0ZMsA7xlSdOKayA18Gx8TMBICGbH0feGBT9FbOZ1MyQ,61
|
|
140
|
+
mns_common-1.3.5.3.dist-info/WHEEL,sha256=tZoeGjtWxWRfdplE7E3d45VPlLNQnvbKiYnx7gwAy8A,92
|
|
141
|
+
mns_common-1.3.5.3.dist-info/top_level.txt,sha256=ZC58kAR-8Hvc6U2xhYNBNLAh3mb6sZazbdj5nZpvEkQ,11
|
|
142
|
+
mns_common-1.3.5.3.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|