boto3-assist 0.1.6__tar.gz → 0.1.7__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.
Files changed (80) hide show
  1. {boto3_assist-0.1.6 → boto3_assist-0.1.7}/PKG-INFO +1 -1
  2. {boto3_assist-0.1.6 → boto3_assist-0.1.7}/pyproject.toml +1 -1
  3. {boto3_assist-0.1.6 → boto3_assist-0.1.7}/src/boto3_assist/dynamodb/dynamodb_model_base.py +7 -1
  4. {boto3_assist-0.1.6 → boto3_assist-0.1.7}/src/boto3_assist/dynamodb/dynamodb_reserved_words.py +6 -4
  5. boto3_assist-0.1.7/src/boto3_assist/version.py +1 -0
  6. {boto3_assist-0.1.6 → boto3_assist-0.1.7}/tests/dynamodb/dynamodb_model_projections_test.py +1 -5
  7. {boto3_assist-0.1.6 → boto3_assist-0.1.7}/tests/dynamodb/models/user_model.py +0 -10
  8. boto3_assist-0.1.7/tests/examples_test/__init__.py +0 -0
  9. boto3_assist-0.1.6/src/boto3_assist/version.py +0 -1
  10. {boto3_assist-0.1.6 → boto3_assist-0.1.7}/.env.development +0 -0
  11. {boto3_assist-0.1.6 → boto3_assist-0.1.7}/.env.docker +0 -0
  12. {boto3_assist-0.1.6 → boto3_assist-0.1.7}/.env.docker.001 +0 -0
  13. {boto3_assist-0.1.6 → boto3_assist-0.1.7}/.env.docker.nosql.workbench +0 -0
  14. {boto3_assist-0.1.6 → boto3_assist-0.1.7}/.gitignore +0 -0
  15. {boto3_assist-0.1.6 → boto3_assist-0.1.7}/.vscode/launch.json +0 -0
  16. {boto3_assist-0.1.6 → boto3_assist-0.1.7}/.vscode/settings.json +0 -0
  17. {boto3_assist-0.1.6 → boto3_assist-0.1.7}/.vscode/tasks.json +0 -0
  18. {boto3_assist-0.1.6 → boto3_assist-0.1.7}/LICENSE-EXPLAINED.txt +0 -0
  19. {boto3_assist-0.1.6 → boto3_assist-0.1.7}/LICENSE.txt +0 -0
  20. {boto3_assist-0.1.6 → boto3_assist-0.1.7}/README.md +0 -0
  21. {boto3_assist-0.1.6 → boto3_assist-0.1.7}/aws_regions_with_status.csv +0 -0
  22. {boto3_assist-0.1.6 → boto3_assist-0.1.7}/aws_regions_with_status.json +0 -0
  23. {boto3_assist-0.1.6 → boto3_assist-0.1.7}/devops/build.py +0 -0
  24. {boto3_assist-0.1.6 → boto3_assist-0.1.7}/devops/readme.md +0 -0
  25. {boto3_assist-0.1.6 → boto3_assist-0.1.7}/examples/__init__.py +0 -0
  26. {boto3_assist-0.1.6 → boto3_assist-0.1.7}/examples/dynamodb/models/order_item_model.py +0 -0
  27. {boto3_assist-0.1.6 → boto3_assist-0.1.7}/examples/dynamodb/models/order_model.py +0 -0
  28. {boto3_assist-0.1.6 → boto3_assist-0.1.7}/examples/dynamodb/models/product_model.py +0 -0
  29. {boto3_assist-0.1.6 → boto3_assist-0.1.7}/examples/dynamodb/models/user_model.py +0 -0
  30. {boto3_assist-0.1.6 → boto3_assist-0.1.7}/examples/dynamodb/models/user_post_model.py +0 -0
  31. {boto3_assist-0.1.6 → boto3_assist-0.1.7}/examples/dynamodb/order_example/main.py +0 -0
  32. {boto3_assist-0.1.6 → boto3_assist-0.1.7}/examples/dynamodb/order_example/products.json +0 -0
  33. {boto3_assist-0.1.6 → boto3_assist-0.1.7}/examples/dynamodb/services/order_item_service.py +0 -0
  34. {boto3_assist-0.1.6 → boto3_assist-0.1.7}/examples/dynamodb/services/order_service.py +0 -0
  35. {boto3_assist-0.1.6 → boto3_assist-0.1.7}/examples/dynamodb/services/product_service.py +0 -0
  36. {boto3_assist-0.1.6 → boto3_assist-0.1.7}/examples/dynamodb/services/table_service.py +0 -0
  37. {boto3_assist-0.1.6 → boto3_assist-0.1.7}/examples/dynamodb/services/user_post_service.py +0 -0
  38. {boto3_assist-0.1.6 → boto3_assist-0.1.7}/examples/dynamodb/services/user_service.py +0 -0
  39. {boto3_assist-0.1.6 → boto3_assist-0.1.7}/examples/dynamodb/services/user_service_client_example.py +0 -0
  40. {boto3_assist-0.1.6 → boto3_assist-0.1.7}/examples/dynamodb/services/user_service_resource_example.py +0 -0
  41. {boto3_assist-0.1.6 → boto3_assist-0.1.7}/examples/dynamodb/user_post_example/main.py +0 -0
  42. {boto3_assist-0.1.6 → boto3_assist-0.1.7}/examples/ec2/regions_report.py +0 -0
  43. {boto3_assist-0.1.6 → boto3_assist-0.1.7}/module-headers.txt +0 -0
  44. {boto3_assist-0.1.6 → boto3_assist-0.1.7}/mypy.ini +0 -0
  45. {boto3_assist-0.1.6 → boto3_assist-0.1.7}/requirements-dev.txt +0 -0
  46. {boto3_assist-0.1.6 → boto3_assist-0.1.7}/requirements.txt +0 -0
  47. {boto3_assist-0.1.6 → boto3_assist-0.1.7}/run-checks.sh +0 -0
  48. {boto3_assist-0.1.6 → boto3_assist-0.1.7}/src/boto3_assist/__init__.py +0 -0
  49. {boto3_assist-0.1.6 → boto3_assist-0.1.7}/src/boto3_assist/boto3session.py +0 -0
  50. {boto3_assist-0.1.6 → boto3_assist-0.1.7}/src/boto3_assist/connection_tracker.py +0 -0
  51. {boto3_assist-0.1.6 → boto3_assist-0.1.7}/src/boto3_assist/dynamodb/dynamodb.py +0 -0
  52. {boto3_assist-0.1.6 → boto3_assist-0.1.7}/src/boto3_assist/dynamodb/dynamodb_connection.py +0 -0
  53. {boto3_assist-0.1.6 → boto3_assist-0.1.7}/src/boto3_assist/dynamodb/dynamodb_connection_tracker.py +0 -0
  54. {boto3_assist-0.1.6 → boto3_assist-0.1.7}/src/boto3_assist/dynamodb/dynamodb_helpers.py +0 -0
  55. {boto3_assist-0.1.6 → boto3_assist-0.1.7}/src/boto3_assist/dynamodb/dynamodb_importer.py +0 -0
  56. {boto3_assist-0.1.6 → boto3_assist-0.1.7}/src/boto3_assist/dynamodb/dynamodb_index.py +0 -0
  57. {boto3_assist-0.1.6 → boto3_assist-0.1.7}/src/boto3_assist/dynamodb/dynamodb_iservice.py +0 -0
  58. {boto3_assist-0.1.6 → boto3_assist-0.1.7}/src/boto3_assist/dynamodb/dynamodb_key.py +0 -0
  59. {boto3_assist-0.1.6 → boto3_assist-0.1.7}/src/boto3_assist/dynamodb/dynamodb_model_base_interfaces.py +0 -0
  60. {boto3_assist-0.1.6 → boto3_assist-0.1.7}/src/boto3_assist/dynamodb/dynamodb_reindexer.py +0 -0
  61. {boto3_assist-0.1.6 → boto3_assist-0.1.7}/src/boto3_assist/dynamodb/dynamodb_reserved_words.txt +0 -0
  62. {boto3_assist-0.1.6 → boto3_assist-0.1.7}/src/boto3_assist/dynamodb/readme.md +0 -0
  63. {boto3_assist-0.1.6 → boto3_assist-0.1.7}/src/boto3_assist/dynamodb/troubleshooting.md +0 -0
  64. {boto3_assist-0.1.6 → boto3_assist-0.1.7}/src/boto3_assist/ec2/ec2_connection.py +0 -0
  65. {boto3_assist-0.1.6 → boto3_assist-0.1.7}/src/boto3_assist/environment_services/__init__.py +0 -0
  66. {boto3_assist-0.1.6 → boto3_assist-0.1.7}/src/boto3_assist/environment_services/environment_loader.py +0 -0
  67. {boto3_assist-0.1.6 → boto3_assist-0.1.7}/src/boto3_assist/environment_services/environment_variables.py +0 -0
  68. {boto3_assist-0.1.6 → boto3_assist-0.1.7}/src/boto3_assist/utilities/datetime_utility.py +0 -0
  69. {boto3_assist-0.1.6 → boto3_assist-0.1.7}/src/boto3_assist/utilities/logging_utility.py +0 -0
  70. {boto3_assist-0.1.6 → boto3_assist-0.1.7}/src/boto3_assist/utilities/serialization_utility.py +0 -0
  71. {boto3_assist-0.1.6 → boto3_assist-0.1.7}/src/boto3_assist/utilities/string_utility.py +0 -0
  72. {boto3_assist-0.1.6 → boto3_assist-0.1.7}/tests/__init__.py +0 -0
  73. {boto3_assist-0.1.6 → boto3_assist-0.1.7}/tests/__top/__init__.py +0 -0
  74. {boto3_assist-0.1.6 → boto3_assist-0.1.7}/tests/dynamodb/__init__.py +0 -0
  75. {boto3_assist-0.1.6 → boto3_assist-0.1.7}/tests/dynamodb/dynamodb_model_base_test.py +0 -0
  76. {boto3_assist-0.1.6 → boto3_assist-0.1.7}/tests/dynamodb/dynamodb_reindex_test.py +0 -0
  77. /boto3_assist-0.1.6/tests/examples_test/__init__.py → /boto3_assist-0.1.7/tests/dynamodb/models/order_model.py +0 -0
  78. {boto3_assist-0.1.6 → boto3_assist-0.1.7}/tests/examples_test/user_service_test.py +0 -0
  79. {boto3_assist-0.1.6 → boto3_assist-0.1.7}/tests/utilities/__init__.py +0 -0
  80. {boto3_assist-0.1.6 → boto3_assist-0.1.7}/tests/utilities/serialization_utility_test.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.3
