mns-scheduler 1.1.8.4__py3-none-any.whl → 1.4.3.2__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.
- mns_scheduler/__init__.py +1 -3
- mns_scheduler/company_info/announce/company_announce_sync_service.py +65 -0
- mns_scheduler/company_info/base/__init__.py +1 -1
- mns_scheduler/company_info/base/sync_company_base_info_api.py +171 -79
- mns_scheduler/company_info/base/sync_company_hold_info_api.py +3 -6
- mns_scheduler/company_info/base/sync_company_product_area_industry.py +161 -0
- mns_scheduler/company_info/clean/__init__.py +1 -1
- mns_scheduler/company_info/clean/company_info_clean_api.py +29 -9
- mns_scheduler/company_info/constant/__init__.py +1 -1
- mns_scheduler/company_info/constant/company_constant_data.py +285 -184
- mns_scheduler/company_info/de_list_stock/__init__.py +1 -1
- mns_scheduler/company_info/de_list_stock/de_list_stock_service.py +1 -1
- mns_scheduler/company_info/em_stock_info/__init__.py +7 -0
- mns_scheduler/company_info/em_stock_info/sync_em_stock_info_sync.py +80 -0
- mns_scheduler/company_info/remark/__init__.py +1 -1
- mns_scheduler/company_info/remark/company_remark_info_sync.py +3 -3
- mns_scheduler/concept/clean/kpl_concept_clean_api.py +1 -1
- mns_scheduler/concept/clean/ths_concept_clean_api.py +20 -4
- mns_scheduler/concept/ths/common/ths_concept_sync_common_api.py +21 -16
- mns_scheduler/concept/ths/common/ths_concept_update_common_api.py +4 -1
- mns_scheduler/concept/ths/detaill/ths_concept_detail_api.py +7 -7
- mns_scheduler/concept/ths/sync_new_index/sync_ths_concept_new_index_api.py +9 -4
- mns_scheduler/concept/ths/update_concept_info/sync_one_symbol_all_concepts_api.py +3 -3
- mns_scheduler/db/col_move_service.py +3 -3
- mns_scheduler/db/script/__init__.py +1 -1
- mns_scheduler/db/script/col_move_script.py +1 -1
- mns_scheduler/db/script/db_move/__init__.py +7 -0
- mns_scheduler/db/script/db_move/col_move_one_service.py +34 -0
- mns_scheduler/db/script/sync/__init__.py +1 -1
- mns_scheduler/db/script/sync/remote_data_sync_to_local.py +57 -4
- mns_scheduler/db/script/sync/sync_hui_ce_test_data.py +80 -0
- mns_scheduler/db/script/sync/sync_hui_ce_test_data_01.py +69 -0
- mns_scheduler/db/script/update/__init__.py +7 -0
- mns_scheduler/db/script/update/update_col_field.py +36 -0
- mns_scheduler/finance/__init__.py +1 -1
- mns_scheduler/finance/{em_financial_asset_liability_sync_service_api.py → em/em_financial_asset_liability_sync_service_api.py} +2 -2
- mns_scheduler/finance/{em_financial_profit_sync_service_api.py → em/em_financial_profit_sync_service_api.py} +27 -26
- mns_scheduler/finance/{finance_common_api.py → em/finance_common_api.py} +3 -3
- mns_scheduler/finance/{sync_financial_report_service_api.py → sync_financial_report_service_task.py} +80 -27
- mns_scheduler/finance/xue_qiu/down_load_xueqiu_report_api.py +77 -0
- mns_scheduler/finance/xue_qiu/sync_xue_qiu_fiance_data.py +161 -0
- mns_scheduler/hk/__init__.py +1 -1
- mns_scheduler/hk/hk_company_info_sync_service_api.py +4 -4
- mns_scheduler/hk/hk_industry_info_sync_service_api.py +3 -5
- mns_scheduler/industry/__init__.py +7 -0
- mns_scheduler/industry/ths/__init__.py +7 -0
- mns_scheduler/industry/ths/ths_industry_index_service.py +58 -0
- mns_scheduler/industry/ths/ths_industry_sync_service.py +68 -0
- mns_scheduler/irm/__init__.py +1 -1
- mns_scheduler/irm/api/__init__.py +1 -1
- mns_scheduler/irm/api/sh_stock_sns_sse_info_api.py +1 -1
- mns_scheduler/irm/api/sz_stock_sns_sse_info_api.py +1 -1
- mns_scheduler/irm/stock_irm_cninfo_service.py +12 -8
- mns_scheduler/k_line/clean/daily/__init__.py +1 -1
- mns_scheduler/k_line/clean/daily/daily_k_line_clean_common_service.py +52 -6
- mns_scheduler/k_line/clean/daily/daily_k_line_service.py +7 -2
- mns_scheduler/k_line/clean/k_line_info_clean_impl.py +3 -2
- mns_scheduler/k_line/clean/k_line_info_clean_task.py +42 -15
- mns_scheduler/k_line/clean/week_month/__init__.py +1 -1
- mns_scheduler/k_line/clean/week_month/normal_week_month_k_line_service.py +124 -26
- mns_scheduler/k_line/clean/week_month/sub_new_week_month_k_line_service.py +2 -2
- mns_scheduler/k_line/common/__init__.py +7 -0
- mns_scheduler/k_line/common/k_line_common_api.py +188 -0
- mns_scheduler/k_line/hot_stocks/__init__.py +1 -1
- mns_scheduler/k_line/hot_stocks/recent_hot_stocks_clean_service.py +1 -1
- mns_scheduler/k_line/{sync → month_week_daily}/bfq_k_line_sync.py +14 -29
- mns_scheduler/k_line/{sync → month_week_daily}/daily_week_month_line_sync.py +11 -12
- mns_scheduler/k_line/sync_status/__init__.py +7 -0
- mns_scheduler/k_line/sync_status/k_line_sync_status_check.py +54 -0
- mns_scheduler/k_line/test/__init__.py +1 -1
- mns_scheduler/k_line/test/k_line_info_clean_his_data.py +14 -3
- mns_scheduler/k_line/year_quarter/__init__.py +7 -0
- mns_scheduler/k_line/year_quarter/year_quarter_line_sync.py +76 -0
- mns_scheduler/kpl/selection/symbol/sync_best_choose_symbol.py +1 -2
- mns_scheduler/kpl/selection/symbol/sync_kpl_concept_symbol_choose_reason_api.py +108 -0
- mns_scheduler/kpl/selection/total/sync_kpl_best_total_sync_api.py +5 -0
- mns_scheduler/lhb/__init__.py +1 -1
- mns_scheduler/lhb/stock_lhb_sync_service.py +1 -1
- mns_scheduler/open/__init__.py +1 -1
- mns_scheduler/open/sync_one_day_open_data_to_db_service.py +2 -3
- mns_scheduler/risk/__init__.py +1 -1
- mns_scheduler/risk/compliance/undisclosed_annual_report_api.py +8 -2
- mns_scheduler/risk/financial/annual_report_audit_check_api.py +13 -3
- mns_scheduler/risk/financial/net_assets_check_api.py +21 -18
- mns_scheduler/risk/financial/profit_income_check_api.py +7 -2
- mns_scheduler/risk/financial_report_risk_check_api.py +1 -1
- mns_scheduler/risk/major_violations/register_and_investigate_stock_sync_api.py +1 -1
- mns_scheduler/risk/self/wei_pan_stock_api.py +1 -1
- mns_scheduler/risk/test/__init__.py +1 -1
- mns_scheduler/risk/test/fix_blask_list.py +4 -6
- mns_scheduler/risk/transactions/transactions_check_api.py +22 -4
- mns_scheduler/self_choose/__init__.py +1 -1
- mns_scheduler/self_choose/ths_self_choose_service.py +60 -32
- mns_scheduler/trade/auto_login/trader_auto_service.py +6 -4
- mns_scheduler/trade/auto_sell_service_api.py +4 -4
- mns_scheduler/trade/balance/__init__.py +7 -0
- mns_scheduler/trade/balance/ths_account_balance_service.py +7 -0
- mns_scheduler/trade/sync_position_api.py +39 -6
- mns_scheduler/trade/task/trader_task_service.py +26 -9
- mns_scheduler/trade/tfp/__init__.py +7 -0
- mns_scheduler/trade/tfp/stock_tfp_info_sync.py +56 -0
- mns_scheduler/zb/stock_zb_pool_sync.py +1 -16
- mns_scheduler/zt/high_chg/sync_high_chg_pool_service.py +2 -2
- mns_scheduler/zt/high_chg/sync_high_chg_real_time_quotes_service.py +1 -1
- mns_scheduler/zt/script/__init__.py +1 -1
- mns_scheduler/zt/script/fix_error_deal_day.py +41 -0
- mns_scheduler/zt/script/kcx_high_chg_open_his_data_handle.py +2 -2
- mns_scheduler/zt/script/sync_high_chg_pool_his_data.py +2 -2
- mns_scheduler/zt/script/sync_now_higt_chg_zt.py +8 -7
- mns_scheduler/zt/zt_pool/em_zt_pool_sync_api.py +256 -55
- mns_scheduler/zt/zt_pool/ths_zt_pool_sync_api.py +33 -90
- mns_scheduler/zt/zt_pool/update_null_zt_reason_api.py +24 -13
- mns_scheduler/zz_task/compensation/__init__.py +0 -0
- mns_scheduler/zz_task/compensation/compensate_task.py +161 -0
- mns_scheduler/zz_task/compensation/compensate_task_one_day.py +142 -0
- mns_scheduler/zz_task/data_sync_task.py +177 -91
- {mns_scheduler-1.1.8.4.dist-info → mns_scheduler-1.4.3.2.dist-info}/METADATA +1 -1
- mns_scheduler-1.4.3.2.dist-info/RECORD +169 -0
- {mns_scheduler-1.1.8.4.dist-info → mns_scheduler-1.4.3.2.dist-info}/WHEEL +1 -1
- mns_scheduler/2014-2015-test/2014_2015_chg_statistics.py +0 -87
- mns_scheduler/big_deal/ths_big_deal_sync.py +0 -98
- mns_scheduler/db/real_time_task_check.py +0 -84
- mns_scheduler/debt/kzz_bond_info_sync.py +0 -33
- mns_scheduler-1.1.8.4.dist-info/RECORD +0 -142
- /mns_scheduler/{big_deal → company_info/announce}/__init__.py +0 -0
- /mns_scheduler/{2014-2015-test → finance/em}/__init__.py +0 -0
- /mns_scheduler/{debt → finance/xue_qiu}/__init__.py +0 -0
- /mns_scheduler/k_line/{sync → month_week_daily}/__init__.py +0 -0
- {mns_scheduler-1.1.8.4.dist-info → mns_scheduler-1.4.3.2.dist-info}/top_level.txt +0 -0
|
@@ -2,7 +2,7 @@ import sys
|
|
|
2
2
|
import os
|
|
3
3
|
|
|
4
4
|
file_path = os.path.abspath(__file__)
|
|
5
|
-
end = file_path.index('mns') +
|
|
5
|
+
end = file_path.index('mns') + 17
|
|
6
6
|
project_path = file_path[0:end]
|
|
7
7
|
sys.path.append(project_path)
|
|
8
8
|
from mns_common.db.MongodbUtil import MongodbUtil
|
|
@@ -13,6 +13,7 @@ import mns_scheduler.company_info.constant.company_constant_data as company_cons
|
|
|
13
13
|
import mns_common.constant.db_name_constant as db_name_constant
|
|
14
14
|
import mns_scheduler.concept.ths.detaill.ths_concept_detail_api as ths_concept_detail_api
|
|
15
15
|
import mns_scheduler.company_info.base.sync_company_base_info_api as company_info_sync_api
|
|
16
|
+
import mns_common.utils.data_frame_util as data_frame_util
|
|
16
17
|
|
|
17
18
|
mongodb_util = MongodbUtil('27017')
|
|
18
19
|
import mns_common.component.common_service_fun_api as common_service_fun_api
|
|
@@ -20,28 +21,33 @@ import mns_common.component.company.company_common_service_api as company_common
|
|
|
20
21
|
|
|
21
22
|
|
|
22
23
|
# 修改行业信息
|
|
23
|
-
def
|
|
24
|
+
def clean_company_info(symbol):
|
|
24
25
|
if symbol is not None:
|
|
25
26
|
query = {"symbol": symbol}
|
|
26
27
|
company_info = mongodb_util.find_query_data('company_info_base', query)
|
|
27
28
|
else:
|
|
28
29
|
company_info = mongodb_util.find_all_data('company_info_base')
|
|
29
30
|
|
|
31
|
+
company_info = company_constant_data.fix_second_industry(company_info)
|
|
32
|
+
|
|
30
33
|
company_info = company_info.set_index(['second_sw_industry'], drop=False)
|
|
34
|
+
|
|
35
|
+
# 修改行业名称
|
|
31
36
|
del company_info['industry']
|
|
32
37
|
# fix industry name
|
|
33
|
-
industry_final_fix_df = company_constant_data.
|
|
38
|
+
industry_final_fix_df = company_constant_data.get_fix_industry_name_df()
|
|
34
39
|
industry_final_fix_df = industry_final_fix_df.set_index(['second_sw_industry'], drop=True)
|
|
35
40
|
company_info = pd.merge(company_info, industry_final_fix_df, how='outer',
|
|
36
41
|
left_index=True, right_index=True)
|
|
37
|
-
|
|
42
|
+
|
|
43
|
+
# 将申万第三行业做为行业 拆分过大的二级行业 主要有通用设备 和专业设备
|
|
38
44
|
company_info = company_constant_data.fix_industry_use_sw_third(company_info.copy())
|
|
39
45
|
company_info['industry'] = company_info['industry'].fillna('综合')
|
|
40
46
|
company_info = company_constant_data.filed_sort(company_info)
|
|
41
47
|
company_info['company_type'] = company_info['business_nature']
|
|
42
48
|
|
|
43
49
|
# 将list_date列中的所有NaN值设置为99990909
|
|
44
|
-
company_info
|
|
50
|
+
company_info.fillna({'list_date': 19890604}, inplace=True)
|
|
45
51
|
|
|
46
52
|
# 将日期数值转换为日期时间格式
|
|
47
53
|
company_info['list_date_01'] = pd.to_datetime(company_info['list_date'], format='%Y%m%d')
|
|
@@ -65,7 +71,7 @@ def fix_company_industry(symbol):
|
|
|
65
71
|
except BaseException as e:
|
|
66
72
|
logger.error("出现异常:{},{}", symbol, e)
|
|
67
73
|
query = {'concept_code': 885598}
|
|
68
|
-
ths_stock_concept_detail = mongodb_util.find_query_data(
|
|
74
|
+
ths_stock_concept_detail = mongodb_util.find_query_data(db_name_constant.THS_STOCK_CONCEPT_DETAIL, query)
|
|
69
75
|
sub_stock_symbol_list = list(ths_stock_concept_detail['symbol'])
|
|
70
76
|
company_info.loc[:, 'sub_stock'] = False
|
|
71
77
|
company_info.loc[company_info['symbol'].isin(sub_stock_symbol_list), 'sub_stock'] = True
|
|
@@ -73,6 +79,20 @@ def fix_company_industry(symbol):
|
|
|
73
79
|
try:
|
|
74
80
|
company_info.dropna(subset=['symbol'], axis=0, inplace=True)
|
|
75
81
|
company_info.dropna(subset=['_id'], axis=0, inplace=True)
|
|
82
|
+
ths_stock_industry_detail_df = mongodb_util.find_all_data(db_name_constant.THS_STOCK_INDUSTRY_DETAIL)
|
|
83
|
+
if data_frame_util.is_not_empty(ths_stock_industry_detail_df):
|
|
84
|
+
ths_stock_industry_detail_df = ths_stock_industry_detail_df[
|
|
85
|
+
['symbol', 'ths_industry_name', 'ths_industry_code']]
|
|
86
|
+
ths_stock_industry_detail_df = ths_stock_industry_detail_df.set_index(['symbol'], drop=True)
|
|
87
|
+
company_info = company_info.set_index(['_id'], drop=False)
|
|
88
|
+
company_info = pd.merge(company_info, ths_stock_industry_detail_df, how='outer',
|
|
89
|
+
left_index=True, right_index=True)
|
|
90
|
+
company_info['ths_industry_code'] = company_info['ths_industry_code'].fillna('0')
|
|
91
|
+
company_info['ths_industry_name'] = company_info['ths_industry_name'].fillna('异常')
|
|
92
|
+
|
|
93
|
+
else:
|
|
94
|
+
company_info['ths_industry_code'] = '0'
|
|
95
|
+
company_info['ths_industry_name'] = '异常'
|
|
76
96
|
mongodb_util.save_mongo(company_info, db_name_constant.COMPANY_INFO)
|
|
77
97
|
# 保存历史数据
|
|
78
98
|
save_company_info_his(company_info)
|
|
@@ -98,11 +118,11 @@ def save_company_info_his(company_info_df):
|
|
|
98
118
|
# 更新新上市公司信息
|
|
99
119
|
def new_company_info_update():
|
|
100
120
|
east_money_stock_info = company_info_sync_api.get_east_money_stock_info()
|
|
101
|
-
new_stock = common_service_fun_api.get_new_stock(east_money_stock_info)
|
|
121
|
+
new_stock = common_service_fun_api.get_new_stock(east_money_stock_info.copy())
|
|
102
122
|
for company_one in new_stock.itertuples():
|
|
103
123
|
try:
|
|
104
124
|
company_info_sync_api.sync_company_base_info([company_one.symbol])
|
|
105
|
-
|
|
125
|
+
clean_company_info(company_one.symbol)
|
|
106
126
|
|
|
107
127
|
except BaseException as e:
|
|
108
128
|
logger.error("出现异常:{}", e)
|
|
@@ -110,4 +130,4 @@ def new_company_info_update():
|
|
|
110
130
|
|
|
111
131
|
|
|
112
132
|
if __name__ == '__main__':
|
|
113
|
-
|
|
133
|
+
clean_company_info(None)
|