boto3-assist 0.17.0__py3-none-any.whl → 0.18.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.
- boto3_assist/utilities/serialization_utility.py +3 -7
- boto3_assist/utilities/string_utility.py +16 -1
- boto3_assist/version.py +1 -1
- {boto3_assist-0.17.0.dist-info → boto3_assist-0.18.0.dist-info}/METADATA +1 -1
- {boto3_assist-0.17.0.dist-info → boto3_assist-0.18.0.dist-info}/RECORD +8 -8
- {boto3_assist-0.17.0.dist-info → boto3_assist-0.18.0.dist-info}/WHEEL +0 -0
- {boto3_assist-0.17.0.dist-info → boto3_assist-0.18.0.dist-info}/licenses/LICENSE-EXPLAINED.txt +0 -0
- {boto3_assist-0.17.0.dist-info → boto3_assist-0.18.0.dist-info}/licenses/LICENSE.txt +0 -0
|
@@ -12,8 +12,8 @@ import uuid
|
|
|
12
12
|
from datetime import datetime
|
|
13
13
|
from decimal import Decimal
|
|
14
14
|
from typing import Any, Dict, List, TypeVar
|
|
15
|
-
import re
|
|
16
15
|
from aws_lambda_powertools import Logger
|
|
16
|
+
from boto3_assist.utilities.string_utility import StringUtility
|
|
17
17
|
|
|
18
18
|
T = TypeVar("T")
|
|
19
19
|
|
|
@@ -119,16 +119,12 @@ class JsonConversions:
|
|
|
119
119
|
@staticmethod
|
|
120
120
|
def _camel_to_snake(value: str) -> str:
|
|
121
121
|
"""Converts a camelCase to a snake_case"""
|
|
122
|
-
|
|
123
|
-
s1 = re.sub(r"(.)([A-Z][a-z]+)", r"\1_\2", value)
|
|
124
|
-
return re.sub(r"([a-z0-9])([A-Z])", r"\1_\2", s1).lower()
|
|
122
|
+
return StringUtility.camel_to_snake(value)
|
|
125
123
|
|
|
126
124
|
@staticmethod
|
|
127
125
|
def _snake_to_camel(value: str) -> str:
|
|
128
126
|
"""Converts a value from snake_case to camelCase"""
|
|
129
|
-
|
|
130
|
-
components = value.split("_")
|
|
131
|
-
return components[0] + "".join(x.title() for x in components[1:])
|
|
127
|
+
return StringUtility.snake_to_camel(value)
|
|
132
128
|
|
|
133
129
|
@staticmethod
|
|
134
130
|
def _convert_keys(data, convert_func, deep: bool = True):
|
|
@@ -12,6 +12,7 @@ from datetime import datetime
|
|
|
12
12
|
from decimal import Decimal
|
|
13
13
|
import uuid
|
|
14
14
|
import json
|
|
15
|
+
import re
|
|
15
16
|
from aws_lambda_powertools import Logger
|
|
16
17
|
from boto3_assist.utilities.datetime_utility import DatetimeUtility
|
|
17
18
|
|
|
@@ -200,7 +201,7 @@ class StringUtility:
|
|
|
200
201
|
namespace: uuid.UUID | str, unique_string: str, case_sensitive: bool = False
|
|
201
202
|
) -> str:
|
|
202
203
|
"""
|
|
203
|
-
Generates an
|
|
204
|
+
Generates an idempotent UUID, which is useful for creates
|
|
204
205
|
|
|
205
206
|
Args:
|
|
206
207
|
namespace (GUID | str): A namespace for your id, it must be a UUID or a string in a UUID format
|
|
@@ -320,3 +321,17 @@ class StringUtility:
|
|
|
320
321
|
return False
|
|
321
322
|
else:
|
|
322
323
|
raise ValueError(f"Invalid boolean value: {value}")
|
|
324
|
+
|
|
325
|
+
@staticmethod
|
|
326
|
+
def camel_to_snake(value: str) -> str:
|
|
327
|
+
"""Converts a camelCase to a snake_case"""
|
|
328
|
+
# Insert underscores before uppercase letters, then convert to lowercase.
|
|
329
|
+
s1 = re.sub(r"(.)([A-Z][a-z]+)", r"\1_\2", value)
|
|
330
|
+
return re.sub(r"([a-z0-9])([A-Z])", r"\1_\2", s1).lower()
|
|
331
|
+
|
|
332
|
+
@staticmethod
|
|
333
|
+
def snake_to_camel(value: str) -> str:
|
|
334
|
+
"""Converts a value from snake_case to camelCase"""
|
|
335
|
+
# Split the value by underscores and capitalize each component except the first.
|
|
336
|
+
components = value.split("_")
|
|
337
|
+
return components[0] + "".join(x.title() for x in components[1:])
|
boto3_assist/version.py
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
__version__ = '0.
|
|
1
|
+
__version__ = '0.18.0'
|
|
@@ -6,7 +6,7 @@ boto3_assist/connection_tracker.py,sha256=UgfR9RlvXf3A4ssMr3gDMpw89ka8mSRvJn4M34
|
|
|
6
6
|
boto3_assist/http_status_codes.py,sha256=G0zRSWenwavYKETvDF9tNVUXQz3Ae2gXdBETYbjvJe8,3284
|
|
7
7
|
boto3_assist/role_assumption_mixin.py,sha256=PMUU5yC2FUBjFD1UokVkRY3CPB5zTw85AhIB5BMtbc8,1031
|
|
8
8
|
boto3_assist/session_setup_mixin.py,sha256=X-JQKyyaWNA8Z8kKgf2V2I5vsiLAH8udLTX_xepnsdQ,3140
|
|
9
|
-
boto3_assist/version.py,sha256=
|
|
9
|
+
boto3_assist/version.py,sha256=xLQqGjpDoJw8wh7LhnSmkR_X41AAFaOxbyFZXuEbtfY,23
|
|
10
10
|
boto3_assist/aws_lambda/event_info.py,sha256=OkZ4WzuGaHEu_T8sB188KBgShAJhZpWASALKRGBOhMg,14648
|
|
11
11
|
boto3_assist/aws_lambda/mock_context.py,sha256=LPjHP-3YSoY6iPl1kPqJDwSVf1zLNTcukUunDtYcbK0,116
|
|
12
12
|
boto3_assist/cloudwatch/cloudwatch_connection.py,sha256=mnGWaLSQpHh5EeY7Ek_2o9JKHJxOELIYtQVMX1IaHn4,2480
|
|
@@ -54,10 +54,10 @@ boto3_assist/utilities/file_operations.py,sha256=IYhJkh8wUPMvGnyDRRa9yOCDdHN9wR3
|
|
|
54
54
|
boto3_assist/utilities/http_utility.py,sha256=_K39Fq0V4QcgklAWctUktuMjqXDTwgMld77IOUfR2zc,1282
|
|
55
55
|
boto3_assist/utilities/logging_utility.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
56
56
|
boto3_assist/utilities/numbers_utility.py,sha256=wzv9d0uXT_2_ZHHio7LBzibwxPqhGpvbq9HinrVn_4A,10160
|
|
57
|
-
boto3_assist/utilities/serialization_utility.py,sha256=
|
|
58
|
-
boto3_assist/utilities/string_utility.py,sha256=
|
|
59
|
-
boto3_assist-0.
|
|
60
|
-
boto3_assist-0.
|
|
61
|
-
boto3_assist-0.
|
|
62
|
-
boto3_assist-0.
|
|
63
|
-
boto3_assist-0.
|
|
57
|
+
boto3_assist/utilities/serialization_utility.py,sha256=tYsFWvO1QTyhPgrYfC9etnMXKFYtHC78OAtvMGHuV9w,21646
|
|
58
|
+
boto3_assist/utilities/string_utility.py,sha256=XxUIz19L2LFFTRDAAmdPa8Qhn40u9yO7g4nULFuvg0M,11033
|
|
59
|
+
boto3_assist-0.18.0.dist-info/METADATA,sha256=PwQUzbuw2bGPgZ8mw3GROwhjW3FnIy6FI4rESPYZRgc,2875
|
|
60
|
+
boto3_assist-0.18.0.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
|
|
61
|
+
boto3_assist-0.18.0.dist-info/licenses/LICENSE-EXPLAINED.txt,sha256=WFREvTpfTjPjDHpOLADxJpCKpIla3Ht87RUUGii4ODU,606
|
|
62
|
+
boto3_assist-0.18.0.dist-info/licenses/LICENSE.txt,sha256=PXDhFWS5L5aOTkVhNvoitHKbAkgxqMI2uUPQyrnXGiI,1105
|
|
63
|
+
boto3_assist-0.18.0.dist-info/RECORD,,
|
|
File without changes
|
{boto3_assist-0.17.0.dist-info → boto3_assist-0.18.0.dist-info}/licenses/LICENSE-EXPLAINED.txt
RENAMED
|
File without changes
|
|
File without changes
|