mns-common 1.2.6.3__py3-none-any.whl → 1.2.6.4__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.

@@ -153,7 +153,9 @@ mongodb_util = MongodbUtil('27017')
153
153
  if __name__ == '__main__':
154
154
  end_time_test = '20241009093000'
155
155
  result_df_test = get_ths_concept_his_info('20241009093000', end_time_test, 500, 2)
156
+ result_df_test['block_code'] = result_df_test['block_code'].astype(int)
156
157
  result_df_test['_id'] = result_df_test['block_code']
158
+
157
159
  mongodb_util.save_mongo(result_df_test, 'ths_concept_info')
158
160
  print(result_df_test)
159
161
 
@@ -0,0 +1,7 @@
1
+ import sys
2
+ import os
3
+
4
+ file_path = os.path.abspath(__file__)
5
+ end = file_path.index('mns') + 16
6
+ project_path = file_path[0:end]
7
+ sys.path.append(project_path)
@@ -0,0 +1,44 @@
1
+ import sys
2
+ import os
3
+
4
+ file_path = os.path.abspath(__file__)
5
+ end = file_path.index('mns') + 16
6
+ project_path = file_path[0:end]
7
+ sys.path.append(project_path)
8
+ import akshare as ak
9
+ import mns_common.utils.date_handle_util as date_handle_util
10
+ from loguru import logger
11
+ import mns_common.utils.data_frame_util as data_frame_util
12
+ from functools import lru_cache
13
+
14
+
15
+ def get_stock_tfp_by_day(str_day):
16
+ stock_tfp_em_df = ak.stock_tfp_em(date_handle_util.no_slash_date(str_day))
17
+ stock_tfp_em_df = stock_tfp_em_df.rename(
18
+ columns={'序号': 'index',
19
+ '代码': 'symbol',
20
+ '名称': 'name',
21
+ '停牌时间': 'sus_begin_time',
22
+ '停牌截止时间': 'sus_end_time',
23
+ '停牌截止时间': 'sus_end_time',
24
+ '停牌期限': 'sus_period',
25
+ '停牌原因': 'sus_reason',
26
+ '所属市场': 'market',
27
+ '预计复牌时间': 'resume_time'
28
+ })
29
+ return stock_tfp_em_df
30
+
31
+
32
+ # 获取停牌股票列表
33
+ @lru_cache(maxsize=None)
34
+ def get_stock_tfp_symbol_list_by_day(str_day):
35
+ try:
36
+ stock_tfp_em_df = get_stock_tfp_by_day(str_day)
37
+ if data_frame_util.is_not_empty(stock_tfp_em_df):
38
+ return list(stock_tfp_em_df['symbol'])
39
+ else:
40
+ return ['666666']
41
+
42
+ except BaseException as e:
43
+ logger.error("获取停牌信息异常:{}", e)
44
+ return ['666666']
@@ -1,4 +1,4 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: mns_common
3
- Version: 1.2.6.3
3
+ Version: 1.2.6.4
4
4
 
@@ -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=J7gnh_JHxnVaHH-7n66E4rsN8-ndIT-oEnj49GGYb1Q,7828
45
+ mns_common/api/ths/concept/app/ths_concept_index_app.py,sha256=8nE87vveWiSlADMoJfgCQ0NCsICVEwN-CbJ6cL8kEDc,7907
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
@@ -97,6 +97,8 @@ mns_common/component/redis_msg/redis_msg_publish_service.py,sha256=jcNEfQpARCPyl
97
97
  mns_common/component/self_choose/__init__.py,sha256=wEg73KlZo-dU0yKGwpA1C2y6LZm4IBb94tNda1tqLeg,163
98
98
  mns_common/component/self_choose/black_list_service_api.py,sha256=bBWXwvf7M3_ys5oZNHDMtAAqF4HYbsqfSh1zOd8UvuY,1980
99
99
  mns_common/component/self_choose/self_choose_service_api.py,sha256=3dKqpQSIhkdRjK5yCVSsmQAL1V8-LqYujdEvj2N4bGk,1696
100
+ mns_common/component/tfp/__init__.py,sha256=wEg73KlZo-dU0yKGwpA1C2y6LZm4IBb94tNda1tqLeg,163
101
+ mns_common/component/tfp/stock_tfp_api.py,sha256=evn-YQxcJ5hA5_iQN3hJykeRlODQIRM3vdhJPmWaqy8,1499
100
102
  mns_common/component/trade_date/__init__.py,sha256=2U9DiKslxsWwLLEcZKjS8UiQPN1QgALvnK3HiJNIZE0,163
101
103
  mns_common/component/trade_date/trade_date_common_service_api.py,sha256=PHrcUjgLdNKbqyMGot0poKtiLBys_wRZoheMhPJE-U4,3032
102
104
  mns_common/component/zt/__init__.py,sha256=2U9DiKslxsWwLLEcZKjS8UiQPN1QgALvnK3HiJNIZE0,163
@@ -118,7 +120,7 @@ mns_common/utils/date_handle_util.py,sha256=qkEyKLYiVq6qpKVp32MLKwRtGKVBK6AY5at2
118
120
  mns_common/utils/db_util.py,sha256=hSmfNAN4vEeEaUva6_cicZEhb2jSnib-Gvk2reke1vc,2590
119
121
  mns_common/utils/file_util.py,sha256=egWu6PenGPRp_ixrNTHKarT4dAnOT6FETR82EHUZJnQ,1042
120
122
  mns_common/utils/ip_util.py,sha256=UTcYfz_uytB__6nlBf7T-izuI7hi4XdB6ET0sJgEel4,969
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,,
123
+ mns_common-1.2.6.4.dist-info/METADATA,sha256=GY3F_eINg1caIZO7P9udzeWpoFM48NmI-uqPHkndi0Q,61
124
+ mns_common-1.2.6.4.dist-info/WHEEL,sha256=GJ7t_kWBFywbagK5eo9IoUwLW6oyOeTKmQ-9iHFVNxQ,92
125
+ mns_common-1.2.6.4.dist-info/top_level.txt,sha256=ZC58kAR-8Hvc6U2xhYNBNLAh3mb6sZazbdj5nZpvEkQ,11
126
+ mns_common-1.2.6.4.dist-info/RECORD,,