ezKit 1.9.6__py3-none-any.whl → 1.9.7__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 +9 -2
- {ezKit-1.9.6.dist-info → ezKit-1.9.7.dist-info}/METADATA +1 -1
- {ezKit-1.9.6.dist-info → ezKit-1.9.7.dist-info}/RECORD +6 -6
- {ezKit-1.9.6.dist-info → ezKit-1.9.7.dist-info}/LICENSE +0 -0
- {ezKit-1.9.6.dist-info → ezKit-1.9.7.dist-info}/WHEEL +0 -0
- {ezKit-1.9.6.dist-info → ezKit-1.9.7.dist-info}/top_level.txt +0 -0
ezKit/stock.py
CHANGED
@@ -295,13 +295,20 @@ def save_data_to_database(engine: Engine, code: str, latest: bool = False) -> bo
|
|
295
295
|
df: DataFrame | None = get_stock_data_from_akshare(code)
|
296
296
|
|
297
297
|
if df is None:
|
298
|
+
logger.error(f"{info} [获取数据失败]")
|
299
|
+
return False
|
300
|
+
|
301
|
+
name = coderename(code)
|
302
|
+
|
303
|
+
if not isinstance(name, str):
|
304
|
+
logger.error(f"{info} [代码名称转换失败]")
|
298
305
|
return False
|
299
306
|
|
300
307
|
if utils.isTrue(latest, bool):
|
301
308
|
df = df.tail(1)
|
302
|
-
df.to_sql(name=
|
309
|
+
df.to_sql(name=name, con=engine, if_exists="append", index=False)
|
303
310
|
else:
|
304
|
-
df.to_sql(name=
|
311
|
+
df.to_sql(name=name, con=engine, if_exists="replace", index=False)
|
305
312
|
|
306
313
|
logger.success(f"{info} [成功]")
|
307
314
|
|
@@ -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=cbL0ZXCur4G290wFN5ynmLmMjgDRNSvVQgsE_0jSQKU,11802
|
13
13
|
ezKit/token.py,sha256=HKREyZj_T2S8-aFoFIrBXTaCKExQq4zE66OHXhGHqQg,1750
|
14
14
|
ezKit/utils.py,sha256=-gvuVXSoYRIjjuHfE0WYr2BegetpFCfY-juo3253FMs,43900
|
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.7.dist-info/LICENSE,sha256=OXLcl0T2SZ8Pmy2_dmlvKuetivmyPd5m1q-Gyd-zaYY,35149
|
17
|
+
ezKit-1.9.7.dist-info/METADATA,sha256=wwaS8u0m9Is3p2BcR7ScDmLSCWEEwPzMndNvLhPFjbI,190
|
18
|
+
ezKit-1.9.7.dist-info/WHEEL,sha256=PZUExdf71Ui_so67QXpySuHtCi3-J3wvF4ORK6k_S8U,91
|
19
|
+
ezKit-1.9.7.dist-info/top_level.txt,sha256=aYLB_1WODsqNTsTFWcKP-BN0KCTKcV-HZJ4zlHkCFw8,6
|
20
|
+
ezKit-1.9.7.dist-info/RECORD,,
|
File without changes
|
File without changes
|
File without changes
|