mns-scheduler 1.2.9.6__py3-none-any.whl → 1.4.2.5__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-scheduler might be problematic. Click here for more details.
- mns_scheduler/company_info/announce/__init__.py +1 -1
- mns_scheduler/company_info/announce/company_announce_sync_service.py +11 -6
- mns_scheduler/company_info/base/__init__.py +1 -1
- mns_scheduler/company_info/base/sync_company_base_info_api.py +164 -74
- 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 +2 -2
- mns_scheduler/company_info/constant/__init__.py +1 -1
- mns_scheduler/company_info/constant/company_constant_data.py +4 -0
- 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 +1 -1
- mns_scheduler/company_info/em_stock_info/sync_em_stock_info_sync.py +44 -33
- mns_scheduler/company_info/remark/__init__.py +1 -1
- mns_scheduler/company_info/remark/company_remark_info_sync.py +1 -1
- mns_scheduler/concept/clean/kpl_concept_clean_api.py +1 -1
- mns_scheduler/concept/clean/ths_concept_clean_api.py +3 -6
- 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 +1 -1
- mns_scheduler/db/script/db_move/col_move_one_service.py +1 -1
- mns_scheduler/db/script/sync/__init__.py +1 -1
- mns_scheduler/db/script/sync/remote_data_sync_to_local.py +39 -9
- mns_scheduler/db/script/sync/sync_hui_ce_test_data.py +35 -24
- mns_scheduler/db/script/sync/sync_hui_ce_test_data_01.py +23 -23
- mns_scheduler/db/script/update/__init__.py +1 -1
- mns_scheduler/db/script/update/update_col_field.py +1 -1
- 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} +6 -4
- mns_scheduler/finance/{finance_common_api.py → em/finance_common_api.py} +1 -1
- 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 +2 -1
- mns_scheduler/hk/hk_industry_info_sync_service_api.py +1 -1
- mns_scheduler/industry/__init__.py +1 -1
- mns_scheduler/industry/ths/__init__.py +1 -1
- mns_scheduler/industry/ths/ths_industry_index_service.py +1 -1
- mns_scheduler/industry/ths/ths_industry_sync_service.py +1 -1
- 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 +10 -6
- mns_scheduler/k_line/clean/daily/__init__.py +1 -1
- mns_scheduler/k_line/clean/daily/daily_k_line_clean_common_service.py +1 -1
- mns_scheduler/k_line/clean/daily/daily_k_line_service.py +1 -1
- mns_scheduler/k_line/clean/k_line_info_clean_task.py +7 -2
- 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 +1 -1
- mns_scheduler/k_line/clean/week_month/sub_new_week_month_k_line_service.py +1 -1
- mns_scheduler/{extraIncome/one_minute → k_line}/common/__init__.py +1 -1
- 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/month_week_daily/bfq_k_line_sync.py +12 -32
- mns_scheduler/k_line/month_week_daily/daily_week_month_line_sync.py +6 -13
- 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 +1 -1
- mns_scheduler/k_line/year_quarter/__init__.py +1 -1
- mns_scheduler/k_line/year_quarter/year_quarter_line_sync.py +17 -10
- 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 +1 -1
- mns_scheduler/risk/__init__.py +1 -1
- mns_scheduler/risk/compliance/undisclosed_annual_report_api.py +4 -2
- mns_scheduler/risk/financial/annual_report_audit_check_api.py +1 -1
- mns_scheduler/risk/financial/profit_income_check_api.py +1 -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 +2 -2
- mns_scheduler/risk/transactions/transactions_check_api.py +2 -2
- mns_scheduler/self_choose/__init__.py +1 -1
- mns_scheduler/self_choose/ths_self_choose_service.py +37 -28
- mns_scheduler/trade/auto_login/trader_auto_service.py +6 -4
- mns_scheduler/trade/auto_sell_service_api.py +2 -2
- mns_scheduler/trade/balance/__init__.py +1 -1
- mns_scheduler/trade/balance/ths_account_balance_service.py +1 -1
- mns_scheduler/trade/sync_position_api.py +1 -1
- mns_scheduler/trade/task/trader_task_service.py +26 -9
- mns_scheduler/trade/tfp/__init__.py +1 -1
- mns_scheduler/trade/tfp/stock_tfp_info_sync.py +5 -2
- mns_scheduler/zt/script/__init__.py +1 -1
- mns_scheduler/zt/script/fix_error_deal_day.py +1 -1
- 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 +5 -4
- mns_scheduler/zt/zt_pool/em_zt_pool_sync_api.py +44 -17
- mns_scheduler/zt/zt_pool/ths_zt_pool_sync_api.py +33 -80
- mns_scheduler/zt/zt_pool/update_null_zt_reason_api.py +18 -5
- 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 +64 -60
- {mns_scheduler-1.2.9.6.dist-info → mns_scheduler-1.4.2.5.dist-info}/METADATA +1 -1
- mns_scheduler-1.4.2.5.dist-info/RECORD +169 -0
- mns_scheduler/big_deal/__init__.py +0 -7
- mns_scheduler/big_deal/ths_big_deal_sync.py +0 -98
- mns_scheduler/debt/kzz_bond_info_sync.py +0 -33
- mns_scheduler/extraIncome/one_minute/common/db_create_index.py +0 -9
- mns_scheduler/extraIncome/one_minute/common/symbol_handle_util.py +0 -41
- mns_scheduler/extraIncome/one_minute/etf/__init__.py +0 -7
- mns_scheduler/extraIncome/one_minute/etf/etf_one_minute_sync_task.py +0 -87
- mns_scheduler/extraIncome/one_minute/index/__init__.py +0 -7
- mns_scheduler/extraIncome/one_minute/index/main_index_sync_task.py +0 -74
- mns_scheduler/extraIncome/one_minute/kzz/__init__.py +0 -7
- mns_scheduler/extraIncome/one_minute/kzz/kzz_one_minute_sync_task.py +0 -87
- mns_scheduler/extraIncome/one_minute/one_minute_sync_task.py +0 -34
- mns_scheduler/extraIncome/one_minute/stock/__init__.py +0 -7
- mns_scheduler/extraIncome/one_minute/stock/stock_one_minute_sync_task.py +0 -89
- mns_scheduler/extraIncome/temp/__init__.py +0 -7
- mns_scheduler/extraIncome/temp/tu_share_data_etf_sync.py +0 -103
- mns_scheduler/extraIncome/temp/tu_share_data_kzz_sync.py +0 -113
- mns_scheduler/extraIncome/temp/tu_share_data_stock_sync.py +0 -137
- mns_scheduler/extraIncome/temp/tu_share_zhi_shu_sync_api.py +0 -107
- mns_scheduler/us/__init__.py +0 -7
- mns_scheduler/us/baidu_yun_pan_handle_service.py +0 -131
- mns_scheduler/us/k_line.py +0 -91
- mns_scheduler/us/us_company_info_sync_service_api.py +0 -39
- mns_scheduler-1.2.9.6.dist-info/RECORD +0 -183
- /mns_scheduler/{debt → finance/em}/__init__.py +0 -0
- /mns_scheduler/{extraIncome → finance/xue_qiu}/__init__.py +0 -0
- /mns_scheduler/{extraIncome/one_minute → k_line/sync_status}/__init__.py +0 -0
- {mns_scheduler-1.2.9.6.dist-info → mns_scheduler-1.4.2.5.dist-info}/WHEEL +0 -0
- {mns_scheduler-1.2.9.6.dist-info → mns_scheduler-1.4.2.5.dist-info}/top_level.txt +0 -0
|
@@ -2,68 +2,79 @@ 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
|
-
|
|
9
|
-
import mns_common.component.proxies.proxy_common_api as proxy_common_api
|
|
8
|
+
|
|
10
9
|
from mns_common.db.MongodbUtil import MongodbUtil
|
|
11
10
|
from loguru import logger
|
|
12
|
-
import mns_common.api.em.real_time.east_money_stock_a_v2_api as east_money_stock_a_v2_api
|
|
13
11
|
import mns_common.api.em.real_time.east_money_debt_api as east_money_debt_api
|
|
14
12
|
import mns_common.api.em.real_time.east_money_etf_api as east_money_etf_api
|
|
13
|
+
import mns_common.api.em.real_time.east_money_stock_a_v2_api as east_money_stock_a_v2_api
|
|
14
|
+
from datetime import datetime
|
|
15
|
+
import mns_common.constant.extra_income_db_name as extra_income_db_name
|
|
15
16
|
import mns_common.api.em.real_time.east_money_stock_hk_api as east_money_stock_hk_api
|
|
16
|
-
import mns_common.api.em.real_time.east_money_stock_us_api as east_money_stock_us_api
|
|
17
|
-
import mns_common.constant.db_name_constant as db_name_constant
|
|
18
17
|
import mns_common.component.cookie.cookie_info_service as cookie_info_service
|
|
18
|
+
import mns_common.api.em.real_time.east_money_stock_us_api as east_money_stock_us_api
|
|
19
19
|
|
|
20
20
|
mongodb_util = MongodbUtil('27017')
|
|
21
21
|
|
|
22
22
|
|
|
23
23
|
def sync_all_em_stock_info():
|
|
24
|
-
|
|
25
|
-
now_date = datetime.datetime.now()
|
|
24
|
+
now_date = datetime.now()
|
|
26
25
|
str_now_date = now_date.strftime('%Y-%m-%d %H:%M:%S')
|
|
27
|
-
|
|
28
|
-
|
|
26
|
+
|
|
27
|
+
logger.info("同步东方财富a,etf,kzz,us,hk,信息开始")
|
|
28
|
+
|
|
29
29
|
try:
|
|
30
|
-
|
|
30
|
+
# 这里需要使用详情接口 获取全量数据
|
|
31
|
+
em_a_stock_info_df = east_money_stock_a_v2_api.get_stock_real_time_quotes(60)
|
|
32
|
+
em_a_stock_info_df['list_date'] = em_a_stock_info_df['list_date'].fillna(19890604)
|
|
31
33
|
em_a_stock_info_df['_id'] = em_a_stock_info_df['symbol']
|
|
32
|
-
|
|
34
|
+
em_a_stock_info_df['sync_time'] = str_now_date
|
|
35
|
+
mongodb_util.save_mongo(em_a_stock_info_df, extra_income_db_name.EM_A_STOCK_INFO)
|
|
33
36
|
except BaseException as e:
|
|
34
37
|
logger.error("同步东方财富A股信息异常:{}", e)
|
|
35
|
-
|
|
36
38
|
try:
|
|
37
|
-
em_etf_info = east_money_etf_api.get_etf_real_time_quotes(
|
|
38
|
-
em_etf_info['
|
|
39
|
-
mongodb_util.save_mongo(em_etf_info,
|
|
39
|
+
em_etf_info = east_money_etf_api.get_etf_real_time_quotes(30, 6)
|
|
40
|
+
em_etf_info['sync_time'] = str_now_date
|
|
41
|
+
mongodb_util.save_mongo(em_etf_info, extra_income_db_name.EM_ETF_INFO)
|
|
40
42
|
except BaseException as e:
|
|
41
43
|
logger.error("同步东方财富ETF信息异常:{}", e)
|
|
42
44
|
|
|
43
45
|
try:
|
|
44
|
-
em_kzz_info = east_money_debt_api.
|
|
45
|
-
|
|
46
|
+
em_kzz_info = east_money_debt_api.get_kzz_real_time_quotes(30, 6)
|
|
46
47
|
em_kzz_info['_id'] = em_kzz_info['symbol']
|
|
47
|
-
|
|
48
|
+
em_kzz_info['sync_time'] = str_now_date
|
|
49
|
+
mongodb_util.save_mongo(em_kzz_info, extra_income_db_name.EM_KZZ_INFO)
|
|
48
50
|
except BaseException as e:
|
|
49
51
|
logger.error("同步东方财富可转债信息异常:{}", e)
|
|
50
52
|
|
|
51
|
-
em_cookie = cookie_info_service.get_em_cookie()
|
|
52
|
-
try:
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
except BaseException as e:
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
try:
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
53
|
+
# em_cookie = cookie_info_service.get_em_cookie()
|
|
54
|
+
# try:
|
|
55
|
+
# em_hk_stock_info = east_money_stock_hk_api.get_hk_real_time_quotes(em_cookie, proxies)
|
|
56
|
+
# em_hk_stock_info['_id'] = em_hk_stock_info['symbol']
|
|
57
|
+
# mongodb_util.save_mongo(em_hk_stock_info, extra_income_db_name.EM_HK_STOCK_INFO)
|
|
58
|
+
# except BaseException as e:
|
|
59
|
+
# logger.error("同步东方财富港股信息异常:{}", e)
|
|
60
|
+
#
|
|
61
|
+
# try:
|
|
62
|
+
# em_cookie = cookie_info_service.get_em_cookie()
|
|
63
|
+
# em_us_stock_info = east_money_stock_us_api.get_us_stock_real_time_quotes(em_cookie, proxies)
|
|
64
|
+
# em_us_stock_info['_id'] = em_us_stock_info['symbol']
|
|
65
|
+
# mongodb_util.save_mongo(em_us_stock_info, extra_income_db_name.EM_US_STOCK_INFO)
|
|
66
|
+
# em_us_etf_info = em_us_stock_info.loc[(em_us_stock_info['amount'] != 0) & (em_us_stock_info['total_mv'] == 0)]
|
|
67
|
+
# em_us_etf_info = em_us_etf_info.sort_values(by=['amount'], ascending=False)
|
|
68
|
+
# mongodb_util.save_mongo(em_us_etf_info, extra_income_db_name.EM_US_ETF_INFO)
|
|
69
|
+
#
|
|
70
|
+
# except BaseException as e:
|
|
71
|
+
# logger.error("同步东方财富美股信息异常:{}", e)
|
|
65
72
|
logger.info("同步东方财富a,etf,kzz,us,hk,信息完成")
|
|
66
73
|
|
|
67
74
|
|
|
68
75
|
if __name__ == '__main__':
|
|
69
76
|
sync_all_em_stock_info()
|
|
77
|
+
# em_cookie = cookie_info_service.get_em_cookie()
|
|
78
|
+
# em_us_stock_info = east_money_stock_us_api.get_us_stock_real_time_quotes(em_cookie, None)
|
|
79
|
+
# em_us_stock_info['_id'] = em_us_stock_info['symbol']
|
|
80
|
+
# mongodb_util.save_mongo(em_us_stock_info, db_name_constant.EM_US_STOCK_INFO)
|
|
@@ -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
|
import mns_common.api.ths.concept.web.ths_company_info_web as ths_company_info_web
|
|
@@ -7,7 +7,7 @@ project_path = file_path[0:end]
|
|
|
7
7
|
sys.path.append(project_path)
|
|
8
8
|
from mns_common.db.MongodbUtil import MongodbUtil
|
|
9
9
|
import pandas as pd
|
|
10
|
-
import mns_common.
|
|
10
|
+
import mns_common.api.ths.concept.web.ths_concept_index_web as ths_concept_index_web
|
|
11
11
|
import time
|
|
12
12
|
from loguru import logger
|
|
13
13
|
import mns_common.component.company.company_common_service_api as company_common_service_api
|
|
@@ -107,10 +107,7 @@ def update_null_name():
|
|
|
107
107
|
exist_url = concept_one.url
|
|
108
108
|
|
|
109
109
|
if name == '':
|
|
110
|
-
|
|
111
|
-
if data_frame_util.is_empty(concept_name_df):
|
|
112
|
-
continue
|
|
113
|
-
concept_name = list(concept_name_df['concept_name'])[0]
|
|
110
|
+
concept_name = ths_concept_index_web.get_concept_name(concept_code)
|
|
114
111
|
query_concept = {"symbol": concept_code}
|
|
115
112
|
new_values = {'$set': {"name": concept_name}}
|
|
116
113
|
mongodb_util.update_one_query(query_concept, new_values, 'ths_concept_list')
|
|
@@ -131,7 +128,7 @@ def update_null_name():
|
|
|
131
128
|
|
|
132
129
|
|
|
133
130
|
if __name__ == '__main__':
|
|
134
|
-
update_one_concept_relevance_industry(886095)
|
|
131
|
+
# update_one_concept_relevance_industry(886095)
|
|
135
132
|
update_null_name()
|
|
136
133
|
logger.info("开始")
|
|
137
134
|
update_ths_concept_info()
|
|
@@ -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
|
import mns_common.utils.data_frame_util as data_frame_util
|
|
@@ -15,12 +15,15 @@ remote_mongodb_util = RemoteMongodbUtil('27017')
|
|
|
15
15
|
local_mongodb_util = LocalMongodbUtil('27017')
|
|
16
16
|
|
|
17
17
|
col_list = [
|
|
18
|
+
'em_a_stock_info',
|
|
19
|
+
'em_etf_info',
|
|
20
|
+
'em_kzz_info',
|
|
21
|
+
'em_hk_stock_info',
|
|
18
22
|
'company_info',
|
|
19
23
|
'company_remark_info',
|
|
20
24
|
'company_holding_info',
|
|
21
25
|
'industry_concept_remark',
|
|
22
26
|
'trade_date_list',
|
|
23
|
-
'company_info',
|
|
24
27
|
'de_list_stock',
|
|
25
28
|
'kpl_best_choose_index',
|
|
26
29
|
'kpl_best_choose_index_detail',
|
|
@@ -31,9 +34,11 @@ col_list = [
|
|
|
31
34
|
'self_choose_stock',
|
|
32
35
|
'stock_account_info',
|
|
33
36
|
'ths_concept_list',
|
|
34
|
-
'
|
|
37
|
+
'stock_zt_pool_five',
|
|
35
38
|
'ths_stock_concept_detail',
|
|
36
|
-
'stock_high_chg_pool'
|
|
39
|
+
'stock_high_chg_pool',
|
|
40
|
+
'today_new_concept_list',
|
|
41
|
+
'ths_stock_concept_detail_app'
|
|
37
42
|
]
|
|
38
43
|
|
|
39
44
|
|
|
@@ -53,8 +58,22 @@ def remote_data():
|
|
|
53
58
|
logger.error("同步失败:{},{}", e, col)
|
|
54
59
|
|
|
55
60
|
|
|
61
|
+
def sync_zt_data(str_day):
|
|
62
|
+
col = 'stock_zt_pool'
|
|
63
|
+
try:
|
|
64
|
+
query = {'str_day': str_day}
|
|
65
|
+
col_df = remote_mongodb_util.find_query_data(col, query)
|
|
66
|
+
if data_frame_util.is_not_empty(col_df):
|
|
67
|
+
col_df.replace([np.inf, -np.inf], 0, inplace=True)
|
|
68
|
+
local_mongodb_util.save_mongo(col_df, col)
|
|
69
|
+
|
|
70
|
+
logger.info("同步集合完成:{}", col)
|
|
71
|
+
except BaseException as e:
|
|
72
|
+
logger.error("同步失败:{},{}", e, col)
|
|
73
|
+
|
|
74
|
+
|
|
56
75
|
def sync_open_data():
|
|
57
|
-
query = {"$and": [{'trade_date': {"$gte": "
|
|
76
|
+
query = {"$and": [{'trade_date': {"$gte": "2025-03-21"}}, {'trade_date': {"$lte": "2025-04-02"}}]}
|
|
58
77
|
trade_date_list_df = remote_mongodb_util.find_query_data('trade_date_list', query)
|
|
59
78
|
trade_date_list_df = trade_date_list_df.sort_values(by=['trade_date'], ascending=False)
|
|
60
79
|
for trade_date_one in trade_date_list_df.itertuples():
|
|
@@ -62,14 +81,25 @@ def sync_open_data():
|
|
|
62
81
|
trade_date = trade_date_one.trade_date
|
|
63
82
|
query_01 = {"str_day": trade_date}
|
|
64
83
|
realtime_quotes_now_open_df = remote_mongodb_util.find_query_data('realtime_quotes_now_open', query_01)
|
|
65
|
-
|
|
84
|
+
if 'ths_concept_list' in realtime_quotes_now_open_df.columns:
|
|
85
|
+
del realtime_quotes_now_open_df['ths_concept_list']
|
|
66
86
|
local_mongodb_util.insert_mongo(realtime_quotes_now_open_df, 'realtime_quotes_now_open')
|
|
67
|
-
logger.
|
|
87
|
+
logger.info("同步到:{}", trade_date)
|
|
68
88
|
except BaseException as e:
|
|
69
89
|
logger.error("同步异常:{}", e)
|
|
70
90
|
return trade_date_list_df
|
|
71
91
|
|
|
72
92
|
|
|
73
93
|
if __name__ == '__main__':
|
|
74
|
-
|
|
75
|
-
|
|
94
|
+
sync_zt_data('2025-09-17')
|
|
95
|
+
# sync_zt_data('2025-09-02')
|
|
96
|
+
remote_data()
|
|
97
|
+
# sync_zt_data('2025-08-26')
|
|
98
|
+
# sync_zt_data('2025-08-25')
|
|
99
|
+
# sync_zt_data('2025-08-26')
|
|
100
|
+
# remote_data()
|
|
101
|
+
# sync_zt_data('2025-07-23')
|
|
102
|
+
# sync_zt_data('2025-07-24')
|
|
103
|
+
# sync_zt_data('2025-07-25')
|
|
104
|
+
# sync_open_data()
|
|
105
|
+
# remote_data()
|
|
@@ -2,22 +2,30 @@ 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
|
|
|
9
|
-
import mns_common.utils.data_frame_util as data_frame_util
|
|
10
9
|
from mns_scheduler.db.script.sync.remote_mongo_util import RemoteMongodbUtil
|
|
11
10
|
from mns_scheduler.db.script.sync.local_mongo_util import LocalMongodbUtil
|
|
12
11
|
from loguru import logger
|
|
13
|
-
import numpy as np
|
|
14
12
|
|
|
15
13
|
remote_mongodb_util = RemoteMongodbUtil('27017')
|
|
16
14
|
local_mongodb_util = LocalMongodbUtil('27017')
|
|
17
15
|
|
|
18
16
|
|
|
17
|
+
def create_index(db_name):
|
|
18
|
+
local_mongodb_util.create_index(db_name, [("symbol", 1)])
|
|
19
|
+
|
|
20
|
+
local_mongodb_util.create_index(db_name, [("str_now_date", 1)])
|
|
21
|
+
|
|
22
|
+
local_mongodb_util.create_index(db_name, [("symbol", 1), ("number", 1)])
|
|
23
|
+
|
|
24
|
+
|
|
19
25
|
def sync_real_time_data(str_day, min_number, max_number):
|
|
20
26
|
db_name = 'realtime_quotes_now_' + str_day
|
|
27
|
+
# 创建索引
|
|
28
|
+
create_index(db_name)
|
|
21
29
|
while min_number <= max_number:
|
|
22
30
|
query = {'number': min_number}
|
|
23
31
|
data_df = remote_mongodb_util.find_query_data(db_name, query)
|
|
@@ -31,39 +39,42 @@ def sync_k_line(str_day):
|
|
|
31
39
|
db_name = 'k_line_info'
|
|
32
40
|
data_df = remote_mongodb_util.find_query_data(db_name, query)
|
|
33
41
|
try:
|
|
34
|
-
local_mongodb_util.
|
|
42
|
+
local_mongodb_util.insert_mongo(data_df, db_name)
|
|
35
43
|
except BaseException as e:
|
|
44
|
+
logger.error("出现异常:{}", e)
|
|
36
45
|
pass
|
|
37
46
|
|
|
38
47
|
|
|
39
48
|
if __name__ == '__main__':
|
|
40
|
-
|
|
41
|
-
str_day_01 = '2025-02-18'
|
|
49
|
+
str_day_01 = '2025-09-10'
|
|
42
50
|
sync_k_line(str_day_01)
|
|
51
|
+
|
|
52
|
+
# sync_real_time_data(str_day_01, 1, 2500)
|
|
53
|
+
|
|
43
54
|
# sync_k_line(str_day_01)
|
|
44
55
|
# sync_k_line('2024-11-13')
|
|
45
56
|
# sync_k_line('2024-11-12')
|
|
46
57
|
# sync_k_line('2024-11-15') 232
|
|
47
|
-
|
|
58
|
+
|
|
48
59
|
# sync_real_time_data('2024-11-15', 10, 1010)
|
|
49
60
|
|
|
50
|
-
sync_k_line('2024-12-20')
|
|
51
|
-
sync_k_line('2024-12-19')
|
|
52
|
-
sync_k_line('2024-12-18')
|
|
53
|
-
sync_k_line('2024-12-17')
|
|
54
|
-
sync_k_line('2024-12-16')
|
|
55
|
-
|
|
56
|
-
sync_k_line('2024-12-13')
|
|
57
|
-
sync_k_line('2024-12-12')
|
|
58
|
-
sync_k_line('2024-12-11')
|
|
59
|
-
sync_k_line('2024-12-10')
|
|
60
|
-
sync_k_line('2024-12-09')
|
|
61
|
-
|
|
62
|
-
sync_k_line('2024-12-06')
|
|
63
|
-
sync_k_line('2024-12-05')
|
|
64
|
-
sync_k_line('2024-12-04')
|
|
65
|
-
sync_k_line('2024-12-03')
|
|
66
|
-
sync_k_line('2024-12-02')
|
|
61
|
+
# sync_k_line('2024-12-20')
|
|
62
|
+
# sync_k_line('2024-12-19')
|
|
63
|
+
# sync_k_line('2024-12-18')
|
|
64
|
+
# sync_k_line('2024-12-17')
|
|
65
|
+
# sync_k_line('2024-12-16')
|
|
66
|
+
#
|
|
67
|
+
# sync_k_line('2024-12-13')
|
|
68
|
+
# sync_k_line('2024-12-12')
|
|
69
|
+
# sync_k_line('2024-12-11')
|
|
70
|
+
# sync_k_line('2024-12-10')
|
|
71
|
+
# sync_k_line('2024-12-09')
|
|
72
|
+
#
|
|
73
|
+
# sync_k_line('2024-12-06')
|
|
74
|
+
# sync_k_line('2024-12-05')
|
|
75
|
+
# sync_k_line('2024-12-04')
|
|
76
|
+
# sync_k_line('2024-12-03')
|
|
77
|
+
# sync_k_line('2024-12-02')
|
|
67
78
|
|
|
68
79
|
# sync_real_time_data('2024-12-20', 1000, 2000)
|
|
69
80
|
# sync_real_time_data('2024-11-13', 10, 1010)
|
|
@@ -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
|
|
|
@@ -37,33 +37,33 @@ def sync_k_line(str_day):
|
|
|
37
37
|
|
|
38
38
|
|
|
39
39
|
if __name__ == '__main__':
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
# sync_k_line(
|
|
40
|
+
sync_k_line('2025-08-27')
|
|
41
|
+
# sync_k_line('2025-07-24')
|
|
42
|
+
# sync_k_line('2025-07-25')
|
|
43
43
|
# sync_k_line(str_day_01)
|
|
44
44
|
# sync_k_line('2024-11-13')
|
|
45
45
|
# sync_k_line('2024-11-12')
|
|
46
46
|
# sync_k_line('2024-11-15') 232
|
|
47
|
-
sync_real_time_data(str_day_01,
|
|
47
|
+
# sync_real_time_data(str_day_01, 1, 2000)
|
|
48
48
|
# sync_real_time_data('2024-11-15', 10, 1010)
|
|
49
|
-
|
|
50
|
-
sync_k_line('2024-12-20')
|
|
51
|
-
sync_k_line('2024-12-19')
|
|
52
|
-
sync_k_line('2024-12-18')
|
|
53
|
-
sync_k_line('2024-12-17')
|
|
54
|
-
sync_k_line('2024-12-16')
|
|
55
|
-
|
|
56
|
-
sync_k_line('2024-12-13')
|
|
57
|
-
sync_k_line('2024-12-12')
|
|
58
|
-
sync_k_line('2024-12-11')
|
|
59
|
-
sync_k_line('2024-12-10')
|
|
60
|
-
sync_k_line('2024-12-09')
|
|
61
|
-
|
|
62
|
-
sync_k_line('2024-12-06')
|
|
63
|
-
sync_k_line('2024-12-05')
|
|
64
|
-
sync_k_line('2024-12-04')
|
|
65
|
-
sync_k_line('2024-12-03')
|
|
66
|
-
sync_k_line('2024-12-02')
|
|
49
|
+
#
|
|
50
|
+
# sync_k_line('2024-12-20')
|
|
51
|
+
# sync_k_line('2024-12-19')
|
|
52
|
+
# sync_k_line('2024-12-18')
|
|
53
|
+
# sync_k_line('2024-12-17')
|
|
54
|
+
# sync_k_line('2024-12-16')
|
|
55
|
+
#
|
|
56
|
+
# sync_k_line('2024-12-13')
|
|
57
|
+
# sync_k_line('2024-12-12')
|
|
58
|
+
# sync_k_line('2024-12-11')
|
|
59
|
+
# sync_k_line('2024-12-10')
|
|
60
|
+
# sync_k_line('2024-12-09')
|
|
61
|
+
#
|
|
62
|
+
# sync_k_line('2024-12-06')
|
|
63
|
+
# sync_k_line('2024-12-05')
|
|
64
|
+
# sync_k_line('2024-12-04')
|
|
65
|
+
# sync_k_line('2024-12-03')
|
|
66
|
+
# sync_k_line('2024-12-02')
|
|
67
67
|
|
|
68
68
|
# sync_real_time_data('2024-12-20', 1000, 2000)
|
|
69
69
|
# sync_real_time_data('2024-11-13', 10, 1010)
|
|
@@ -2,12 +2,12 @@ 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
|
import akshare as ak
|
|
9
9
|
from mns_common.db.MongodbUtil import MongodbUtil
|
|
10
|
-
import mns_scheduler.finance.finance_common_api as finance_common_api
|
|
10
|
+
import mns_scheduler.finance.em.finance_common_api as finance_common_api
|
|
11
11
|
import mns_common.constant.db_name_constant as db_name_constant
|
|
12
12
|
|
|
13
13
|
mongodb_util = MongodbUtil('27017')
|
|
@@ -1,8 +1,10 @@
|
|
|
1
1
|
import sys
|
|
2
2
|
import os
|
|
3
3
|
|
|
4
|
+
import pandas as pd
|
|
5
|
+
|
|
4
6
|
file_path = os.path.abspath(__file__)
|
|
5
|
-
end = file_path.index('mns') +
|
|
7
|
+
end = file_path.index('mns') + 17
|
|
6
8
|
project_path = file_path[0:end]
|
|
7
9
|
sys.path.append(project_path)
|
|
8
10
|
|
|
@@ -12,7 +14,7 @@ import mns_common.utils.data_frame_util as data_frame_util
|
|
|
12
14
|
|
|
13
15
|
mongodb_util = MongodbUtil('27017')
|
|
14
16
|
import mns_common.constant.db_name_constant as db_name_constant
|
|
15
|
-
import mns_scheduler.finance.finance_common_api as finance_common_api
|
|
17
|
+
import mns_scheduler.finance.em.finance_common_api as finance_common_api
|
|
16
18
|
from loguru import logger
|
|
17
19
|
|
|
18
20
|
|
|
@@ -293,7 +295,7 @@ def get_em_profit_api(symbol):
|
|
|
293
295
|
else:
|
|
294
296
|
new_profit_df = stock_profit_sheet_by_report_em
|
|
295
297
|
if data_frame_util.is_empty(new_profit_df):
|
|
296
|
-
return
|
|
298
|
+
return pd.DataFrame()
|
|
297
299
|
new_profit_df = new_profit_df.fillna(0)
|
|
298
300
|
return new_profit_df
|
|
299
301
|
|
|
@@ -341,7 +343,7 @@ def check_columns(profit_df):
|
|
|
341
343
|
import mns_common.component.em.em_stock_info_api as em_stock_info_api
|
|
342
344
|
|
|
343
345
|
if __name__ == '__main__':
|
|
344
|
-
get_em_profit_api('
|
|
346
|
+
get_em_profit_api('688302')
|
|
345
347
|
em_df = em_stock_info_api.get_a_stock_info()
|
|
346
348
|
for em_one in em_df.itertuples():
|
|
347
349
|
try:
|