2
2
  Name: boto3_assist
3
- Version: 0.1.6
3
+ Version: 0.1.7
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
@@ -7,7 +7,7 @@ packages = ["src/boto3_assist"]
7
7
 
8
8
  [project]
9
9
  name = "boto3_assist"
10
- version = "0.1.6"
10
+ version = "0.1.7"
11
11
  authors = [
12
12
  { name="Eric Wilson", email="boto3-assist@geekcafe.com" }
13
13
  ]
@@ -48,7 +48,7 @@ class DynamoDBModelBase:
48
48
  self.__helpers: DynamoDBHelpers | None = None
49
49
  self.__indexes: DynamoDBIndexes | None = None
50
50
  self.__reserved_words: DynamoDBReservedWords = DynamoDBReservedWords()
51
- self.auto_generate_projections: bool = auto_generate_projections
51
+ self.__auto_generate_projections: bool = auto_generate_projections
52
52
 
53
53
  @property
54
54
  @exclude_from_serialization
@@ -74,6 +74,12 @@ class DynamoDBModelBase:
74
74
 
75
75
  return self.__projection_expression
76
76
 
77
+ @property
78
+ @exclude_from_serialization
79
+ def auto_generate_projections(self) -> bool:
80
+ """Gets the auto generate projections"""
81
+ return self.__auto_generate_projections
82
+
77
83
  @projection_expression.setter
