ezKit 1.9.11__tar.gz → 1.9.12__tar.gz

Sign up to get free protection for your applications and to get access to all the features.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: ezKit
3
- Version: 1.9.11
3
+ Version: 1.9.12
4
4
  Summary: Easy Kit
5
5
  Author: septvean
6
6
  Author-email: septvean@gmail.com
@@ -317,18 +317,28 @@ def save_data_to_database(engine: Engine, code: str, latest: bool = False) -> bo
317
317
 
318
318
  logger.info(f"{info} ......")
319
319
 
320
+ # 代码名称转换
321
+ name = coderename(code)
322
+
323
+ if not isinstance(name, str):
324
+ logger.error(f"{info} [代码名称转换错误]")
325
+ return False
326
+
327
+ # 获取数据
320
328
  df: DataFrame | None = get_stock_data_from_akshare(code)
321
329
 
322
330
  if df is None:
323
- logger.error(f"{info} [获取数据失败]")
331
+ logger.error(f"{info} [获取数据错误]")
324
332
  return False
325
333
 
326
- name = coderename(code)
334
+ # 计算数据
335
+ df: DataFrame | None = data_vector(df)
327
336
 
328
- if not isinstance(name, str):
329
- logger.error(f"{info} [代码名称转换失败]")
337
+ if df is None:
338
+ logger.error(f"{info} [计算数据错误]")
330
339
  return False
331
340
 
341
+ # 保存到数据库
332
342
  if utils.isTrue(latest, bool):
333
343
  df = df.tail(1)
334
344
  df.to_sql(name=name, con=engine, if_exists="append", index=False)
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: ezKit
3
- Version: 1.9.11
3
+ Version: 1.9.12
4
4
  Summary: Easy Kit
5
5
  Author: septvean
6
6
  Author-email: septvean@gmail.com
@@ -3,7 +3,7 @@ from setuptools import find_packages, setup
3
3
 
4
4
  setup(
5
5
  name='ezKit',
6
- version='1.9.11',
6
+ version='1.9.12',
7
7
  author='septvean',
8
8
  author_email='septvean@gmail.com',
9
9
  description='Easy Kit',
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes