ezKit 1.12.18__py3-none-any.whl → 1.12.19__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/utils.py +23 -0
- {ezkit-1.12.18.dist-info → ezkit-1.12.19.dist-info}/METADATA +1 -1
- {ezkit-1.12.18.dist-info → ezkit-1.12.19.dist-info}/RECORD +6 -6
- {ezkit-1.12.18.dist-info → ezkit-1.12.19.dist-info}/WHEEL +0 -0
- {ezkit-1.12.18.dist-info → ezkit-1.12.19.dist-info}/licenses/LICENSE +0 -0
- {ezkit-1.12.18.dist-info → ezkit-1.12.19.dist-info}/top_level.txt +0 -0
ezKit/utils.py
CHANGED
@@ -1345,3 +1345,26 @@ def markdown_to_html(markdown_file: str, html_file: str, title: str) -> bool:
|
|
1345
1345
|
logger.error(f"{info} [错误]")
|
1346
1346
|
logger.error(e)
|
1347
1347
|
return False
|
1348
|
+
|
1349
|
+
|
1350
|
+
# --------------------------------------------------------------------------------------------------
|
1351
|
+
|
1352
|
+
|
1353
|
+
def convert_field_to_datetime(data: list[dict], field: str, fmt: str = "%Y-%m-%d %H:%M:%S"):
|
1354
|
+
"""
|
1355
|
+
将列表中每个 dict 的指定字段转换为 datetime 对象
|
1356
|
+
|
1357
|
+
参数:
|
1358
|
+
data (list[dict]): 列表数据
|
1359
|
+
field (str): 要转换的字段名
|
1360
|
+
fmt (str): 字符串的时间格式, 默认 "%Y-%m-%d %H:%M:%S"
|
1361
|
+
"""
|
1362
|
+
_data = deepcopy(data)
|
1363
|
+
for item in _data:
|
1364
|
+
value = item.get(field)
|
1365
|
+
if isinstance(value, str):
|
1366
|
+
try:
|
1367
|
+
item[field] = datetime.strptime(value, fmt)
|
1368
|
+
except ValueError:
|
1369
|
+
pass
|
1370
|
+
return _data
|
@@ -12,11 +12,11 @@ ezKit/qywx.py,sha256=3SMm63xJw7Yrj67rvvHIH0ot5PbRHtohShqXLcH0BF0,10325
|
|
12
12
|
ezKit/redis.py,sha256=leAre527XDBmA_FsjlqQ2_JT1eqwM9uvpYid1Ir1Va4,1972
|
13
13
|
ezKit/sendemail.py,sha256=xqlFyRp96zggSN3eF3fCBXi0WMwGbOZxwDWkpQMCn9I,7412
|
14
14
|
ezKit/token.py,sha256=Ac-i9xfq4TqpGyfCzakjrh4NYzxHiN2sCQrMk1tzVi8,1716
|
15
|
-
ezKit/utils.py,sha256=
|
15
|
+
ezKit/utils.py,sha256=U457ahFkxIXuB-qWvS3995xJs-LlkFIX5_ZWVgmL5cY,43130
|
16
16
|
ezKit/xftp.py,sha256=-XQXyhMqeigT63P6sXkSS7r4GROXyqqlkzKxITLWG-g,8278
|
17
17
|
ezKit/zabbix.py,sha256=PkMnfu7mcuotwwIIsHaC9FsNg-gap6hD1xvm0AwSL1Y,33777
|
18
|
-
ezkit-1.12.
|
19
|
-
ezkit-1.12.
|
20
|
-
ezkit-1.12.
|
21
|
-
ezkit-1.12.
|
22
|
-
ezkit-1.12.
|
18
|
+
ezkit-1.12.19.dist-info/licenses/LICENSE,sha256=OXLcl0T2SZ8Pmy2_dmlvKuetivmyPd5m1q-Gyd-zaYY,35149
|
19
|
+
ezkit-1.12.19.dist-info/METADATA,sha256=l0sxeewJzBAmoJ5mDgPX5Y5b3fUFRXrAsM5ejbZ6x7c,317
|
20
|
+
ezkit-1.12.19.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
|
21
|
+
ezkit-1.12.19.dist-info/top_level.txt,sha256=aYLB_1WODsqNTsTFWcKP-BN0KCTKcV-HZJ4zlHkCFw8,6
|
22
|
+
ezkit-1.12.19.dist-info/RECORD,,
|
File without changes
|
File without changes
|
File without changes
|