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

Potentially problematic release.


This version of mns-common might be problematic. Click here for more details.

@@ -39,6 +39,20 @@ def classify_symbol(real_time_quotes_now_df):
39
39
  return real_time_quotes_now_df
40
40
 
41
41
 
42
+ # 增加前缀
43
+ def add_pre_prefix(real_time_quotes_now_df):
44
+ real_time_quotes_now_df['symbol_prefix'] = real_time_quotes_now_df['symbol'].apply(
45
+ lambda symbol: add_pre_prefix_one(symbol))
46
+ return real_time_quotes_now_df
47
+
48
+
49
+ # 增加后缀
50
+ def add_after_prefix(real_time_quotes_now_df):
51
+ real_time_quotes_now_df['symbol_prefix'] = real_time_quotes_now_df['symbol'].apply(
52
+ lambda symbol: add_after_prefix_one(symbol))
53
+ return real_time_quotes_now_df
54
+
55
+
42
56
  # 单个股票分类
43
57
  def classify_symbol_one(symbol):
44
58
  if symbol.startswith('3'):
@@ -54,6 +68,27 @@ def classify_symbol_one(symbol):
54
68
  return 'X'
55
69
 
56
70
 
71
+ # 添加前缀
72
+ def add_pre_prefix_one(symbol):
73
+ symbol_simple = symbol[0:6]
74
+ if symbol_simple.startswith('6'):
75
+ return 'SH' + symbol
76
+ elif symbol_simple.startswith('0') or symbol_simple.startswith('3'):
77
+ return 'SZ' + symbol
78
+ else:
79
+ return 'BJ' + symbol
80
+
81
+ # 添加后缀
82
+ def add_after_prefix_one(symbol):
83
+ symbol_simple = symbol[0:6]
84
+ if symbol_simple.startswith('6'):
85
+ return symbol + '.SH'
86
+ elif symbol_simple.startswith('0') or symbol_simple.startswith('3'):
87
+ return symbol + '.SZ'
88
+ else:
89
+ return symbol + '.BJ'
90
+
91
+
57
92
  def symbol_amount_simple(real_time_quotes_now_df):
58
93
  real_time_quotes_now_df['amount_level'] = round(real_time_quotes_now_df['amount'] / HUNDRED_MILLION, 2)
59
94
  return real_time_quotes_now_df
@@ -1,4 +1,4 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: mns-common
3
- Version: 1.3.9.1
3
+ Version: 1.3.9.2
4
4
 
@@ -73,7 +73,7 @@ mns_common/api/us/ths_us_company_info_api.py,sha256=qQjv4F-ovQ2uuu-FlBAnxjvVA7qj
73
73
  mns_common/api/xueqiu/__init__.py,sha256=wEg73KlZo-dU0yKGwpA1C2y6LZm4IBb94tNda1tqLeg,163
74
74
  mns_common/api/xueqiu/xue_qiu_k_line_api.py,sha256=Vqal_JvHCYFGPZ5CK2BSgMPQ7ull2N3G79UsJ3sfu2k,4586
75
75
  mns_common/component/__init__.py,sha256=2U9DiKslxsWwLLEcZKjS8UiQPN1QgALvnK3HiJNIZE0,163
76
- mns_common/component/common_service_fun_api.py,sha256=H7HZ-6uxup5unWe2JazNw_EBMLj2As82FC0QqPvao7c,5536
76
+ mns_common/component/common_service_fun_api.py,sha256=ZPPqo-ZBwSJ23I_2xXGxXyN6emYrlPqUuBGjA2Cv4gs,6629
77
77
  mns_common/component/cache/__init__.py,sha256=2U9DiKslxsWwLLEcZKjS8UiQPN1QgALvnK3HiJNIZE0,163
78
78
  mns_common/component/cache/cache_service.py,sha256=QX7tjR1iGsoCyGt6O41w8aRbZ-3xXQ-53Ps3nmUzAGQ,809
79
79
  mns_common/component/classify/__init__.py,sha256=wEg73KlZo-dU0yKGwpA1C2y6LZm4IBb94tNda1tqLeg,163
@@ -150,7 +150,7 @@ mns_common/utils/date_handle_util.py,sha256=XS-MyA8_7k35LOCFAYOHgVcVkMft_Kc4Wa9U
150
150
  mns_common/utils/db_util.py,sha256=hSmfNAN4vEeEaUva6_cicZEhb2jSnib-Gvk2reke1vc,2590
151
151
  mns_common/utils/file_util.py,sha256=egWu6PenGPRp_ixrNTHKarT4dAnOT6FETR82EHUZJnQ,1042
152
152
  mns_common/utils/ip_util.py,sha256=UTcYfz_uytB__6nlBf7T-izuI7hi4XdB6ET0sJgEel4,969
153
- mns_common-1.3.9.1.dist-info/METADATA,sha256=nvwdxZ3uDb6JLCMDSBLW9cb2cFGYF0DV24VcXTCoXxg,61
154
- mns_common-1.3.9.1.dist-info/WHEEL,sha256=tZoeGjtWxWRfdplE7E3d45VPlLNQnvbKiYnx7gwAy8A,92
155
- mns_common-1.3.9.1.dist-info/top_level.txt,sha256=ZC58kAR-8Hvc6U2xhYNBNLAh3mb6sZazbdj5nZpvEkQ,11
156
- mns_common-1.3.9.1.dist-info/RECORD,,
153
+ mns_common-1.3.9.2.dist-info/METADATA,sha256=ztJJXpd0wcfXSWBv5jQDyfAYzDasTR2wPLdPuVhyYQ0,61
154
+ mns_common-1.3.9.2.dist-info/WHEEL,sha256=tZoeGjtWxWRfdplE7E3d45VPlLNQnvbKiYnx7gwAy8A,92
155
+ mns_common-1.3.9.2.dist-info/top_level.txt,sha256=ZC58kAR-8Hvc6U2xhYNBNLAh3mb6sZazbdj5nZpvEkQ,11
156
+ mns_common-1.3.9.2.dist-info/RECORD,,