mns-common 1.2.6.2__py3-none-any.whl → 1.2.6.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/ths/concept/app/ths_concept_index_app.py +31 -25
- mns_common/api/ths/zt/ths_stock_zt_pool_v2_api.py +14 -19
- {mns_common-1.2.6.2.dist-info → mns_common-1.2.6.3.dist-info}/METADATA +1 -1
- {mns_common-1.2.6.2.dist-info → mns_common-1.2.6.3.dist-info}/RECORD +6 -6
- {mns_common-1.2.6.2.dist-info → mns_common-1.2.6.3.dist-info}/WHEEL +0 -0
- {mns_common-1.2.6.2.dist-info → mns_common-1.2.6.3.dist-info}/top_level.txt +0 -0
|
@@ -12,8 +12,8 @@ import requests
|
|
|
12
12
|
import pandas as pd
|
|
13
13
|
|
|
14
14
|
'''
|
|
15
|
-
begin_time:开始时间
|
|
16
|
-
end_time
|
|
15
|
+
begin_time:开始时间 只能是交易时间
|
|
16
|
+
end_time: 结束时间 只能是交易时间
|
|
17
17
|
page_size:分页大小
|
|
18
18
|
type: 类型 1:行业 2 概念 3 风格 4 地域
|
|
19
19
|
地址:https://eq.10jqka.com.cn/webpage/sector-retrospect/home.html#/
|
|
@@ -147,28 +147,34 @@ def get_new_concept_from_app_search(symbol: str = "886019"):
|
|
|
147
147
|
return None
|
|
148
148
|
|
|
149
149
|
|
|
150
|
-
from
|
|
150
|
+
from mns_common.db.MongodbUtil import MongodbUtil
|
|
151
151
|
|
|
152
|
+
mongodb_util = MongodbUtil('27017')
|
|
152
153
|
if __name__ == '__main__':
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
154
|
+
end_time_test = '20241009093000'
|
|
155
|
+
result_df_test = get_ths_concept_his_info('20241009093000', end_time_test, 500, 2)
|
|
156
|
+
result_df_test['_id'] = result_df_test['block_code']
|
|
157
|
+
mongodb_util.save_mongo(result_df_test, 'ths_concept_info')
|
|
158
|
+
print(result_df_test)
|
|
159
|
+
|
|
160
|
+
# while True:
|
|
161
|
+
# now_date = datetime.now()
|
|
162
|
+
# str_day = now_date.strftime('%Y%m%d')
|
|
163
|
+
# hour = now_date.hour
|
|
164
|
+
# minute = now_date.minute
|
|
165
|
+
# second = now_date.second
|
|
166
|
+
# second = 0
|
|
167
|
+
# if hour < 10:
|
|
168
|
+
# hour = '0' + str(hour)
|
|
169
|
+
# if minute < 10:
|
|
170
|
+
# minute = '0' + str(minute)
|
|
171
|
+
# if second < 10:
|
|
172
|
+
# second = '0' + str(second)
|
|
173
|
+
#
|
|
174
|
+
# end_time_test = str_day + str(hour) + str(minute) + str(second)
|
|
175
|
+
# end_time_test = str(end_time_test)
|
|
176
|
+
#
|
|
177
|
+
# result_df_test = get_ths_concept_his_info('20241008093000', end_time_test, 500, 2)
|
|
178
|
+
# print(result_df_test)
|
|
179
|
+
# search_result = get_new_concept_from_app_search('886078')
|
|
180
|
+
# print(search_result)
|
|
@@ -54,11 +54,11 @@ mongodb_util = MongodbUtil('27017')
|
|
|
54
54
|
|
|
55
55
|
# 缓存key
|
|
56
56
|
THS_NOW_ZT_POOL = 'ths_now_zt_pool'
|
|
57
|
-
# 缓存过期时间
|
|
57
|
+
# 缓存过期时间 一分钟
|
|
58
58
|
CACHE_TIME_OUT_TIME = 60
|
|
59
59
|
|
|
60
60
|
|
|
61
|
-
# 频繁调用容易被封
|
|
61
|
+
# 频繁调用容易被封 设置缓存
|
|
62
62
|
def get_ths_stock_zt_reason_with_cache(str_day):
|
|
63
63
|
stock_zt_reason = cache_service.get_cache(THS_NOW_ZT_POOL)
|
|
64
64
|
if data_frame_util.is_empty(stock_zt_reason):
|
|
@@ -79,7 +79,7 @@ def get_zt_reason(str_day):
|
|
|
79
79
|
zt_df = ths_wen_cai_api.wen_cai_api(key_word, 'stock')
|
|
80
80
|
if data_frame_util.is_empty(zt_df):
|
|
81
81
|
return None
|
|
82
|
-
zt_df.fillna('', inplace=True)
|
|
82
|
+
zt_df.fillna('0', inplace=True)
|
|
83
83
|
no_slash_day = date_handle_util.no_slash_date(str_day)
|
|
84
84
|
no_slash_day = "[" + no_slash_day + "]"
|
|
85
85
|
zt_df = zt_df.rename(columns={
|
|
@@ -114,7 +114,6 @@ def get_zt_reason(str_day):
|
|
|
114
114
|
del zt_df['flow_mv']
|
|
115
115
|
zt_df['zt_flag'] = True
|
|
116
116
|
zt_df['str_day'] = str_day
|
|
117
|
-
zt_df = zt_df.fillna('')
|
|
118
117
|
# 渣渣有重复的数据
|
|
119
118
|
zt_df.drop_duplicates('symbol', keep='last', inplace=True)
|
|
120
119
|
return zt_df
|
|
@@ -188,7 +187,7 @@ def get_real_time_zt_info():
|
|
|
188
187
|
real_time_df_zt = common_service_fun_api.total_mv_classification(real_time_df_zt)
|
|
189
188
|
real_time_df_zt = common_service_fun_api.symbol_amount_simple(real_time_df_zt)
|
|
190
189
|
real_time_df_zt = common_service_fun_api.exclude_new_stock(real_time_df_zt)
|
|
191
|
-
real_time_df_zt.fillna(0, inplace=True)
|
|
190
|
+
real_time_df_zt.fillna('0', inplace=True)
|
|
192
191
|
real_time_df_zt['chg'] = real_time_df_zt['chg'].astype(float)
|
|
193
192
|
real_time_df_zt['chg'] = round(
|
|
194
193
|
real_time_df_zt['chg'], 2)
|
|
@@ -305,20 +304,15 @@ def merge_zt_reason(now_zt_pool_df, str_day, last_trade_zt):
|
|
|
305
304
|
zt_reason_na = zt_reason_na.set_index(['symbol'], drop=False)
|
|
306
305
|
zt_reason_na = pd.merge(zt_reason_na, last_trade_zt_copy, how='outer',
|
|
307
306
|
left_index=True, right_index=True)
|
|
308
|
-
zt_reason_na['zt_reason'] = zt_reason_na['zt_reason'].fillna('
|
|
309
|
-
|
|
307
|
+
zt_reason_na['zt_reason'] = zt_reason_na['zt_reason'].fillna('0')
|
|
310
308
|
# 删除昨日涨停 今日未涨停的
|
|
311
309
|
zt_reason_na.dropna(subset=['symbol'], inplace=True)
|
|
312
|
-
|
|
313
310
|
result = pd.concat([zt_reason_na,
|
|
314
311
|
zt_reason_not_na])
|
|
315
|
-
|
|
316
312
|
result.dropna(subset=['symbol'], inplace=True)
|
|
317
313
|
result.drop_duplicates('symbol', keep='last', inplace=True)
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
'': '其他',
|
|
321
|
-
'0': '其他', })
|
|
314
|
+
result['zt_reason'] = result['zt_reason'].replace({0: '0',
|
|
315
|
+
'': '0'})
|
|
322
316
|
|
|
323
317
|
return result
|
|
324
318
|
|
|
@@ -372,13 +366,14 @@ def zt_reason_group(zt_pool_df):
|
|
|
372
366
|
|
|
373
367
|
|
|
374
368
|
if __name__ == '__main__':
|
|
375
|
-
str_day_test = '2024-09
|
|
369
|
+
str_day_test = '2024-10-09'
|
|
370
|
+
|
|
371
|
+
# 东财涨停池
|
|
376
372
|
em_now_zt_pool_test = stock_zt_pool_api.stock_em_zt_pool_df(date_handle_util.no_slash_date(str_day_test))
|
|
373
|
+
# 同花顺涨停
|
|
377
374
|
ths_zt_pool_df = get_zt_reason(str_day_test)
|
|
378
375
|
|
|
379
|
-
em_now_zt_pool_test.loc[~(em_now_zt_pool_test['symbol'].isin(ths_zt_pool_df['symbol']))]
|
|
376
|
+
miss_zt_df = em_now_zt_pool_test.loc[~(em_now_zt_pool_test['symbol'].isin(ths_zt_pool_df['symbol']))]
|
|
377
|
+
pass
|
|
378
|
+
|
|
380
379
|
|
|
381
|
-
while True:
|
|
382
|
-
result_zt_df_test = get_now_zt_pool_with_reason(str_day_test)
|
|
383
|
-
zt_reason_group(result_zt_df_test)
|
|
384
|
-
logger.info(1)
|
|
@@ -42,7 +42,7 @@ mns_common/api/ths/big_deal/ths_big_deal_api.py,sha256=gxtIUbowxx8gDJZfT2RISrhXV
|
|
|
42
42
|
mns_common/api/ths/concept/__init__.py,sha256=2U9DiKslxsWwLLEcZKjS8UiQPN1QgALvnK3HiJNIZE0,163
|
|
43
43
|
mns_common/api/ths/concept/app/__init__.py,sha256=2U9DiKslxsWwLLEcZKjS8UiQPN1QgALvnK3HiJNIZE0,163
|
|
44
44
|
mns_common/api/ths/concept/app/ths_concept_detail_app.py,sha256=pPrpntV1tQlgdsSeHaNfde-Q6RM_bRH2kVH_MCloW8s,7087
|
|
45
|
-
mns_common/api/ths/concept/app/ths_concept_index_app.py,sha256=
|
|
45
|
+
mns_common/api/ths/concept/app/ths_concept_index_app.py,sha256=J7gnh_JHxnVaHH-7n66E4rsN8-ndIT-oEnj49GGYb1Q,7828
|
|
46
46
|
mns_common/api/ths/concept/web/__init__.py,sha256=2U9DiKslxsWwLLEcZKjS8UiQPN1QgALvnK3HiJNIZE0,163
|
|
47
47
|
mns_common/api/ths/concept/web/ths_common_js_api.py,sha256=ekU9BtSX0xFkeFDVn9QQG_qgQXhpSmZKGKpgkDbeYk4,381
|
|
48
48
|
mns_common/api/ths/concept/web/ths_company_info_web.py,sha256=Q_yofooG5ruwWQRDIieTqDiKWcfr8cGSLghLLsmoyVg,6670
|
|
@@ -54,7 +54,7 @@ mns_common/api/ths/wen_cai/__init__.py,sha256=2U9DiKslxsWwLLEcZKjS8UiQPN1QgALvnK
|
|
|
54
54
|
mns_common/api/ths/wen_cai/ths_wen_cai_api.py,sha256=TiDbKIB57ARrnGb70vSJ7-c7lodQqivwlC2IWs95xFw,4718
|
|
55
55
|
mns_common/api/ths/zt/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
56
56
|
mns_common/api/ths/zt/ths_stock_zt_pool_api.py,sha256=GIYdc5J7ZrV25Elbf0n3bBZOc7x4OrlI0jFrO3du8lY,10756
|
|
57
|
-
mns_common/api/ths/zt/ths_stock_zt_pool_v2_api.py,sha256=
|
|
57
|
+
mns_common/api/ths/zt/ths_stock_zt_pool_v2_api.py,sha256=ohkeXyUSvxie2YqFPxqy9eLAHyFKQ5nx9U0JcR5LKeQ,16349
|
|
58
58
|
mns_common/component/__init__.py,sha256=8b2PuXJM5fLoq71cWPXp695czQuaRtyR6OVHajGjDPc,161
|
|
59
59
|
mns_common/component/common_service_fun_api.py,sha256=71_w6mKAmdISumjlc5xPPMmO8W_nWeiw11arRohh9Ts,5211
|
|
60
60
|
mns_common/component/cache/__init__.py,sha256=2U9DiKslxsWwLLEcZKjS8UiQPN1QgALvnK3HiJNIZE0,163
|
|
@@ -118,7 +118,7 @@ mns_common/utils/date_handle_util.py,sha256=qkEyKLYiVq6qpKVp32MLKwRtGKVBK6AY5at2
|
|
|
118
118
|
mns_common/utils/db_util.py,sha256=hSmfNAN4vEeEaUva6_cicZEhb2jSnib-Gvk2reke1vc,2590
|
|
119
119
|
mns_common/utils/file_util.py,sha256=egWu6PenGPRp_ixrNTHKarT4dAnOT6FETR82EHUZJnQ,1042
|
|
120
120
|
mns_common/utils/ip_util.py,sha256=UTcYfz_uytB__6nlBf7T-izuI7hi4XdB6ET0sJgEel4,969
|
|
121
|
-
mns_common-1.2.6.
|
|
122
|
-
mns_common-1.2.6.
|
|
123
|
-
mns_common-1.2.6.
|
|
124
|
-
mns_common-1.2.6.
|
|
121
|
+
mns_common-1.2.6.3.dist-info/METADATA,sha256=GFVq_dH3YP4OawnNt7QNskuQfiwmJyGkGr192_ruCuc,61
|
|
122
|
+
mns_common-1.2.6.3.dist-info/WHEEL,sha256=GJ7t_kWBFywbagK5eo9IoUwLW6oyOeTKmQ-9iHFVNxQ,92
|
|
123
|
+
mns_common-1.2.6.3.dist-info/top_level.txt,sha256=ZC58kAR-8Hvc6U2xhYNBNLAh3mb6sZazbdj5nZpvEkQ,11
|
|
124
|
+
mns_common-1.2.6.3.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|