boto3-assist 0.1.7__tar.gz → 0.1.8__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.7 → boto3_assist-0.1.8}/PKG-INFO +1 -1
- {boto3_assist-0.1.7 → boto3_assist-0.1.8}/pyproject.toml +1 -1
- {boto3_assist-0.1.7 → boto3_assist-0.1.8}/src/boto3_assist/dynamodb/dynamodb_reserved_words.py +3 -1
- boto3_assist-0.1.8/src/boto3_assist/version.py +1 -0
- {boto3_assist-0.1.7 → boto3_assist-0.1.8}/tests/dynamodb/dynamodb_model_projections_test.py +30 -0
- boto3_assist-0.1.8/tests/dynamodb/models/simple_model.py +38 -0
- boto3_assist-0.1.7/src/boto3_assist/version.py +0 -1
- boto3_assist-0.1.7/tests/dynamodb/models/order_model.py +0 -0
- {boto3_assist-0.1.7 → boto3_assist-0.1.8}/.env.development +0 -0
- {boto3_assist-0.1.7 → boto3_assist-0.1.8}/.env.docker +0 -0
- {boto3_assist-0.1.7 → boto3_assist-0.1.8}/.env.docker.001 +0 -0
- {boto3_assist-0.1.7 → boto3_assist-0.1.8}/.env.docker.nosql.workbench +0 -0
- {boto3_assist-0.1.7 → boto3_assist-0.1.8}/.gitignore +0 -0
- {boto3_assist-0.1.7 → boto3_assist-0.1.8}/.vscode/launch.json +0 -0
- {boto3_assist-0.1.7 → boto3_assist-0.1.8}/.vscode/settings.json +0 -0
- {boto3_assist-0.1.7 → boto3_assist-0.1.8}/.vscode/tasks.json +0 -0
- {boto3_assist-0.1.7 → boto3_assist-0.1.8}/LICENSE-EXPLAINED.txt +0 -0
- {boto3_assist-0.1.7 → boto3_assist-0.1.8}/LICENSE.txt +0 -0
- {boto3_assist-0.1.7 → boto3_assist-0.1.8}/README.md +0 -0
- {boto3_assist-0.1.7 → boto3_assist-0.1.8}/aws_regions_with_status.csv +0 -0
- {boto3_assist-0.1.7 → boto3_assist-0.1.8}/aws_regions_with_status.json +0 -0
- {boto3_assist-0.1.7 → boto3_assist-0.1.8}/devops/build.py +0 -0
- {boto3_assist-0.1.7 → boto3_assist-0.1.8}/devops/readme.md +0 -0
- {boto3_assist-0.1.7 → boto3_assist-0.1.8}/examples/__init__.py +0 -0
- {boto3_assist-0.1.7 → boto3_assist-0.1.8}/examples/dynamodb/models/order_item_model.py +0 -0
- {boto3_assist-0.1.7 → boto3_assist-0.1.8}/examples/dynamodb/models/order_model.py +0 -0
- {boto3_assist-0.1.7 → boto3_assist-0.1.8}/examples/dynamodb/models/product_model.py +0 -0
- {boto3_assist-0.1.7 → boto3_assist-0.1.8}/examples/dynamodb/models/user_model.py +0 -0
- {boto3_assist-0.1.7 → boto3_assist-0.1.8}/examples/dynamodb/models/user_post_model.py +0 -0
- {boto3_assist-0.1.7 → boto3_assist-0.1.8}/examples/dynamodb/order_example/main.py +0 -0
- {boto3_assist-0.1.7 → boto3_assist-0.1.8}/examples/dynamodb/order_example/products.json +0 -0
- {boto3_assist-0.1.7 → boto3_assist-0.1.8}/examples/dynamodb/services/order_item_service.py +0 -0
- {boto3_assist-0.1.7 → boto3_assist-0.1.8}/examples/dynamodb/services/order_service.py +0 -0
- {boto3_assist-0.1.7 → boto3_assist-0.1.8}/examples/dynamodb/services/product_service.py +0 -0
- {boto3_assist-0.1.7 → boto3_assist-0.1.8}/examples/dynamodb/services/table_service.py +0 -0
- {boto3_assist-0.1.7 → boto3_assist-0.1.8}/examples/dynamodb/services/user_post_service.py +0 -0
- {boto3_assist-0.1.7 → boto3_assist-0.1.8}/examples/dynamodb/services/user_service.py +0 -0
- {boto3_assist-0.1.7 → boto3_assist-0.1.8}/examples/dynamodb/services/user_service_client_example.py +0 -0
- {boto3_assist-0.1.7 → boto3_assist-0.1.8}/examples/dynamodb/services/user_service_resource_example.py +0 -0
- {boto3_assist-0.1.7 → boto3_assist-0.1.8}/examples/dynamodb/user_post_example/main.py +0 -0
- {boto3_assist-0.1.7 → boto3_assist-0.1.8}/examples/ec2/regions_report.py +0 -0
- {boto3_assist-0.1.7 → boto3_assist-0.1.8}/module-headers.txt +0 -0
- {boto3_assist-0.1.7 → boto3_assist-0.1.8}/mypy.ini +0 -0
- {boto3_assist-0.1.7 → boto3_assist-0.1.8}/requirements-dev.txt +0 -0
- {boto3_assist-0.1.7 → boto3_assist-0.1.8}/requirements.txt +0 -0
- {boto3_assist-0.1.7 → boto3_assist-0.1.8}/run-checks.sh +0 -0
- {boto3_assist-0.1.7 → boto3_assist-0.1.8}/src/boto3_assist/__init__.py +0 -0
- {boto3_assist-0.1.7 → boto3_assist-0.1.8}/src/boto3_assist/boto3session.py +0 -0
- {boto3_assist-0.1.7 → boto3_assist-0.1.8}/src/boto3_assist/connection_tracker.py +0 -0
- {boto3_assist-0.1.7 → boto3_assist-0.1.8}/src/boto3_assist/dynamodb/dynamodb.py +0 -0
- {boto3_assist-0.1.7 → boto3_assist-0.1.8}/src/boto3_assist/dynamodb/dynamodb_connection.py +0 -0
- {boto3_assist-0.1.7 → boto3_assist-0.1.8}/src/boto3_assist/dynamodb/dynamodb_connection_tracker.py +0 -0
- {boto3_assist-0.1.7 → boto3_assist-0.1.8}/src/boto3_assist/dynamodb/dynamodb_helpers.py +0 -0
- {boto3_assist-0.1.7 → boto3_assist-0.1.8}/src/boto3_assist/dynamodb/dynamodb_importer.py +0 -0
- {boto3_assist-0.1.7 → boto3_assist-0.1.8}/src/boto3_assist/dynamodb/dynamodb_index.py +0 -0
- {boto3_assist-0.1.7 → boto3_assist-0.1.8}/src/boto3_assist/dynamodb/dynamodb_iservice.py +0 -0
- {boto3_assist-0.1.7 → boto3_assist-0.1.8}/src/boto3_assist/dynamodb/dynamodb_key.py +0 -0
- {boto3_assist-0.1.7 → boto3_assist-0.1.8}/src/boto3_assist/dynamodb/dynamodb_model_base.py +0 -0
- {boto3_assist-0.1.7 → boto3_assist-0.1.8}/src/boto3_assist/dynamodb/dynamodb_model_base_interfaces.py +0 -0
- {boto3_assist-0.1.7 → boto3_assist-0.1.8}/src/boto3_assist/dynamodb/dynamodb_reindexer.py +0 -0
- {boto3_assist-0.1.7 → boto3_assist-0.1.8}/src/boto3_assist/dynamodb/dynamodb_reserved_words.txt +0 -0
- {boto3_assist-0.1.7 → boto3_assist-0.1.8}/src/boto3_assist/dynamodb/readme.md +0 -0
- {boto3_assist-0.1.7 → boto3_assist-0.1.8}/src/boto3_assist/dynamodb/troubleshooting.md +0 -0
- {boto3_assist-0.1.7 → boto3_assist-0.1.8}/src/boto3_assist/ec2/ec2_connection.py +0 -0
- {boto3_assist-0.1.7 → boto3_assist-0.1.8}/src/boto3_assist/environment_services/__init__.py +0 -0
- {boto3_assist-0.1.7 → boto3_assist-0.1.8}/src/boto3_assist/environment_services/environment_loader.py +0 -0
- {boto3_assist-0.1.7 → boto3_assist-0.1.8}/src/boto3_assist/environment_services/environment_variables.py +0 -0
- {boto3_assist-0.1.7 → boto3_assist-0.1.8}/src/boto3_assist/utilities/datetime_utility.py +0 -0
- {boto3_assist-0.1.7 → boto3_assist-0.1.8}/src/boto3_assist/utilities/logging_utility.py +0 -0
- {boto3_assist-0.1.7 → boto3_assist-0.1.8}/src/boto3_assist/utilities/serialization_utility.py +0 -0
- {boto3_assist-0.1.7 → boto3_assist-0.1.8}/src/boto3_assist/utilities/string_utility.py +0 -0
- {boto3_assist-0.1.7 → boto3_assist-0.1.8}/tests/__init__.py +0 -0
- {boto3_assist-0.1.7 → boto3_assist-0.1.8}/tests/__top/__init__.py +0 -0
- {boto3_assist-0.1.7 → boto3_assist-0.1.8}/tests/dynamodb/__init__.py +0 -0
- {boto3_assist-0.1.7 → boto3_assist-0.1.8}/tests/dynamodb/dynamodb_model_base_test.py +0 -0
- {boto3_assist-0.1.7 → boto3_assist-0.1.8}/tests/dynamodb/dynamodb_reindex_test.py +0 -0
- {boto3_assist-0.1.7 → boto3_assist-0.1.8}/tests/dynamodb/models/user_model.py +0 -0
- {boto3_assist-0.1.7 → boto3_assist-0.1.8}/tests/examples_test/__init__.py +0 -0
- {boto3_assist-0.1.7 → boto3_assist-0.1.8}/tests/examples_test/user_service_test.py +0 -0
- {boto3_assist-0.1.7 → boto3_assist-0.1.8}/tests/utilities/__init__.py +0 -0
- {boto3_assist-0.1.7 → boto3_assist-0.1.8}/tests/utilities/serialization_utility_test.py +0 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
__version__ = '0.1.8'
|
|
@@ -8,6 +8,7 @@ import unittest
|
|
|
8
8
|
|
|
9
9
|
|
|
10
10
|
from tests.dynamodb.models.user_model import User
|
|
11
|
+
from tests.dynamodb.models.simple_model import Simple
|
|
11
12
|
|
|
12
13
|
|
|
13
14
|
class DynamoDBModeProjectionlUnitTest(unittest.TestCase):
|
|
@@ -50,3 +51,32 @@ class DynamoDBModeProjectionlUnitTest(unittest.TestCase):
|
|
|
50
51
|
self.assertIn("#status", attribute_names)
|
|
51
52
|
|
|
52
53
|
self.assertIn("status", attribute_names["#status"])
|
|
54
|
+
|
|
55
|
+
def test_simple_model(self):
|
|
56
|
+
"""Test Basic Serlization"""
|
|
57
|
+
# Arrange
|
|
58
|
+
data = {
|
|
59
|
+
"id": "123456",
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
# Act
|
|
63
|
+
model: Simple = Simple().map(data)
|
|
64
|
+
|
|
65
|
+
# Assert
|
|
66
|
+
|
|
67
|
+
self.assertEqual(model.id, "123456")
|
|
68
|
+
|
|
69
|
+
self.assertIsInstance(model, Simple)
|
|
70
|
+
|
|
71
|
+
key = model.indexes.primary.key()
|
|
72
|
+
self.assertIsInstance(key, dict)
|
|
73
|
+
|
|
74
|
+
expressions = model.projection_expression
|
|
75
|
+
self.assertIsInstance(expressions, str)
|
|
76
|
+
|
|
77
|
+
self.assertIn("id", expressions)
|
|
78
|
+
|
|
79
|
+
print(expressions)
|
|
80
|
+
|
|
81
|
+
attribute_names = model.projection_expression_attribute_names
|
|
82
|
+
self.assertIsNone(attribute_names)
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
"""
|
|
2
|
+
Geek Cafe, LLC
|
|
3
|
+
Maintainers: Eric Wilson
|
|
4
|
+
MIT License. See Project Root for the license information.
|
|
5
|
+
"""
|
|
6
|
+
|
|
7
|
+
from typing import Optional
|
|
8
|
+
|
|
9
|
+
from boto3_assist.dynamodb.dynamodb_model_base import DynamoDBModelBase
|
|
10
|
+
from boto3_assist.dynamodb.dynamodb_index import DynamoDBIndex
|
|
11
|
+
from boto3_assist.dynamodb.dynamodb_key import DynamoDBKey
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
class Simple(DynamoDBModelBase):
|
|
15
|
+
"""User Model"""
|
|
16
|
+
|
|
17
|
+
def __init__(
|
|
18
|
+
self,
|
|
19
|
+
id: Optional[str] = None, # pylint: disable=redefined-builtin
|
|
20
|
+
):
|
|
21
|
+
DynamoDBModelBase.__init__(self)
|
|
22
|
+
self.id: Optional[str] = id
|
|
23
|
+
|
|
24
|
+
self.__setup_indexes()
|
|
25
|
+
|
|
26
|
+
def __setup_indexes(self):
|
|
27
|
+
primary_key: DynamoDBIndex = DynamoDBIndex(
|
|
28
|
+
index_name="primary_key",
|
|
29
|
+
partition_key=DynamoDBKey(
|
|
30
|
+
attribute_name="pk",
|
|
31
|
+
value=lambda: DynamoDBKey.build_key((("user", self.id))),
|
|
32
|
+
),
|
|
33
|
+
sort_key=DynamoDBKey(
|
|
34
|
+
attribute_name="sk",
|
|
35
|
+
value=lambda: DynamoDBKey.build_key(("user", self.id)),
|
|
36
|
+
),
|
|
37
|
+
)
|
|
38
|
+
self.indexes.add_primary(primary_key)
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
__version__ = '0.1.7'
|
|
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
|
|
File without changes
|
{boto3_assist-0.1.7 → boto3_assist-0.1.8}/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
|
|
File without changes
|
{boto3_assist-0.1.7 → boto3_assist-0.1.8}/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
|
{boto3_assist-0.1.7 → boto3_assist-0.1.8}/src/boto3_assist/dynamodb/dynamodb_reserved_words.txt
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
|
{boto3_assist-0.1.7 → boto3_assist-0.1.8}/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
|
|
File without changes
|