78
84
  def projection_expression(self, value: str | None):
79
85
  self.__projection_expression = value
@@ -35,11 +35,13 @@ class DynamoDBReservedWords:
35
35
  projections = ["#" + p if self.is_reserved_word(p) else p for p in projections]
36
36
  return projections
37
37
 
38
- def transform_attributes(self, attributes: dict) -> dict:
38
+ def transform_attributes(self, projections: List[str] | str) -> dict:
39
39
  """Transforms a dict of attributes to remove reserved words"""
40
40
  transformed_attributes: dict | None = {}
41
- for k, v in attributes.items():
42
- if self.is_reserved_word(k):
43
- transformed_attributes["#" + k] = v
41
+ if isinstance(projections, str):
42
+ projections = projections.split(",")
43
+ for item in projections:
44
+ if self.is_reserved_word(item):
45
+ transformed_attributes["#" + item] = item
44
46
 
45
47
  return transformed_attributes
@@ -0,0 +1 @@
1
+ __version__ = '0.1.7'
@@ -40,17 +40,13 @@ class DynamoDBModeProjectionlUnitTest(unittest.TestCase):
40
40
  expressions = model.projection_expression
41
41
  self.assertIsInstance(expressions, str)
42
42
 
43
- # #type is in expression
44
- self.assertIn("#type", expressions)
45
43
  self.assertIn("#status", expressions)
46
44
 
47
45
  print(expressions)
48
46
 
49
47
  attribute_names = model.projection_expression_attribute_names
50
48
  self.assertIsInstance(attribute_names, dict)
51
- self.assertIn("#type", attribute_names)
49
+
52
50
  self.assertIn("#status", attribute_names)
53
51
 
54
- # "#type": "type" is in the dictionary
55
- self.assertIn("type", attribute_names["#type"])
56
52
  self.assertIn("status", attribute_names["#status"])
@@ -77,13 +77,3 @@ class User(DynamoDBModelBase):
77
77
  )
78
78
 
79
79
  self.indexes.add_secondary(gsi2)
80
-
81
- # self.key_configs = key_configs
82
- self.projection_expression = (
83
- "id,first_name,last_name,email,tenant_id,#type,#status,"
84
- "company_name,authorization,modified_datetime_utc"
85
- )
86
- self.projection_expression_attribute_names = {
87
- "#status": "status",
88
- "#type": "type",
89
- }
File without changes
@@ -1 +0,0 @@
1
- __version__ = '0.1.6'
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes