mns-scheduler 1.3.5.9__py3-none-any.whl → 1.3.6.0__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/base/sync_company_product_area_industry.py +62 -0
- {mns_scheduler-1.3.5.9.dist-info → mns_scheduler-1.3.6.0.dist-info}/METADATA +1 -1
- {mns_scheduler-1.3.5.9.dist-info → mns_scheduler-1.3.6.0.dist-info}/RECORD +5 -4
- {mns_scheduler-1.3.5.9.dist-info → mns_scheduler-1.3.6.0.dist-info}/WHEEL +0 -0
- {mns_scheduler-1.3.5.9.dist-info → mns_scheduler-1.3.6.0.dist-info}/top_level.txt +0 -0
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
import os
|
|
2
|
+
import sys
|
|
3
|
+
|
|
4
|
+
file_path = os.path.abspath(__file__)
|
|
5
|
+
end = file_path.index('mns') + 17
|
|
6
|
+
project_path = file_path[0:end]
|
|
7
|
+
sys.path.append(project_path)
|
|
8
|
+
import mns_common.component.em.em_stock_info_api as em_stock_info_api
|
|
9
|
+
import mns_common.component.common_service_fun_api as common_service_fun_api
|
|
10
|
+
import mns_common.api.ths.company.company_product_area_industry_index_query as company_product_area_industry_index_query
|
|
11
|
+
from loguru import logger
|
|
12
|
+
import pandas as pd
|
|
13
|
+
from mns_common.db.MongodbUtil import MongodbUtil
|
|
14
|
+
import mns_common.constant.db_name_constant as db_name_constant
|
|
15
|
+
|
|
16
|
+
mongodb_util = MongodbUtil('27017')
|
|
17
|
+
|
|
18
|
+
|
|
19
|
+
def sync_company_product_area_industry(symbol):
|
|
20
|
+
real_time_quotes_all_stocks = em_stock_info_api.get_a_stock_info()
|
|
21
|
+
real_time_quotes_all_stocks = common_service_fun_api.classify_symbol(real_time_quotes_all_stocks)
|
|
22
|
+
if symbol is not None:
|
|
23
|
+
real_time_quotes_all_stocks = real_time_quotes_all_stocks.loc[real_time_quotes_all_stocks['symbol'] == symbol]
|
|
24
|
+
for stock_one in real_time_quotes_all_stocks.itertuples():
|
|
25
|
+
try:
|
|
26
|
+
symbol = stock_one.symbol
|
|
27
|
+
classification = stock_one.classification
|
|
28
|
+
if classification in ['H', 'K']:
|
|
29
|
+
market = '17'
|
|
30
|
+
elif classification in ['S', 'C']:
|
|
31
|
+
market = '33'
|
|
32
|
+
elif classification in ['X']:
|
|
33
|
+
market = '151'
|
|
34
|
+
|
|
35
|
+
company_product_area_industry_list = company_product_area_industry_index_query.company_product_area_industry(
|
|
36
|
+
symbol, market)
|
|
37
|
+
for company_one in company_product_area_industry_list:
|
|
38
|
+
analysis_type = company_one['analysis_type']
|
|
39
|
+
time_operate_index_item_list = company_one['time_operate_index_item_list']
|
|
40
|
+
time_operate_index_item_df = pd.DataFrame(time_operate_index_item_list)
|
|
41
|
+
time_operate_index_item_df['symbol'] = symbol
|
|
42
|
+
time_operate_index_item_df['analysis_type'] = analysis_type
|
|
43
|
+
|
|
44
|
+
time_operate_index_item_df['_id'] = symbol + '_' + time_operate_index_item_df['time']
|
|
45
|
+
mongodb_util.save_mongo(time_operate_index_item_df, db_name_constant.COMPANY_BUSINESS_INFO)
|
|
46
|
+
|
|
47
|
+
except BaseException as e:
|
|
48
|
+
logger.error("同步经营数据:{},{}", stock_one.symbol, e)
|
|
49
|
+
|
|
50
|
+
return None
|
|
51
|
+
|
|
52
|
+
|
|
53
|
+
if __name__ == '__main__':
|
|
54
|
+
sync_company_product_area_industry('600805')
|
|
55
|
+
sync_company_product_area_industry('002323')
|
|
56
|
+
sync_company_product_area_industry('300901')
|
|
57
|
+
sync_company_product_area_industry('603225')
|
|
58
|
+
sync_company_product_area_industry('688039')
|
|
59
|
+
sync_company_product_area_industry('600849')
|
|
60
|
+
sync_company_product_area_industry('000508')
|
|
61
|
+
sync_company_product_area_industry('810011')
|
|
62
|
+
# sync_company_product_area_industry()
|
|
@@ -5,6 +5,7 @@ mns_scheduler/company_info/announce/company_announce_sync_service.py,sha256=q8zY
|
|
|
5
5
|
mns_scheduler/company_info/base/__init__.py,sha256=QWBdZwBCvQw8aS4hnL9_pg3U3ZiNLUXzlImyy9WhUcI,163
|
|
6
6
|
mns_scheduler/company_info/base/sync_company_base_info_api.py,sha256=SIBQqUbAZXGCfAoYq78McvIZ6vrttlCfAlqhZl23z9U,21050
|
|
7
7
|
mns_scheduler/company_info/base/sync_company_hold_info_api.py,sha256=ep9CthkoL_NNqkZgAeAdZqaf7_LNFDCrZonUjrT7w5o,1587
|
|
8
|
+
mns_scheduler/company_info/base/sync_company_product_area_industry.py,sha256=WX5ydJJXc4McIJQyByY7c3i9XDmR393mDLF2Cpg2Xe8,2847
|
|
8
9
|
mns_scheduler/company_info/clean/__init__.py,sha256=QWBdZwBCvQw8aS4hnL9_pg3U3ZiNLUXzlImyy9WhUcI,163
|
|
9
10
|
mns_scheduler/company_info/clean/company_info_clean_api.py,sha256=P_-Nms6S1nVyqVOFKDT-Cq1RvriZV4IMz9eZCDF5Ovk,6104
|
|
10
11
|
mns_scheduler/company_info/constant/__init__.py,sha256=QWBdZwBCvQw8aS4hnL9_pg3U3ZiNLUXzlImyy9WhUcI,163
|
|
@@ -164,7 +165,7 @@ mns_scheduler/zz_task/data_sync_task.py,sha256=ar3l9eBe3z5WmdAMNqiaQJrIPUpUR1Kbw
|
|
|
164
165
|
mns_scheduler/zz_task/compensation/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
165
166
|
mns_scheduler/zz_task/compensation/compensate_task.py,sha256=Dyo66NcSnXZ-Cne4_v77BBb27SemAiuGXRLnvQ26X0E,6464
|
|
166
167
|
mns_scheduler/zz_task/compensation/compensate_task_one_day.py,sha256=ize69Ocy1k5rf8Xckk1izcEJ361HBtWH1zoJrScBS28,5751
|
|
167
|
-
mns_scheduler-1.3.
|
|
168
|
-
mns_scheduler-1.3.
|
|
169
|
-
mns_scheduler-1.3.
|
|
170
|
-
mns_scheduler-1.3.
|
|
168
|
+
mns_scheduler-1.3.6.0.dist-info/METADATA,sha256=xob4Vod--zYnJRi3RHylfhxBVTz62os77lhRlES3DPE,64
|
|
169
|
+
mns_scheduler-1.3.6.0.dist-info/WHEEL,sha256=tZoeGjtWxWRfdplE7E3d45VPlLNQnvbKiYnx7gwAy8A,92
|
|
170
|
+
mns_scheduler-1.3.6.0.dist-info/top_level.txt,sha256=PXQDFBGR1pWmsUbH5yiLAh71P5HZODTRED0zJ8CCgOc,14
|
|
171
|
+
mns_scheduler-1.3.6.0.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|