boto3-assist 0.1.3__tar.gz → 0.1.5__tar.gz
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-0.1.3 → boto3_assist-0.1.5}/PKG-INFO +1 -1
- {boto3_assist-0.1.3 → boto3_assist-0.1.5}/pyproject.toml +1 -1
- {boto3_assist-0.1.3 → boto3_assist-0.1.5}/src/boto3_assist/dynamodb/dynamodb.py +2 -0
- {boto3_assist-0.1.3 → boto3_assist-0.1.5}/src/boto3_assist/dynamodb/dynamodb_importer.py +19 -2
- boto3_assist-0.1.5/src/boto3_assist/version.py +1 -0
- boto3_assist-0.1.3/src/boto3_assist/version.py +0 -1
- {boto3_assist-0.1.3 → boto3_assist-0.1.5}/.env.development +0 -0
- {boto3_assist-0.1.3 → boto3_assist-0.1.5}/.env.docker +0 -0
- {boto3_assist-0.1.3 → boto3_assist-0.1.5}/.env.docker.001 +0 -0
- {boto3_assist-0.1.3 → boto3_assist-0.1.5}/.env.docker.nosql.workbench +0 -0
- {boto3_assist-0.1.3 → boto3_assist-0.1.5}/.gitignore +0 -0
- {boto3_assist-0.1.3 → boto3_assist-0.1.5}/.vscode/launch.json +0 -0
- {boto3_assist-0.1.3 → boto3_assist-0.1.5}/.vscode/settings.json +0 -0
- {boto3_assist-0.1.3 → boto3_assist-0.1.5}/.vscode/tasks.json +0 -0
- {boto3_assist-0.1.3 → boto3_assist-0.1.5}/LICENSE-EXPLAINED.txt +0 -0
- {boto3_assist-0.1.3 → boto3_assist-0.1.5}/LICENSE.txt +0 -0
- {boto3_assist-0.1.3 → boto3_assist-0.1.5}/README.md +0 -0
- {boto3_assist-0.1.3 → boto3_assist-0.1.5}/aws_regions_with_status.csv +0 -0
- {boto3_assist-0.1.3 → boto3_assist-0.1.5}/aws_regions_with_status.json +0 -0
- {boto3_assist-0.1.3 → boto3_assist-0.1.5}/devops/build.py +0 -0
- {boto3_assist-0.1.3 → boto3_assist-0.1.5}/devops/readme.md +0 -0
- {boto3_assist-0.1.3 → boto3_assist-0.1.5}/examples/__init__.py +0 -0
- {boto3_assist-0.1.3 → boto3_assist-0.1.5}/examples/dynamodb/models/order_item_model.py +0 -0
- {boto3_assist-0.1.3 → boto3_assist-0.1.5}/examples/dynamodb/models/order_model.py +0 -0
- {boto3_assist-0.1.3 → boto3_assist-0.1.5}/examples/dynamodb/models/product_model.py +0 -0
- {boto3_assist-0.1.3 → boto3_assist-0.1.5}/examples/dynamodb/models/user_model.py +0 -0
- {boto3_assist-0.1.3 → boto3_assist-0.1.5}/examples/dynamodb/models/user_post_model.py +0 -0
- {boto3_assist-0.1.3 → boto3_assist-0.1.5}/examples/dynamodb/order_example/main.py +0 -0
- {boto3_assist-0.1.3 → boto3_assist-0.1.5}/examples/dynamodb/order_example/products.json +0 -0
- {boto3_assist-0.1.3 → boto3_assist-0.1.5}/examples/dynamodb/services/order_item_service.py +0 -0
- {boto3_assist-0.1.3 → boto3_assist-0.1.5}/examples/dynamodb/services/order_service.py +0 -0
- {boto3_assist-0.1.3 → boto3_assist-0.1.5}/examples/dynamodb/services/product_service.py +0 -0
- {boto3_assist-0.1.3 → boto3_assist-0.1.5}/examples/dynamodb/services/table_service.py +0 -0
- {boto3_assist-0.1.3 → boto3_assist-0.1.5}/examples/dynamodb/services/user_post_service.py +0 -0
- {boto3_assist-0.1.3 → boto3_assist-0.1.5}/examples/dynamodb/services/user_service.py +0 -0
- {boto3_assist-0.1.3 → boto3_assist-0.1.5}/examples/dynamodb/services/user_service_client_example.py +0 -0
- {boto3_assist-0.1.3 → boto3_assist-0.1.5}/examples/dynamodb/services/user_service_resource_example.py +0 -0
- {boto3_assist-0.1.3 → boto3_assist-0.1.5}/examples/dynamodb/user_post_example/main.py +0 -0
- {boto3_assist-0.1.3 → boto3_assist-0.1.5}/examples/ec2/regions_report.py +0 -0
- {boto3_assist-0.1.3 → boto3_assist-0.1.5}/module-headers.txt +0 -0
- {boto3_assist-0.1.3 → boto3_assist-0.1.5}/mypy.ini +0 -0
- {boto3_assist-0.1.3 → boto3_assist-0.1.5}/requirements-dev.txt +0 -0
- {boto3_assist-0.1.3 → boto3_assist-0.1.5}/requirements.txt +0 -0
- {boto3_assist-0.1.3 → boto3_assist-0.1.5}/run-checks.sh +0 -0
- {boto3_assist-0.1.3 → boto3_assist-0.1.5}/src/boto3_assist/__init__.py +0 -0
- {boto3_assist-0.1.3 → boto3_assist-0.1.5}/src/boto3_assist/boto3session.py +0 -0
- {boto3_assist-0.1.3 → boto3_assist-0.1.5}/src/boto3_assist/connection_tracker.py +0 -0
- {boto3_assist-0.1.3 → boto3_assist-0.1.5}/src/boto3_assist/dynamodb/dynamodb_connection.py +0 -0
- {boto3_assist-0.1.3 → boto3_assist-0.1.5}/src/boto3_assist/dynamodb/dynamodb_connection_tracker.py +0 -0
- {boto3_assist-0.1.3 → boto3_assist-0.1.5}/src/boto3_assist/dynamodb/dynamodb_helpers.py +0 -0
- {boto3_assist-0.1.3 → boto3_assist-0.1.5}/src/boto3_assist/dynamodb/dynamodb_index.py +0 -0
- {boto3_assist-0.1.3 → boto3_assist-0.1.5}/src/boto3_assist/dynamodb/dynamodb_iservice.py +0 -0
- {boto3_assist-0.1.3 → boto3_assist-0.1.5}/src/boto3_assist/dynamodb/dynamodb_key.py +0 -0
- {boto3_assist-0.1.3 → boto3_assist-0.1.5}/src/boto3_assist/dynamodb/dynamodb_model_base.py +0 -0
- {boto3_assist-0.1.3 → boto3_assist-0.1.5}/src/boto3_assist/dynamodb/dynamodb_model_base_interfaces.py +0 -0
- {boto3_assist-0.1.3 → boto3_assist-0.1.5}/src/boto3_assist/dynamodb/dynamodb_reindexer.py +0 -0
- {boto3_assist-0.1.3 → boto3_assist-0.1.5}/src/boto3_assist/dynamodb/readme.md +0 -0
- {boto3_assist-0.1.3 → boto3_assist-0.1.5}/src/boto3_assist/dynamodb/troubleshooting.md +0 -0
- {boto3_assist-0.1.3 → boto3_assist-0.1.5}/src/boto3_assist/ec2/ec2_connection.py +0 -0
- {boto3_assist-0.1.3 → boto3_assist-0.1.5}/src/boto3_assist/environment_services/__init__.py +0 -0
- {boto3_assist-0.1.3 → boto3_assist-0.1.5}/src/boto3_assist/environment_services/environment_loader.py +0 -0
- {boto3_assist-0.1.3 → boto3_assist-0.1.5}/src/boto3_assist/environment_services/environment_variables.py +0 -0
- {boto3_assist-0.1.3 → boto3_assist-0.1.5}/src/boto3_assist/utilities/datetime_utility.py +0 -0
- {boto3_assist-0.1.3 → boto3_assist-0.1.5}/src/boto3_assist/utilities/logging_utility.py +0 -0
- {boto3_assist-0.1.3 → boto3_assist-0.1.5}/src/boto3_assist/utilities/serialization_utility.py +0 -0
- {boto3_assist-0.1.3 → boto3_assist-0.1.5}/src/boto3_assist/utilities/string_utility.py +0 -0
- {boto3_assist-0.1.3 → boto3_assist-0.1.5}/tests/__init__.py +0 -0
- {boto3_assist-0.1.3 → boto3_assist-0.1.5}/tests/__top/__init__.py +0 -0
- {boto3_assist-0.1.3 → boto3_assist-0.1.5}/tests/dynamodb/__init__.py +0 -0
- {boto3_assist-0.1.3 → boto3_assist-0.1.5}/tests/dynamodb/dynamodb_model_base_test.py +0 -0
- {boto3_assist-0.1.3 → boto3_assist-0.1.5}/tests/dynamodb/dynamodb_reindex_test.py +0 -0
- {boto3_assist-0.1.3 → boto3_assist-0.1.5}/tests/examples_test/__init__.py +0 -0
- {boto3_assist-0.1.3 → boto3_assist-0.1.5}/tests/examples_test/user_service_test.py +0 -0
- {boto3_assist-0.1.3 → boto3_assist-0.1.5}/tests/utilities/__init__.py +0 -0
- {boto3_assist-0.1.3 → boto3_assist-0.1.5}/tests/utilities/serialization_utility_test.py +0 -0
|
@@ -372,6 +372,7 @@ class DynamoDB(DynamoDBConnection):
|
|
|
372
372
|
do_projections: bool = False,
|
|
373
373
|
ascending: bool = False,
|
|
374
374
|
strongly_consistent: bool = False,
|
|
375
|
+
limit: Optional[int] = None,
|
|
375
376
|
) -> dict:
|
|
376
377
|
"""Helper function to list by criteria"""
|
|
377
378
|
|
|
@@ -391,6 +392,7 @@ class DynamoDB(DynamoDBConnection):
|
|
|
391
392
|
expression_attribute_names=expression_attribute_names,
|
|
392
393
|
ascending=ascending,
|
|
393
394
|
strongly_consistent=strongly_consistent,
|
|
395
|
+
limit=limit,
|
|
394
396
|
)
|
|
395
397
|
|
|
396
398
|
return response
|
|
@@ -38,9 +38,11 @@ class DynamoDBImporter:
|
|
|
38
38
|
raise FileNotFoundError(f"File not found: {json_file_path}")
|
|
39
39
|
if json_file_path.endswith(".gz"):
|
|
40
40
|
data = self.read_gzip_file(json_file_path)
|
|
41
|
-
|
|
41
|
+
elif json_file_path.endswith(".json"):
|
|
42
42
|
with open(json_file_path, "r", encoding="utf-8") as json_file:
|
|
43
43
|
data = json.load(json_file)
|
|
44
|
+
else:
|
|
45
|
+
raise ValueError(f"Unsupported file type: {json_file_path}")
|
|
44
46
|
|
|
45
47
|
# table = self.db.dynamodb_resource.Table(self.table_name)
|
|
46
48
|
# with table.batch_writer() as batch:
|
|
@@ -58,7 +60,22 @@ class DynamoDBImporter:
|
|
|
58
60
|
def import_json_files(self, json_file_paths: list[str]) -> None:
|
|
59
61
|
"""Import multiple json files into the database"""
|
|
60
62
|
for json_file_path in json_file_paths:
|
|
61
|
-
|
|
63
|
+
if os.path.exists(json_file_path) is False:
|
|
64
|
+
raise FileNotFoundError(f"File not found: {json_file_path}")
|
|
65
|
+
else:
|
|
66
|
+
if json_file_path.endswith(".gz") or json_file_path.endswith(".json"):
|
|
67
|
+
self.import_json_file(json_file_path)
|
|
68
|
+
else:
|
|
69
|
+
if os.path.isdir(json_file_path):
|
|
70
|
+
logger.warning(
|
|
71
|
+
f"Unsupported sub directory import {json_file_path}. "
|
|
72
|
+
"Skipping import on this file."
|
|
73
|
+
)
|
|
74
|
+
else:
|
|
75
|
+
logger.warning(
|
|
76
|
+
f"Unsupported file type: {json_file_path}. "
|
|
77
|
+
"Skipping import on this file. Files should end with .gz or .json"
|
|
78
|
+
)
|
|
62
79
|
|
|
63
80
|
def read_gzip_file(self, file_path: str) -> List[dict]:
|
|
64
81
|
"""
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
__version__ = '0.1.5'
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
__version__ = '0.1.3'
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{boto3_assist-0.1.3 → boto3_assist-0.1.5}/examples/dynamodb/services/user_service_client_example.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{boto3_assist-0.1.3 → boto3_assist-0.1.5}/src/boto3_assist/dynamodb/dynamodb_connection_tracker.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{boto3_assist-0.1.3 → boto3_assist-0.1.5}/src/boto3_assist/utilities/serialization_utility.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|