osbot-utils 1.62.0__py3-none-any.whl → 1.64.0__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.
- osbot_utils/base_classes/Type_Safe.py +5 -2
- osbot_utils/helpers/Random_Guid.py +5 -5
- osbot_utils/helpers/Random_Guid_Short.py +15 -0
- osbot_utils/utils/Misc.py +1 -0
- osbot_utils/version +1 -1
- {osbot_utils-1.62.0.dist-info → osbot_utils-1.64.0.dist-info}/METADATA +2 -2
- {osbot_utils-1.62.0.dist-info → osbot_utils-1.64.0.dist-info}/RECORD +9 -8
- {osbot_utils-1.62.0.dist-info → osbot_utils-1.64.0.dist-info}/LICENSE +0 -0
- {osbot_utils-1.62.0.dist-info → osbot_utils-1.64.0.dist-info}/WHEEL +0 -0
@@ -11,6 +11,7 @@ from enum import Enum, EnumMeta
|
|
11
11
|
from typing import List
|
12
12
|
from osbot_utils.base_classes.Type_Safe__List import Type_Safe__List
|
13
13
|
from osbot_utils.helpers.Random_Guid import Random_Guid
|
14
|
+
from osbot_utils.helpers.Random_Guid_Short import Random_Guid_Short
|
14
15
|
from osbot_utils.helpers.Timestamp_Now import Timestamp_Now
|
15
16
|
from osbot_utils.utils.Dev import pprint
|
16
17
|
from osbot_utils.utils.Json import json_parse
|
@@ -269,9 +270,11 @@ class Type_Safe:
|
|
269
270
|
# todo: refactor these special cases into a separate method to class
|
270
271
|
elif obj_is_attribute_annotation_of_type(self, key, Decimal): # handle Decimals
|
271
272
|
value = Decimal(value)
|
272
|
-
elif obj_is_attribute_annotation_of_type(self, key, Random_Guid): # handle Random_Guid
|
273
|
+
elif obj_is_attribute_annotation_of_type(self, key, Random_Guid): # handle Random_Guid
|
273
274
|
value = Random_Guid(value)
|
274
|
-
elif obj_is_attribute_annotation_of_type(self, key,
|
275
|
+
elif obj_is_attribute_annotation_of_type(self, key, Random_Guid_Short): # handle Random_Guid_Short
|
276
|
+
value = Random_Guid_Short(value)
|
277
|
+
elif obj_is_attribute_annotation_of_type(self, key, Timestamp_Now): # handle Timestamp_Now
|
275
278
|
value = Timestamp_Now(value)
|
276
279
|
setattr(self, key, value) # Direct assignment for primitive types and other structures
|
277
280
|
|
@@ -1,14 +1,14 @@
|
|
1
1
|
# todo add to osbot utils
|
2
|
-
from osbot_utils.utils.Misc import random_guid
|
2
|
+
from osbot_utils.utils.Misc import random_guid, is_guid
|
3
|
+
|
3
4
|
|
4
5
|
class Random_Guid(str):
|
5
6
|
def __new__(cls, value=None):
|
6
7
|
if value is None:
|
7
8
|
value = random_guid()
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
self.value = value if value is not None else random_guid()
|
9
|
+
if is_guid(value):
|
10
|
+
return str.__new__(cls, value)
|
11
|
+
raise ValueError(f'in Random_Guid: value provided was not a Guid: {value}')
|
12
12
|
|
13
13
|
def __str__(self):
|
14
14
|
return self
|
@@ -0,0 +1,15 @@
|
|
1
|
+
# todo add to osbot utils
|
2
|
+
from osbot_utils.utils.Misc import random_guid_short
|
3
|
+
|
4
|
+
|
5
|
+
class Random_Guid_Short(str):
|
6
|
+
def __new__(cls, value=None):
|
7
|
+
if value is None:
|
8
|
+
value = random_guid_short()
|
9
|
+
return str.__new__(cls, value)
|
10
|
+
|
11
|
+
def __init__(self, value=None):
|
12
|
+
self.value = value if value is not None else random_guid_short()
|
13
|
+
|
14
|
+
def __str__(self):
|
15
|
+
return self
|
osbot_utils/utils/Misc.py
CHANGED
osbot_utils/version
CHANGED
@@ -1 +1 @@
|
|
1
|
-
v1.
|
1
|
+
v1.64.0
|
@@ -1,6 +1,6 @@
|
|
1
1
|
Metadata-Version: 2.1
|
2
2
|
Name: osbot_utils
|
3
|
-
Version: 1.
|
3
|
+
Version: 1.64.0
|
4
4
|
Summary: OWASP Security Bot - Utils
|
5
5
|
Home-page: https://github.com/owasp-sbot/OSBot-Utils
|
6
6
|
License: MIT
|
@@ -23,7 +23,7 @@ Description-Content-Type: text/markdown
|
|
23
23
|
|
24
24
|
Powerful Python util methods and classes that simplify common apis and tasks.
|
25
25
|
|
26
|
-

|
27
27
|
[](https://codecov.io/gh/owasp-sbot/OSBot-Utils)
|
28
28
|
|
29
29
|
|
@@ -2,7 +2,7 @@ osbot_utils/__init__.py,sha256=DdJDmQc9zbQUlPVyTJOww6Ixrn9n4bD3ami5ItQfzJI,16
|
|
2
2
|
osbot_utils/base_classes/Cache_Pickle.py,sha256=kPCwrgUbf_dEdxUz7vW1GuvIPwlNXxuRhb-H3AbSpII,5884
|
3
3
|
osbot_utils/base_classes/Kwargs_To_Disk.py,sha256=HHoy05NC_w35WcT-OnSKoSIV_cLqaU9rdjH0_KNTM0E,1096
|
4
4
|
osbot_utils/base_classes/Kwargs_To_Self.py,sha256=weFNsBfBNV9W_qBkN-IdBD4yYcJV_zgTxBRO-ZlcPS4,141
|
5
|
-
osbot_utils/base_classes/Type_Safe.py,sha256=
|
5
|
+
osbot_utils/base_classes/Type_Safe.py,sha256=eWdLnt-vRqr6bX1TR3tINSqm2KeVXQSzQs6pxq0Ep5I,18476
|
6
6
|
osbot_utils/base_classes/Type_Safe__List.py,sha256=-80C9OhsK6iDR2dAG8yNLAZV0qg5x3faqvSUigFCMJw,517
|
7
7
|
osbot_utils/base_classes/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
8
8
|
osbot_utils/context_managers/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
@@ -65,7 +65,8 @@ osbot_utils/helpers/Local_Cache.py,sha256=0JZZX3fFImcwtbBvxAQl-EbBegSNJRhRMYF6ov
|
|
65
65
|
osbot_utils/helpers/Local_Caches.py,sha256=aQmi1HSM0TH6WQPedG2fbz4KCCJ3DQTU9d18rB1jR0M,1885
|
66
66
|
osbot_utils/helpers/Print_Table.py,sha256=LEXbyqGg_6WSraI4cob4bNNSu18ddqvALp1zGK7bPhs,19126
|
67
67
|
osbot_utils/helpers/Python_Audit.py,sha256=shpZlluJwqJBAlad6xN01FkgC1TsQ48RLvR5ZjmrKa4,1539
|
68
|
-
osbot_utils/helpers/Random_Guid.py,sha256=
|
68
|
+
osbot_utils/helpers/Random_Guid.py,sha256=JvAFxbF8XUE0l1Jg6CmdaKxuYFIfYJGd49cOZJdmZ4Y,400
|
69
|
+
osbot_utils/helpers/Random_Guid_Short.py,sha256=YP_k5OLuYvXWGU2OEnQHk_OGViBQofTWKm3pUdQaJao,404
|
69
70
|
osbot_utils/helpers/Random_Seed.py,sha256=14btja8LDN9cMGWaz4fCNcMRU_eyx49gas-_PQvHgy4,634
|
70
71
|
osbot_utils/helpers/Timestamp_Now.py,sha256=Vmdsm-pgvxkkQ_Qj_9Watr8rXXSvc-aBxWMPFGQx8Z0,371
|
71
72
|
osbot_utils/helpers/Type_Registry.py,sha256=Ajk3SyMSKDi2g9SJYUtTgg7PZkAgydaHcpbGuEN3S94,311
|
@@ -291,7 +292,7 @@ osbot_utils/utils/Int.py,sha256=PmlUdU4lSwf4gJdmTVdqclulkEp7KPCVUDO6AcISMF4,116
|
|
291
292
|
osbot_utils/utils/Json.py,sha256=yIT2hUI23gYd24Uf3LCjqPNV67zS46rYZftcCM3jw-Q,6492
|
292
293
|
osbot_utils/utils/Json_Cache.py,sha256=mLPkkDZN-3ZVJiDvV1KBJXILtKkTZ4OepzOsDoBPhWg,2006
|
293
294
|
osbot_utils/utils/Lists.py,sha256=tPz5x5s3sRO97WZ_nsxREBPC5cwaHrhgaYBhsrffTT8,5599
|
294
|
-
osbot_utils/utils/Misc.py,sha256=
|
295
|
+
osbot_utils/utils/Misc.py,sha256=4MkG2BE1VzZfV4KPzYZ4jVAoUwoA3pTTVPi609ldLGA,16961
|
295
296
|
osbot_utils/utils/Objects.py,sha256=_BWr7KA8Xzzxu6fyxHSqDqDM1Pkyr5IZUFo_hMf7oTo,17612
|
296
297
|
osbot_utils/utils/Png.py,sha256=V1juGp6wkpPigMJ8HcxrPDIP4bSwu51oNkLI8YqP76Y,1172
|
297
298
|
osbot_utils/utils/Process.py,sha256=lr3CTiEkN3EiBx3ZmzYmTKlQoPdkgZBRjPulMxG-zdo,2357
|
@@ -304,8 +305,8 @@ osbot_utils/utils/Toml.py,sha256=SD6IA4-mrtoBXcI0dIGKV9POMQNd6WYKvmDQq7GQ6ZQ,143
|
|
304
305
|
osbot_utils/utils/Version.py,sha256=Ww6ChwTxqp1QAcxOnztkTicShlcx6fbNsWX5xausHrg,422
|
305
306
|
osbot_utils/utils/Zip.py,sha256=G6Hk_hDcm9yvWzhTKzhT0R_6f0NBIAchHqMxGb3kfh4,14037
|
306
307
|
osbot_utils/utils/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
307
|
-
osbot_utils/version,sha256=
|
308
|
-
osbot_utils-1.
|
309
|
-
osbot_utils-1.
|
310
|
-
osbot_utils-1.
|
311
|
-
osbot_utils-1.
|
308
|
+
osbot_utils/version,sha256=Sb9LIFVVDPJapRKOM9P5OAlLpvoTKm6KXqS8_LOGd3k,8
|
309
|
+
osbot_utils-1.64.0.dist-info/LICENSE,sha256=xx0jnfkXJvxRnG63LTGOxlggYnIysveWIZ6H3PNdCrQ,11357
|
310
|
+
osbot_utils-1.64.0.dist-info/METADATA,sha256=kAPJmBcqPABY3iT_RLZwS5OUbV7PqHKiAvkkCJOZy8c,1317
|
311
|
+
osbot_utils-1.64.0.dist-info/WHEEL,sha256=Nq82e9rUAnEjt98J6MlVmMCZb-t9cYE2Ir1kpBmnWfs,88
|
312
|
+
osbot_utils-1.64.0.dist-info/RECORD,,
|
File without changes
|
File without changes
|