boto3-assist 0.9.5__py3-none-any.whl → 0.10.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/dynamodb/dynamodb.py +5 -5
- boto3_assist/dynamodb/dynamodb_helpers.py +4 -5
- boto3_assist/utilities/datetime_utility.py +3 -3
- boto3_assist/version.py +1 -1
- {boto3_assist-0.9.5.dist-info → boto3_assist-0.10.0.dist-info}/METADATA +17 -1
- {boto3_assist-0.9.5.dist-info → boto3_assist-0.10.0.dist-info}/RECORD +9 -9
- {boto3_assist-0.9.5.dist-info → boto3_assist-0.10.0.dist-info}/WHEEL +0 -0
- {boto3_assist-0.9.5.dist-info → boto3_assist-0.10.0.dist-info}/licenses/LICENSE-EXPLAINED.txt +0 -0
- {boto3_assist-0.9.5.dist-info → boto3_assist-0.10.0.dist-info}/licenses/LICENSE.txt +0 -0
|
@@ -7,7 +7,7 @@ MIT License. See Project Root for the license information.
|
|
|
7
7
|
import os
|
|
8
8
|
from typing import List, Optional, overload, Dict, Any
|
|
9
9
|
|
|
10
|
-
from aws_lambda_powertools import
|
|
10
|
+
from aws_lambda_powertools import Logger
|
|
11
11
|
from boto3.dynamodb.conditions import (
|
|
12
12
|
Key,
|
|
13
13
|
# And,
|
|
@@ -22,7 +22,7 @@ from boto3_assist.utilities.string_utility import StringUtility
|
|
|
22
22
|
|
|
23
23
|
|
|
24
24
|
logger = Logger()
|
|
25
|
-
|
|
25
|
+
|
|
26
26
|
|
|
27
27
|
|
|
28
28
|
class DynamoDB(DynamoDBConnection):
|
|
@@ -55,7 +55,7 @@ class DynamoDB(DynamoDBConnection):
|
|
|
55
55
|
)
|
|
56
56
|
logger.setLevel(os.getenv("LOG_LEVEL", "INFO"))
|
|
57
57
|
|
|
58
|
-
|
|
58
|
+
|
|
59
59
|
def save(
|
|
60
60
|
self,
|
|
61
61
|
item: dict | DynamoDBModelBase,
|
|
@@ -169,7 +169,7 @@ class DynamoDB(DynamoDBConnection):
|
|
|
169
169
|
call_type: str = "resource",
|
|
170
170
|
) -> Dict[str, Any]: ...
|
|
171
171
|
|
|
172
|
-
|
|
172
|
+
|
|
173
173
|
def get(
|
|
174
174
|
self,
|
|
175
175
|
key: Optional[dict] = None,
|
|
@@ -344,7 +344,7 @@ class DynamoDB(DynamoDBConnection):
|
|
|
344
344
|
) -> dict:
|
|
345
345
|
pass
|
|
346
346
|
|
|
347
|
-
|
|
347
|
+
|
|
348
348
|
def delete(
|
|
349
349
|
self,
|
|
350
350
|
*,
|
|
@@ -7,11 +7,11 @@ MIT License. See Project Root for the license information.
|
|
|
7
7
|
from typing import List, Any, Dict
|
|
8
8
|
|
|
9
9
|
from boto3.dynamodb.conditions import ConditionBase, Key, And, Equals
|
|
10
|
-
from aws_lambda_powertools import
|
|
10
|
+
from aws_lambda_powertools import Logger
|
|
11
11
|
from boto3_assist.dynamodb.dynamodb_index import DynamoDBIndex
|
|
12
12
|
|
|
13
13
|
logger = Logger()
|
|
14
|
-
|
|
14
|
+
|
|
15
15
|
|
|
16
16
|
|
|
17
17
|
class DynamoDBHelpers:
|
|
@@ -118,7 +118,7 @@ class DynamoDBHelpers:
|
|
|
118
118
|
logger.error({"exception": str(e)})
|
|
119
119
|
return "unknown"
|
|
120
120
|
|
|
121
|
-
|
|
121
|
+
|
|
122
122
|
def wrap_response(self, items, dynamodb_response: dict, diagnostics) -> dict:
|
|
123
123
|
"""A wrapper for response data"""
|
|
124
124
|
last_key = dynamodb_response.get("LastEvaluatedKey", None)
|
|
@@ -135,8 +135,7 @@ class DynamoDBHelpers:
|
|
|
135
135
|
}
|
|
136
136
|
|
|
137
137
|
return response
|
|
138
|
-
|
|
139
|
-
@tracer.capture_method(capture_response=False)
|
|
138
|
+
|
|
140
139
|
def wrap_collection_response(self, collection: List[dict]) -> dict[str, List]:
|
|
141
140
|
"""
|
|
142
141
|
Wraps Up Some usefull information when dealing with
|
|
@@ -8,11 +8,11 @@ import uuid
|
|
|
8
8
|
from datetime import UTC, datetime, timedelta, timezone
|
|
9
9
|
from typing import Any
|
|
10
10
|
import pytz # type: ignore
|
|
11
|
-
from aws_lambda_powertools import
|
|
11
|
+
from aws_lambda_powertools import Logger
|
|
12
12
|
from dateutil.relativedelta import relativedelta
|
|
13
13
|
|
|
14
14
|
|
|
15
|
-
|
|
15
|
+
|
|
16
16
|
logger = Logger()
|
|
17
17
|
|
|
18
18
|
_last_timestamp = None
|
|
@@ -47,7 +47,7 @@ class DatetimeUtility:
|
|
|
47
47
|
return datetime.now(timezone.utc)
|
|
48
48
|
|
|
49
49
|
@staticmethod
|
|
50
|
-
|
|
50
|
+
|
|
51
51
|
def string_to_date(string_date: str | datetime) -> datetime | None:
|
|
52
52
|
"""
|
|
53
53
|
Description: takes a string value and returns it as a datetime.
|
boto3_assist/version.py
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
__version__ = '0.
|
|
1
|
+
__version__ = '0.10.0'
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: boto3_assist
|
|
3
|
-
Version: 0.
|
|
3
|
+
Version: 0.10.0
|
|
4
4
|
Summary: Additional boto3 wrappers to make your life a little easier
|
|
5
5
|
Author-email: Eric Wilson <boto3-assist@geekcafe.com>
|
|
6
6
|
License-File: LICENSE-EXPLAINED.txt
|
|
@@ -51,3 +51,19 @@ pip install boto3-assist
|
|
|
51
51
|
|
|
52
52
|
```
|
|
53
53
|
|
|
54
|
+
## Running Unit Tests
|
|
55
|
+
Several of our tests use a mocking library to simulate connections to S3, DynamoDB, etc. In order to use those tests, you will need to have a `.env.unittest` file at the root of this project (which our tests will attempt to locate and load).
|
|
56
|
+
|
|
57
|
+
For your convenince the `.evn.unittest` file has been added to this project. The values should not point to live AWS profiles, instead it should use the values added.
|
|
58
|
+
|
|
59
|
+
Since we also point to a profile, you should create the profile in the `~/.aws/config` file. The entry should look like the following:
|
|
60
|
+
|
|
61
|
+
```toml
|
|
62
|
+
[profile moto-mock-tests]
|
|
63
|
+
region = us-east-1
|
|
64
|
+
output = json
|
|
65
|
+
aws_access_key_id = test
|
|
66
|
+
aws_secret_access_key = test
|
|
67
|
+
|
|
68
|
+
```
|
|
69
|
+
|
|
@@ -3,7 +3,7 @@ boto3_assist/boto3session.py,sha256=JnZIRbut5R_C_r50bY2xiF6CjR93jQSOeVmhdK97mDg,
|
|
|
3
3
|
boto3_assist/connection.py,sha256=-z_OZtZmSVjSSECpoqx1FnqW7B9A_LovfN_cJ_nhHgg,4361
|
|
4
4
|
boto3_assist/connection_tracker.py,sha256=UgfR9RlvXf3A4ssMr3gDMpw89ka8mSRvJn4M34SzhbU,4378
|
|
5
5
|
boto3_assist/http_status_codes.py,sha256=G0zRSWenwavYKETvDF9tNVUXQz3Ae2gXdBETYbjvJe8,3284
|
|
6
|
-
boto3_assist/version.py,sha256=
|
|
6
|
+
boto3_assist/version.py,sha256=RYs3cR49NZ5Zwt0avo2mYyRcdWjLbrKBCHRHpqCJx24,23
|
|
7
7
|
boto3_assist/aws_lambda/event_info.py,sha256=OkZ4WzuGaHEu_T8sB188KBgShAJhZpWASALKRGBOhMg,14648
|
|
8
8
|
boto3_assist/aws_lambda/mock_context.py,sha256=LPjHP-3YSoY6iPl1kPqJDwSVf1zLNTcukUunDtYcbK0,116
|
|
9
9
|
boto3_assist/cloudwatch/cloudwatch_connection.py,sha256=mnGWaLSQpHh5EeY7Ek_2o9JKHJxOELIYtQVMX1IaHn4,2480
|
|
@@ -16,9 +16,9 @@ boto3_assist/cognito/cognito_connection.py,sha256=deuXR3cNHz0mCYff2k0LfAvK--9Okq
|
|
|
16
16
|
boto3_assist/cognito/cognito_utility.py,sha256=Vd9Fy_URJsG5IC87a19h0J7RE_bcrrTz1_80LzAZfvY,18237
|
|
17
17
|
boto3_assist/cognito/jwks_cache.py,sha256=1Y9r-YfQ8qrgZN5xYPvjUEEV0vthbdcPdAIaPbZP7kU,373
|
|
18
18
|
boto3_assist/cognito/user.py,sha256=qc44qLx3gwq6q2zMxcPQze1EjeZwy5Kuav93vbe-4WU,820
|
|
19
|
-
boto3_assist/dynamodb/dynamodb.py,sha256=
|
|
19
|
+
boto3_assist/dynamodb/dynamodb.py,sha256=ARbxuAQitqDBdEb_vHiRaC7x9nDMr71SgRA7tD6NVKk,15681
|
|
20
20
|
boto3_assist/dynamodb/dynamodb_connection.py,sha256=x6Ylb_uVAY5TS0AIBUNOSyywKIqros3xX8diLTjZUsc,3275
|
|
21
|
-
boto3_assist/dynamodb/dynamodb_helpers.py,sha256=
|
|
21
|
+
boto3_assist/dynamodb/dynamodb_helpers.py,sha256=RoRRqKjdwfC-2-gvlkLvCoNWhIoMrHm-68dkyhXI_Xk,12080
|
|
22
22
|
boto3_assist/dynamodb/dynamodb_importer.py,sha256=nCKsyRQeMqDSf0Q5mQ_X_oVIg4PRnu0hcUzZnBli610,3471
|
|
23
23
|
boto3_assist/dynamodb/dynamodb_index.py,sha256=D0Lq121qk1cXeMetPeqnzvv6CXd0XfEygfdUXaljLG8,8551
|
|
24
24
|
boto3_assist/dynamodb/dynamodb_iservice.py,sha256=O9Aj0PFEvcuk2vhARifWTFnUwcQW5EXzwZS478Hm-N0,796
|
|
@@ -45,7 +45,7 @@ boto3_assist/securityhub/securityhub.py,sha256=nGmHd_R3awDeB_QRzPfNAtQauLdVA1hlR
|
|
|
45
45
|
boto3_assist/securityhub/securityhub_connection.py,sha256=hWfcj9gjS2lNXUObyw4cShtveoqJPIp8kKFuz-fz1J4,1449
|
|
46
46
|
boto3_assist/ssm/connection.py,sha256=gYpKn5HsUR3hcRUqJzF5QcTITCk0DReq9KhoE_8-Htg,1370
|
|
47
47
|
boto3_assist/ssm/parameter_store/parameter_store.py,sha256=2ISi-SmR29mESHFH-onJkxPX1aThIgBRojA3ZoNcP9s,3949
|
|
48
|
-
boto3_assist/utilities/datetime_utility.py,sha256=
|
|
48
|
+
boto3_assist/utilities/datetime_utility.py,sha256=kxUV-pYraTx18gaRb2LxXB7sRTBxffgksdOszcM3fg8,11150
|
|
49
49
|
boto3_assist/utilities/dictionary_utility.py,sha256=IrN5Q3gJ_KWQ_3KCjyXEJyV8oLk2n3tQOO52dVbY6sk,1002
|
|
50
50
|
boto3_assist/utilities/file_operations.py,sha256=IYhJkh8wUPMvGnyDRRa9yOCDdHN9wR3N6m_xpJS51TM,3949
|
|
51
51
|
boto3_assist/utilities/http_utility.py,sha256=_K39Fq0V4QcgklAWctUktuMjqXDTwgMld77IOUfR2zc,1282
|
|
@@ -53,8 +53,8 @@ boto3_assist/utilities/logging_utility.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5N
|
|
|
53
53
|
boto3_assist/utilities/numbers_utility.py,sha256=wzv9d0uXT_2_ZHHio7LBzibwxPqhGpvbq9HinrVn_4A,10160
|
|
54
54
|
boto3_assist/utilities/serialization_utility.py,sha256=dP93TrMQzCbJXXMI7O1HNQOfKZuHyBLwdtuDQyvnlA8,21519
|
|
55
55
|
boto3_assist/utilities/string_utility.py,sha256=5BpDaqGZI8cSM-3YFQLU1fKcWcqG9r1_GPgDstCWFIs,10318
|
|
56
|
-
boto3_assist-0.
|
|
57
|
-
boto3_assist-0.
|
|
58
|
-
boto3_assist-0.
|
|
59
|
-
boto3_assist-0.
|
|
60
|
-
boto3_assist-0.
|
|
56
|
+
boto3_assist-0.10.0.dist-info/METADATA,sha256=tlzx9r-jzs-guxeABF-e0Gqd62wRkEfFbwmFKF03v3o,2430
|
|
57
|
+
boto3_assist-0.10.0.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
|
|
58
|
+
boto3_assist-0.10.0.dist-info/licenses/LICENSE-EXPLAINED.txt,sha256=WFREvTpfTjPjDHpOLADxJpCKpIla3Ht87RUUGii4ODU,606
|
|
59
|
+
boto3_assist-0.10.0.dist-info/licenses/LICENSE.txt,sha256=PXDhFWS5L5aOTkVhNvoitHKbAkgxqMI2uUPQyrnXGiI,1105
|
|
60
|
+
boto3_assist-0.10.0.dist-info/RECORD,,
|
|
File without changes
|
{boto3_assist-0.9.5.dist-info → boto3_assist-0.10.0.dist-info}/licenses/LICENSE-EXPLAINED.txt
RENAMED
|
File without changes
|
|
File without changes
|