ezKit 1.9.11__py3-none-any.whl → 1.9.12__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.
- ezKit/stock.py +14 -4
- {ezKit-1.9.11.dist-info → ezKit-1.9.12.dist-info}/METADATA +1 -1
- {ezKit-1.9.11.dist-info → ezKit-1.9.12.dist-info}/RECORD +6 -6
- {ezKit-1.9.11.dist-info → ezKit-1.9.12.dist-info}/LICENSE +0 -0
- {ezKit-1.9.11.dist-info → ezKit-1.9.12.dist-info}/WHEEL +0 -0
- {ezKit-1.9.11.dist-info → ezKit-1.9.12.dist-info}/top_level.txt +0 -0
ezKit/stock.py
CHANGED
@@ -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
|
-
|
334
|
+
# 计算数据
|
335
|
+
df: DataFrame | None = data_vector(df)
|
327
336
|
|
328
|
-
if
|
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)
|
@@ -9,12 +9,12 @@ ezKit/mongo.py,sha256=dOm_1wXEPp_e8Ml5Qq78M7FDNrQUAZaThzVIiiLJJwk,2393
|
|
9
9
|
ezKit/qywx.py,sha256=X_H4fzP-iEqeDEbumr7D1bXi6dxczaxfO8iyutzy02s,7171
|
10
10
|
ezKit/redis.py,sha256=g2_V4jvq0djRc20jLZkgeAeF_bYrq-Rbl_kHcCUPZcA,1965
|
11
11
|
ezKit/sendemail.py,sha256=tRXCsJm_RfTJ9xEWe_lTQ5kOs2JxHGPXvq0oWA7prq0,7263
|
12
|
-
ezKit/stock.py,sha256=
|
12
|
+
ezKit/stock.py,sha256=4wphZahpiDs0MuPVCUcD22joOQldJhmXjogdroxyR00,12346
|
13
13
|
ezKit/token.py,sha256=HKREyZj_T2S8-aFoFIrBXTaCKExQq4zE66OHXhGHqQg,1750
|
14
14
|
ezKit/utils.py,sha256=TDsL3PRkQy6NdZgphkgwacbWvHqEmq4LOkfNzmxV4DY,42682
|
15
15
|
ezKit/xftp.py,sha256=XyIdr_2rxRVLqPofG6fIYWhAMVsFwTyp46dg5P9FLW4,7774
|
16
|
-
ezKit-1.9.
|
17
|
-
ezKit-1.9.
|
18
|
-
ezKit-1.9.
|
19
|
-
ezKit-1.9.
|
20
|
-
ezKit-1.9.
|
16
|
+
ezKit-1.9.12.dist-info/LICENSE,sha256=OXLcl0T2SZ8Pmy2_dmlvKuetivmyPd5m1q-Gyd-zaYY,35149
|
17
|
+
ezKit-1.9.12.dist-info/METADATA,sha256=cCgqBuFpmH0zpv8j267E9tTkm6q1WzdfOhUCwS3MTjI,191
|
18
|
+
ezKit-1.9.12.dist-info/WHEEL,sha256=PZUExdf71Ui_so67QXpySuHtCi3-J3wvF4ORK6k_S8U,91
|
19
|
+
ezKit-1.9.12.dist-info/top_level.txt,sha256=aYLB_1WODsqNTsTFWcKP-BN0KCTKcV-HZJ4zlHkCFw8,6
|
20
|
+
ezKit-1.9.12.dist-info/RECORD,,
|
File without changes
|
File without changes
|
File without changes
|