mns-common 1.3.1.2__py3-none-any.whl → 1.3.1.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.

@@ -68,6 +68,12 @@ def set_ths_concept(symbol, df):
68
68
 
69
69
  df['ths_concept_name_list_str'] = "-"
70
70
 
71
+ df['ths_concept_most_relative_name'] = "未有"
72
+
73
+ df['ths_concept_most_relative_code'] = 0
74
+
75
+ df['ths_concept_list'] = [[] for _ in range(len(df))]
76
+
71
77
  if ths_stock_concept_detail.shape[0] == 0:
72
78
  return df
73
79
 
@@ -83,6 +89,8 @@ def set_ths_concept(symbol, df):
83
89
  ths_stock_concept_detail = ths_stock_concept_detail[[
84
90
  'concept_code',
85
91
  'concept_name',
92
+ 'grade',
93
+ 'remark',
86
94
  'str_day',
87
95
  'str_now_time',
88
96
  'concept_create_day']]
@@ -91,12 +99,17 @@ def set_ths_concept(symbol, df):
91
99
 
92
100
  df.loc[:, 'ths_concept_list_info'] = ths_stock_concept_detail.to_string(index=False)
93
101
  df.loc[:, 'ths_concept_name_list_str'] = concept_name_str
102
+ ths_concept_list_record = ths_stock_concept_detail.to_dict(orient='records')
103
+ df.at[df.index[0], 'ths_concept_list'] = ths_concept_list_record
94
104
 
95
105
  ths_effective_concept_list = get_all_ths_effective_concept()
96
106
  ths_effective_concept_code_list = list(ths_effective_concept_list['symbol'])
97
107
 
98
108
  ths_stock_concept_detail_effective = ths_stock_concept_detail.loc[
99
109
  ths_stock_concept_detail['concept_code'].isin(ths_effective_concept_code_list)]
110
+
111
+ ths_stock_concept_detail_effective = ths_stock_concept_detail_effective.sort_values(by=['concept_code'],
112
+ ascending=False)
100
113
  ths_concept_count = ths_stock_concept_detail_effective.shape[0]
101
114
 
102
115
  df.loc[:, 'ths_concept_count'] = ths_concept_count
@@ -116,6 +129,21 @@ def set_ths_concept(symbol, df):
116
129
 
117
130
  df['ths_concept_sync_day'] = list(ths_stock_concept_detail_last_one['str_day'])[0]
118
131
 
132
+ ths_stock_concept_detail_effective = ths_stock_concept_detail_effective.sort_values(by=['grade'],
133
+ ascending=False)
134
+
135
+ # 最相关的概念
136
+ ths_stock_concept_detail_most_relative_one = ths_stock_concept_detail_effective.iloc[0:1]
137
+
138
+ if ths_stock_concept_detail_most_relative_one['concept_name'] is None:
139
+ df['ths_concept_most_relative_name'] = "未有"
140
+ else:
141
+ df['ths_concept_most_relative_name'] = list(ths_stock_concept_detail_last_one['concept_name'])[0]
142
+ if ths_stock_concept_detail_most_relative_one['concept_code'] is None:
143
+ df['ths_concept_most_relative_code'] = 0
144
+ else:
145
+ df['ths_concept_most_relative_code'] = list(ths_stock_concept_detail_most_relative_one['concept_code'])[0]
146
+
119
147
  return df
120
148
 
121
149
 
@@ -235,9 +263,6 @@ def get_choose_effective_ths_concept_no_cache():
235
263
 
236
264
 
237
265
  if __name__ == '__main__':
238
- clear_effective_ths_concept_cache()
239
- while True:
240
- symbol_test = '885923'
241
- get_one_symbol_all_ths_concept(symbol_test)
242
- clear_one_concept_cache(symbol_test)
243
- print(1)
266
+ symbol_test = '300085'
267
+ company_info_df = mongodb_util.find_query_data('company_info', {"symbol": symbol_test})
268
+ set_ths_concept(symbol_test, company_info_df)
@@ -1,4 +1,4 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: mns_common
3
- Version: 1.3.1.2
3
+ Version: 1.3.1.4
4
4
 
