cmesdata 1.2.33__tar.gz → 1.2.35__tar.gz

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.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: cmesdata
3
- Version: 1.2.33
3
+ Version: 1.2.35
4
4
  Summary: cmes-data.com
5
5
  Author: cmes-data.com
6
6
  Requires-Dist: click
@@ -185,6 +185,14 @@ def get_history_data(code, start_date, end_date, period, index=False):
185
185
  def get_index_data(code, start_date, end_date, period):
186
186
  return get_history_data(code, start_date, end_date, period, index=True)
187
187
 
188
+ _ETF_CODE_PREFIX = ('15', '16', '50', '51', '56', '58')
189
+ _ETF_PRICE_COLS = (
190
+ '价格', '昨收价', '开盘价', '最高价', '最低价',
191
+ '买一价', '买二价', '买三价', '买四价', '买五价',
192
+ '卖一价', '卖二价', '卖三价', '卖四价', '卖五价',
193
+ )
194
+
195
+
188
196
  def get_real_hq(all_stock):
189
197
  try:
190
198
  if len(all_stock) > 80 or not Init():
@@ -213,6 +221,9 @@ def get_real_hq(all_stock):
213
221
  '卖一量',
214
222
  '买二价', '卖二价', '买二量', '卖二量', '买三价', '卖三价', '买三量', '卖三量', '买四价',
215
223
  '卖四价', '买四量', '卖四量', '买五价', '卖五价', '买五量', '卖五量', ]
224
+ etf = combined_df['代码'].astype(str).str[-6:].str[:2].isin(_ETF_CODE_PREFIX)
225
+ if etf.any():
226
+ combined_df.loc[etf, list(_ETF_PRICE_COLS)] *= 0.1
216
227
  return combined_df
217
228
  except:
218
229
  print_info()
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: cmesdata
3
- Version: 1.2.33
3
+ Version: 1.2.35
4
4
  Summary: cmes-data.com
5
5
  Author: cmes-data.com
6
6
  Requires-Dist: click
@@ -2,7 +2,7 @@ import setuptools
2
2
 
3
3
  setuptools.setup(
4
4
  name='cmesdata',
5
- version='1.2.33',
5
+ version='1.2.35',
6
6
  description='cmes-data.com',
7
7
  author='cmes-data.com',
8
8
  packages=setuptools.find_packages(),
File without changes
File without changes