mns-common 1.2.4.6__py3-none-any.whl → 1.2.4.8__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/ths/zt/ths_stock_zt_pool_v2_api.py +23 -5
- mns_common/component/company/company_hk_service_api.py +25 -0
- {mns_common-1.2.4.6.dist-info → mns_common-1.2.4.8.dist-info}/METADATA +1 -1
- {mns_common-1.2.4.6.dist-info → mns_common-1.2.4.8.dist-info}/RECORD +6 -5
- {mns_common-1.2.4.6.dist-info → mns_common-1.2.4.8.dist-info}/WHEEL +0 -0
- {mns_common-1.2.4.6.dist-info → mns_common-1.2.4.8.dist-info}/top_level.txt +0 -0
|
@@ -70,6 +70,7 @@ def get_ths_stock_zt_reason_with_cache(str_day):
|
|
|
70
70
|
return stock_zt_reason
|
|
71
71
|
|
|
72
72
|
|
|
73
|
+
# 数据不对 todo
|
|
73
74
|
def get_zt_reason(str_day):
|
|
74
75
|
if data_frame_util.is_string_not_empty(str_day):
|
|
75
76
|
key_word = str_day + '涨停'
|
|
@@ -98,12 +99,13 @@ def get_zt_reason(str_day):
|
|
|
98
99
|
"a股市值(不含限售股)" + no_slash_day: "flow_mv",
|
|
99
100
|
"几天几板" + no_slash_day: "statistics_detail",
|
|
100
101
|
"涨停类型" + no_slash_day: "zt_type",
|
|
101
|
-
"code": "symbol",
|
|
102
102
|
"最新价": "now_price",
|
|
103
103
|
"最新涨跌幅": "chg",
|
|
104
|
+
"code": "simple_code",
|
|
104
105
|
|
|
105
106
|
})
|
|
106
|
-
zt_df['
|
|
107
|
+
zt_df['code'] = zt_df['code'].astype(str)
|
|
108
|
+
zt_df['symbol'] = zt_df['code'].astype(str).str.slice(0, 6)
|
|
107
109
|
if 'statistics_detail' in zt_df.columns:
|
|
108
110
|
zt_df['statistics'] = zt_df['statistics_detail'].apply(convert_statistics)
|
|
109
111
|
if 'code' in zt_df.columns:
|
|
@@ -113,6 +115,8 @@ def get_zt_reason(str_day):
|
|
|
113
115
|
zt_df['zt_flag'] = True
|
|
114
116
|
zt_df['str_day'] = str_day
|
|
115
117
|
zt_df = zt_df.fillna('')
|
|
118
|
+
# 渣渣有重复的数据
|
|
119
|
+
zt_df.drop_duplicates('symbol', keep='last', inplace=True)
|
|
116
120
|
return zt_df
|
|
117
121
|
|
|
118
122
|
|
|
@@ -146,6 +150,7 @@ def get_real_time_zt_info():
|
|
|
146
150
|
'chg',
|
|
147
151
|
'amount',
|
|
148
152
|
'quantity_ratio',
|
|
153
|
+
'now_price',
|
|
149
154
|
'high',
|
|
150
155
|
'low',
|
|
151
156
|
'open',
|
|
@@ -279,11 +284,18 @@ def merge_zt_reason(now_zt_pool_df, str_day, last_trade_zt):
|
|
|
279
284
|
left_index=True, right_index=True)
|
|
280
285
|
now_zt_pool_df.dropna(subset=['symbol'], inplace=True)
|
|
281
286
|
return now_zt_pool_df
|
|
282
|
-
zt_reason_df = zt_reason_df[['symbol', 'zt_reason']]
|
|
283
287
|
|
|
284
|
-
|
|
288
|
+
zt_reason_df_copy = zt_reason_df.copy()
|
|
289
|
+
zt_reason_df_copy = zt_reason_df_copy[['symbol', 'zt_reason']]
|
|
290
|
+
zt_reason_df_copy.symbol = zt_reason_df_copy.symbol.astype(str)
|
|
291
|
+
zt_reason_df_copy = zt_reason_df_copy.set_index(['symbol'], drop=True)
|
|
285
292
|
now_zt_pool_df = now_zt_pool_df.set_index(['symbol'], drop=False)
|
|
286
|
-
|
|
293
|
+
|
|
294
|
+
# 检查索引是否有重复
|
|
295
|
+
print("now_zt_pool_df 索引是否有重复:", now_zt_pool_df.index.duplicated().any())
|
|
296
|
+
print("zt_reason_df 索引是否有重复:", zt_reason_df_copy.index.duplicated().any())
|
|
297
|
+
|
|
298
|
+
result_zt_df = pd.merge(now_zt_pool_df, zt_reason_df_copy, how='outer',
|
|
287
299
|
left_index=True, right_index=True)
|
|
288
300
|
|
|
289
301
|
# 找出 'symbol' 列中为 NaN 值的数据
|
|
@@ -362,6 +374,12 @@ def zt_reason_group(zt_pool_df):
|
|
|
362
374
|
|
|
363
375
|
|
|
364
376
|
if __name__ == '__main__':
|
|
377
|
+
str_day_test = '2024-09-27'
|
|
378
|
+
em_now_zt_pool_test = stock_zt_pool_api.stock_em_zt_pool_df(date_handle_util.no_slash_date(str_day_test))
|
|
379
|
+
ths_zt_pool_df = get_zt_reason(str_day_test)
|
|
380
|
+
|
|
381
|
+
em_now_zt_pool_test.loc[~(em_now_zt_pool_test['symbol'].isin(ths_zt_pool_df['symbol']))]
|
|
382
|
+
|
|
365
383
|
while True:
|
|
366
384
|
result_zt_df_test = get_now_zt_pool_with_reason('2024-09-27')
|
|
367
385
|
zt_reason_group(result_zt_df_test)
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import sys
|
|
2
|
+
import os
|
|
3
|
+
|
|
4
|
+
file_path = os.path.abspath(__file__)
|
|
5
|
+
end = file_path.index('mns') + 14
|
|
6
|
+
project_path = file_path[0:end]
|
|
7
|
+
sys.path.append(project_path)
|
|
8
|
+
from functools import lru_cache
|
|
9
|
+
from mns_common.db.MongodbUtil import MongodbUtil
|
|
10
|
+
import pandas as pd
|
|
11
|
+
import mns_common.utils.data_frame_util as data_frame_util
|
|
12
|
+
import mns_common.component.common_service_fun_api as common_service_fun_api
|
|
13
|
+
import mns_common.constant.db_name_constant as db_name_constant
|
|
14
|
+
|
|
15
|
+
mongodb_util = MongodbUtil('27017')
|
|
16
|
+
|
|
17
|
+
|
|
18
|
+
@lru_cache(maxsize=None)
|
|
19
|
+
def get_hk_company_info():
|
|
20
|
+
query_field = {'symbol': 1,
|
|
21
|
+
'name': 1,
|
|
22
|
+
'industry': 1,
|
|
23
|
+
'hk_ggt': 1}
|
|
24
|
+
return mongodb_util.find_query_data_choose_field(db_name_constant.COMPANY_INFO_HK,
|
|
25
|
+
{}, query_field)
|
|
@@ -50,7 +50,7 @@ mns_common/api/ths/wen_cai/__init__.py,sha256=2U9DiKslxsWwLLEcZKjS8UiQPN1QgALvnK
|
|
|
50
50
|
mns_common/api/ths/wen_cai/ths_wen_cai_api.py,sha256=TiDbKIB57ARrnGb70vSJ7-c7lodQqivwlC2IWs95xFw,4718
|
|
51
51
|
mns_common/api/ths/zt/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
52
52
|
mns_common/api/ths/zt/ths_stock_zt_pool_api.py,sha256=GIYdc5J7ZrV25Elbf0n3bBZOc7x4OrlI0jFrO3du8lY,10756
|
|
53
|
-
mns_common/api/ths/zt/ths_stock_zt_pool_v2_api.py,sha256=
|
|
53
|
+
mns_common/api/ths/zt/ths_stock_zt_pool_v2_api.py,sha256=rJztLcoVohPyicqjuimUp-GFfIssiY2Z0OsMQ_nCbho,16653
|
|
54
54
|
mns_common/component/__init__.py,sha256=8b2PuXJM5fLoq71cWPXp695czQuaRtyR6OVHajGjDPc,161
|
|
55
55
|
mns_common/component/common_service_fun_api.py,sha256=PLKsIJxlI_MPHeU8s70ncBtKpo1xkFrCE1e1LfWMK7Q,4995
|
|
56
56
|
mns_common/component/cache/__init__.py,sha256=2U9DiKslxsWwLLEcZKjS8UiQPN1QgALvnK3HiJNIZE0,163
|
|
@@ -61,6 +61,7 @@ mns_common/component/classify/symbol_classify_param.py,sha256=ZOXoZeZ2grVACrpRCQ
|
|
|
61
61
|
mns_common/component/company/__init__.py,sha256=2U9DiKslxsWwLLEcZKjS8UiQPN1QgALvnK3HiJNIZE0,163
|
|
62
62
|
mns_common/component/company/company_common_service_api.py,sha256=HHnLkhMgaOk6ZZoOJ2-E_R7-WeX1q0HtLM2IPAk06WE,7992
|
|
63
63
|
mns_common/component/company/company_common_service_new_api.py,sha256=r7pP88K5mK8t-TFzntdOh-HvsaEXE1_FUHZTq1QPPBw,4904
|
|
64
|
+
mns_common/component/company/company_hk_service_api.py,sha256=mHe5eBHV6v-0s5bUg0RutlerHsHLzmULrMlMFGdlgqM,859
|
|
64
65
|
mns_common/component/concept/__init__.py,sha256=2U9DiKslxsWwLLEcZKjS8UiQPN1QgALvnK3HiJNIZE0,163
|
|
65
66
|
mns_common/component/concept/kpl_concept_common_service_api.py,sha256=Ruc3INOhVjB0X1LeMRX0zL3uhv9OLweG2hj6wkZffow,3235
|
|
66
67
|
mns_common/component/concept/ths_concept_common_service_api.py,sha256=KkbEnBTz3HZs8mSJ-2FX-UrPSlJfMOd8xSXRmtDpqPc,9682
|
|
@@ -112,7 +113,7 @@ mns_common/utils/date_handle_util.py,sha256=qkEyKLYiVq6qpKVp32MLKwRtGKVBK6AY5at2
|
|
|
112
113
|
mns_common/utils/db_util.py,sha256=hSmfNAN4vEeEaUva6_cicZEhb2jSnib-Gvk2reke1vc,2590
|
|
113
114
|
mns_common/utils/file_util.py,sha256=egWu6PenGPRp_ixrNTHKarT4dAnOT6FETR82EHUZJnQ,1042
|
|
114
115
|
mns_common/utils/ip_util.py,sha256=UTcYfz_uytB__6nlBf7T-izuI7hi4XdB6ET0sJgEel4,969
|
|
115
|
-
mns_common-1.2.4.
|
|
116
|
-
mns_common-1.2.4.
|
|
117
|
-
mns_common-1.2.4.
|
|
118
|
-
mns_common-1.2.4.
|
|
116
|
+
mns_common-1.2.4.8.dist-info/METADATA,sha256=s2_B_ZGP5eJPa7pD6qSYCe5oiUr64ZWl-UcrBqQBPM8,61
|
|
117
|
+
mns_common-1.2.4.8.dist-info/WHEEL,sha256=GJ7t_kWBFywbagK5eo9IoUwLW6oyOeTKmQ-9iHFVNxQ,92
|
|
118
|
+
mns_common-1.2.4.8.dist-info/top_level.txt,sha256=ZC58kAR-8Hvc6U2xhYNBNLAh3mb6sZazbdj5nZpvEkQ,11
|
|
119
|
+
mns_common-1.2.4.8.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|