@@ -70,7 +70,7 @@ mns_common/component/company/company_common_service_api.py,sha256=pqb11v5y0uFWJt
70
70
  mns_common/component/company/company_common_service_new_api.py,sha256=lSPsNzvxOK7MEHtXz8ZaBV3haCXIQY8Bs8hMPYH5V_U,5542
71
71
  mns_common/component/concept/__init__.py,sha256=2U9DiKslxsWwLLEcZKjS8UiQPN1QgALvnK3HiJNIZE0,163
72
72
  mns_common/component/concept/kpl_concept_common_service_api.py,sha256=Ruc3INOhVjB0X1LeMRX0zL3uhv9OLweG2hj6wkZffow,3235
73
- mns_common/component/concept/ths_concept_common_service_api.py,sha256=ik_3T0oWtyTWYOSjmSEGrcd32DsvoHqiEYeGDMLIRRg,10270
73
+ mns_common/component/concept/ths_concept_common_service_api.py,sha256=yU-DU5gFHYYKNYqhgXpOBC54lsAbcIl7YdyyOFmlpLo,11662
74
74
  mns_common/component/cookie/__init__.py,sha256=wEg73KlZo-dU0yKGwpA1C2y6LZm4IBb94tNda1tqLeg,163
75
75
  mns_common/component/cookie/cookie_info_service.py,sha256=IIFKj84dnBrUOt2Wl6kbCj-BDdFX_X9z8IIk4LxLNTc,754
76
76
  mns_common/component/data/__init__.py,sha256=2U9DiKslxsWwLLEcZKjS8UiQPN1QgALvnK3HiJNIZE0,163
@@ -125,7 +125,7 @@ mns_common/utils/date_handle_util.py,sha256=P4WJUmoDpo4IoCrt2z4keyr7pqXHKmCZBVod
125
125
  mns_common/utils/db_util.py,sha256=hSmfNAN4vEeEaUva6_cicZEhb2jSnib-Gvk2reke1vc,2590
126
126
  mns_common/utils/file_util.py,sha256=egWu6PenGPRp_ixrNTHKarT4dAnOT6FETR82EHUZJnQ,1042
127
127
  mns_common/utils/ip_util.py,sha256=UTcYfz_uytB__6nlBf7T-izuI7hi4XdB6ET0sJgEel4,969
128
- mns_common-1.3.1.2.dist-info/METADATA,sha256=uww6ToOYzqwkZ_duiWpxMiOLBaDLmfmxfa105P107EA,61
129
- mns_common-1.3.1.2.dist-info/WHEEL,sha256=GJ7t_kWBFywbagK5eo9IoUwLW6oyOeTKmQ-9iHFVNxQ,92
130
- mns_common-1.3.1.2.dist-info/top_level.txt,sha256=ZC58kAR-8Hvc6U2xhYNBNLAh3mb6sZazbdj5nZpvEkQ,11
131
- mns_common-1.3.1.2.dist-info/RECORD,,
128
+ mns_common-1.3.1.4.dist-info/METADATA,sha256=yjQfwsPlK0Hh0eZyxf-dMBmchK4MpiMHjEAzO45rdCc,61
129
+ mns_common-1.3.1.4.dist-info/WHEEL,sha256=GJ7t_kWBFywbagK5eo9IoUwLW6oyOeTKmQ-9iHFVNxQ,92
130
+ mns_common-1.3.1.4.dist-info/top_level.txt,sha256=ZC58kAR-8Hvc6U2xhYNBNLAh3mb6sZazbdj5nZpvEkQ,11
131
+ mns_common-1.3.1.4.dist-info/RECORD,,