arpakitlib 1.8.92__py3-none-any.whl → 1.8.93__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.
- arpakitlib/ar_need_type_util.py +8 -2
- {arpakitlib-1.8.92.dist-info → arpakitlib-1.8.93.dist-info}/METADATA +1 -1
- {arpakitlib-1.8.92.dist-info → arpakitlib-1.8.93.dist-info}/RECORD +6 -6
- {arpakitlib-1.8.92.dist-info → arpakitlib-1.8.93.dist-info}/LICENSE +0 -0
- {arpakitlib-1.8.92.dist-info → arpakitlib-1.8.93.dist-info}/WHEEL +0 -0
- {arpakitlib-1.8.92.dist-info → arpakitlib-1.8.93.dist-info}/entry_points.txt +0 -0
arpakitlib/ar_need_type_util.py
CHANGED
@@ -45,8 +45,11 @@ def parse_need_type(value: Any, need_type: str, allow_none: bool = False) -> Any
|
|
45
45
|
res = value.removeprefix("[").removesuffix("]")
|
46
46
|
res = [int(num.strip()) for num in res.split(",")]
|
47
47
|
elif need_type == NeedTypes.list_of_str:
|
48
|
-
res = value.removeprefix("[").removesuffix("]")
|
49
|
-
|
48
|
+
res = value.removeprefix("[").removesuffix("]").strip()
|
49
|
+
if not res:
|
50
|
+
res = []
|
51
|
+
else:
|
52
|
+
res = [num.strip() for num in res.split(",")]
|
50
53
|
elif need_type == NeedTypes.list_of_float:
|
51
54
|
res = value.removeprefix("[").removesuffix("]")
|
52
55
|
res = [float(num.strip()) for num in res.split(",")]
|
@@ -67,6 +70,9 @@ def __example():
|
|
67
70
|
print(parse_need_type(value='[1.1, 2.2, 3.3]', need_type="list_of_float"))
|
68
71
|
print(parse_need_type(value='{"key": "value"}', need_type="json"))
|
69
72
|
print(parse_need_type(value="hello world", need_type="str"))
|
73
|
+
print(parse_need_type(value="[]", need_type=NeedTypes.list_of_str))
|
74
|
+
print(parse_need_type(value="", need_type=NeedTypes.list_of_str))
|
75
|
+
print(parse_need_type(value="none,asfasfas", need_type=NeedTypes.list_of_str))
|
70
76
|
|
71
77
|
|
72
78
|
if __name__ == '__main__':
|
@@ -368,7 +368,7 @@ arpakitlib/ar_list_of_dicts_to_xlsx.py,sha256=MyjEl4Jl4beLVZqLVQMMv0-XDtBD3Xh4Z_
|
|
368
368
|
arpakitlib/ar_list_util.py,sha256=2woOAHAU8oTIiVjZ8GLnx15odEaoQUq3Q0JPxlufFF0,457
|
369
369
|
arpakitlib/ar_logging_util.py,sha256=GLw87L6qUASHS4-eAoBW0kN2hHXVdmWcmE9huw-J5aI,1681
|
370
370
|
arpakitlib/ar_mongodb_util.py,sha256=2ECkTnGAZ92qxioL-fmN6R4yZOSr3bXdXLWTzT1C3vk,4038
|
371
|
-
arpakitlib/ar_need_type_util.py,sha256=
|
371
|
+
arpakitlib/ar_need_type_util.py,sha256=XmY1kswz8j9oo5f9CxRu0_zgfvxWrXPYKOj6MM04sGk,2604
|
372
372
|
arpakitlib/ar_openai_api_client_util.py,sha256=nMF8-ybcSx29Q7HK3X6vhliQIy7UnuNcpXiYOWgyMn0,3316
|
373
373
|
arpakitlib/ar_parse_command.py,sha256=1WTdQoWVshoDZ1jDaKeTzajfqaYHP3FNO0-REyo1aMY,3003
|
374
374
|
arpakitlib/ar_postgresql_util.py,sha256=1AuLjEaa1Lg4pzn-ukCVnDi35Eg1k91APRTqZhIJAdo,945
|
@@ -384,8 +384,8 @@ arpakitlib/ar_ssh_runner_util.py,sha256=yvAwza480MkHKvLkDEsR7JNh2bYNs6P9rCVo4NA8
|
|
384
384
|
arpakitlib/ar_str_util.py,sha256=CAv0wH8nP5Ja59S-hEdmNhNrM_Fwy935d0zntLpJkx8,4309
|
385
385
|
arpakitlib/ar_type_util.py,sha256=Cs_tef-Fc5xeyAF54KgISCsP11NHyzIsglm4S3Xx7iM,4049
|
386
386
|
arpakitlib/ar_yookassa_api_client_util.py,sha256=VozuZeCJjmLd1zj2BdC9WfiAQ3XYOrIMsdpNK-AUlm0,5347
|
387
|
-
arpakitlib-1.8.
|
388
|
-
arpakitlib-1.8.
|
389
|
-
arpakitlib-1.8.
|
390
|
-
arpakitlib-1.8.
|
391
|
-
arpakitlib-1.8.
|
387
|
+
arpakitlib-1.8.93.dist-info/LICENSE,sha256=GPEDQMam2r7FSTYqM1mm7aKnxLaWcBotH7UvQtea-ec,11355
|
388
|
+
arpakitlib-1.8.93.dist-info/METADATA,sha256=gZxjwUT8imlAi48aIsli6g2_DxRnB5fPMfjyGz0jJos,3517
|
389
|
+
arpakitlib-1.8.93.dist-info/WHEEL,sha256=fGIA9gx4Qxk2KDKeNJCbOEwSrmLtjWCwzBz351GyrPQ,88
|
390
|
+
arpakitlib-1.8.93.dist-info/entry_points.txt,sha256=36xqR3PJFT2kuwjkM_EqoIy0qFUDPKSm_mJaI7emewE,87
|
391
|
+
arpakitlib-1.8.93.dist-info/RECORD,,
|
File without changes
|
File without changes
|
File without changes
|