boto3-assist 0.2.6__tar.gz → 0.2.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.
Files changed (102) hide show
  1. {boto3_assist-0.2.6 → boto3_assist-0.2.8}/PKG-INFO +8 -8
  2. {boto3_assist-0.2.6 → boto3_assist-0.2.8}/pyproject.toml +9 -9
  3. boto3_assist-0.2.8/requirements-dev.txt +18 -0
  4. {boto3_assist-0.2.6 → boto3_assist-0.2.8}/src/boto3_assist/dynamodb/dynamodb_model_base.py +33 -0
  5. boto3_assist-0.2.8/src/boto3_assist/version.py +1 -0
  6. boto3_assist-0.2.6/requirements-dev.txt +0 -13
  7. boto3_assist-0.2.6/src/boto3_assist/version.py +0 -1
  8. {boto3_assist-0.2.6 → boto3_assist-0.2.8}/.env.docker +0 -0
  9. {boto3_assist-0.2.6 → boto3_assist-0.2.8}/.env.docker.001 +0 -0
  10. {boto3_assist-0.2.6 → boto3_assist-0.2.8}/.env.docker.nosql.workbench +0 -0
  11. {boto3_assist-0.2.6 → boto3_assist-0.2.8}/.env.unittest +0 -0
  12. {boto3_assist-0.2.6 → boto3_assist-0.2.8}/.gitignore +0 -0
  13. {boto3_assist-0.2.6 → boto3_assist-0.2.8}/.vscode/launch.json +0 -0
  14. {boto3_assist-0.2.6 → boto3_assist-0.2.8}/.vscode/settings.json +0 -0
  15. {boto3_assist-0.2.6 → boto3_assist-0.2.8}/.vscode/tasks.json +0 -0
  16. {boto3_assist-0.2.6 → boto3_assist-0.2.8}/LICENSE-EXPLAINED.txt +0 -0
  17. {boto3_assist-0.2.6 → boto3_assist-0.2.8}/LICENSE.txt +0 -0
  18. {boto3_assist-0.2.6 → boto3_assist-0.2.8}/README.md +0 -0
  19. {boto3_assist-0.2.6 → boto3_assist-0.2.8}/aws_regions_with_status.csv +0 -0
  20. {boto3_assist-0.2.6 → boto3_assist-0.2.8}/aws_regions_with_status.json +0 -0
  21. {boto3_assist-0.2.6 → boto3_assist-0.2.8}/devops/build.py +0 -0
  22. {boto3_assist-0.2.6 → boto3_assist-0.2.8}/devops/readme.md +0 -0
  23. {boto3_assist-0.2.6 → boto3_assist-0.2.8}/examples/__init__.py +0 -0
  24. {boto3_assist-0.2.6 → boto3_assist-0.2.8}/examples/cloudwatch/log_report.py +0 -0
  25. {boto3_assist-0.2.6 → boto3_assist-0.2.8}/examples/dynamodb/models/order_item_model.py +0 -0
  26. {boto3_assist-0.2.6 → boto3_assist-0.2.8}/examples/dynamodb/models/order_model.py +0 -0
  27. {boto3_assist-0.2.6 → boto3_assist-0.2.8}/examples/dynamodb/models/product_model.py +0 -0
  28. {boto3_assist-0.2.6 → boto3_assist-0.2.8}/examples/dynamodb/models/user_model.py +0 -0
  29. {boto3_assist-0.2.6 → boto3_assist-0.2.8}/examples/dynamodb/models/user_post_model.py +0 -0
  30. {boto3_assist-0.2.6 → boto3_assist-0.2.8}/examples/dynamodb/order_example/main.py +0 -0
  31. {boto3_assist-0.2.6 → boto3_assist-0.2.8}/examples/dynamodb/order_example/products.json +0 -0
  32. {boto3_assist-0.2.6 → boto3_assist-0.2.8}/examples/dynamodb/services/order_item_service.py +0 -0
  33. {boto3_assist-0.2.6 → boto3_assist-0.2.8}/examples/dynamodb/services/order_service.py +0 -0
  34. {boto3_assist-0.2.6 → boto3_assist-0.2.8}/examples/dynamodb/services/product_service.py +0 -0
  35. {boto3_assist-0.2.6 → boto3_assist-0.2.8}/examples/dynamodb/services/table_service.py +0 -0
  36. {boto3_assist-0.2.6 → boto3_assist-0.2.8}/examples/dynamodb/services/user_post_service.py +0 -0
  37. {boto3_assist-0.2.6 → boto3_assist-0.2.8}/examples/dynamodb/services/user_service.py +0 -0
  38. {boto3_assist-0.2.6 → boto3_assist-0.2.8}/examples/dynamodb/services/user_service_client_example.py +0 -0
  39. {boto3_assist-0.2.6 → boto3_assist-0.2.8}/examples/dynamodb/services/user_service_resource_example.py +0 -0
  40. {boto3_assist-0.2.6 → boto3_assist-0.2.8}/examples/dynamodb/user_post_example/main.py +0 -0
  41. {boto3_assist-0.2.6 → boto3_assist-0.2.8}/examples/ec2/regions_report.py +0 -0
  42. {boto3_assist-0.2.6 → boto3_assist-0.2.8}/module-headers.txt +0 -0
  43. {boto3_assist-0.2.6 → boto3_assist-0.2.8}/mypy.ini +0 -0
  44. {boto3_assist-0.2.6 → boto3_assist-0.2.8}/requirements.txt +0 -0
  45. {boto3_assist-0.2.6 → boto3_assist-0.2.8}/run-checks.sh +0 -0
  46. {boto3_assist-0.2.6 → boto3_assist-0.2.8}/src/boto3_assist/__init__.py +0 -0
  47. {boto3_assist-0.2.6 → boto3_assist-0.2.8}/src/boto3_assist/boto3session.py +0 -0
  48. {boto3_assist-0.2.6 → boto3_assist-0.2.8}/src/boto3_assist/cloudwatch/cloudwatch_connection.py +0 -0
  49. {boto3_assist-0.2.6 → boto3_assist-0.2.8}/src/boto3_assist/cloudwatch/cloudwatch_connection_tracker.py +0 -0
  50. {boto3_assist-0.2.6 → boto3_assist-0.2.8}/src/boto3_assist/cloudwatch/cloudwatch_log_connection.py +0 -0
  51. {boto3_assist-0.2.6 → boto3_assist-0.2.8}/src/boto3_assist/cloudwatch/cloudwatch_logs.py +0 -0
  52. {boto3_assist-0.2.6 → boto3_assist-0.2.8}/src/boto3_assist/cloudwatch/cloudwatch_query.py +0 -0
  53. {boto3_assist-0.2.6 → boto3_assist-0.2.8}/src/boto3_assist/connection.py +0 -0
  54. {boto3_assist-0.2.6 → boto3_assist-0.2.8}/src/boto3_assist/connection_tracker.py +0 -0
  55. {boto3_assist-0.2.6 → boto3_assist-0.2.8}/src/boto3_assist/dynamodb/dynamodb.py +0 -0
  56. {boto3_assist-0.2.6 → boto3_assist-0.2.8}/src/boto3_assist/dynamodb/dynamodb_connection.py +0 -0
  57. {boto3_assist-0.2.6 → boto3_assist-0.2.8}/src/boto3_assist/dynamodb/dynamodb_connection_tracker.py +0 -0
  58. {boto3_assist-0.2.6 → boto3_assist-0.2.8}/src/boto3_assist/dynamodb/dynamodb_helpers.py +0 -0
  59. {boto3_assist-0.2.6 → boto3_assist-0.2.8}/src/boto3_assist/dynamodb/dynamodb_importer.py +0 -0
  60. {boto3_assist-0.2.6 → boto3_assist-0.2.8}/src/boto3_assist/dynamodb/dynamodb_index.py +0 -0
  61. {boto3_assist-0.2.6 → boto3_assist-0.2.8}/src/boto3_assist/dynamodb/dynamodb_iservice.py +0 -0
  62. {boto3_assist-0.2.6 → boto3_assist-0.2.8}/src/boto3_assist/dynamodb/dynamodb_key.py +0 -0
  63. {boto3_assist-0.2.6 → boto3_assist-0.2.8}/src/boto3_assist/dynamodb/dynamodb_model_base_interfaces.py +0 -0
  64. {boto3_assist-0.2.6 → boto3_assist-0.2.8}/src/boto3_assist/dynamodb/dynamodb_reindexer.py +0 -0
  65. {boto3_assist-0.2.6 → boto3_assist-0.2.8}/src/boto3_assist/dynamodb/dynamodb_reserved_words.py +0 -0
  66. {boto3_assist-0.2.6 → boto3_assist-0.2.8}/src/boto3_assist/dynamodb/dynamodb_reserved_words.txt +0 -0
  67. {boto3_assist-0.2.6 → boto3_assist-0.2.8}/src/boto3_assist/dynamodb/readme.md +0 -0
  68. {boto3_assist-0.2.6 → boto3_assist-0.2.8}/src/boto3_assist/dynamodb/troubleshooting.md +0 -0
  69. {boto3_assist-0.2.6 → boto3_assist-0.2.8}/src/boto3_assist/ec2/ec2_connection.py +0 -0
  70. {boto3_assist-0.2.6 → boto3_assist-0.2.8}/src/boto3_assist/environment_services/__init__.py +0 -0
  71. {boto3_assist-0.2.6 → boto3_assist-0.2.8}/src/boto3_assist/environment_services/environment_loader.py +0 -0
  72. {boto3_assist-0.2.6 → boto3_assist-0.2.8}/src/boto3_assist/environment_services/environment_variables.py +0 -0
  73. {boto3_assist-0.2.6 → boto3_assist-0.2.8}/src/boto3_assist/errors/custom_exceptions.py +0 -0
  74. {boto3_assist-0.2.6 → boto3_assist-0.2.8}/src/boto3_assist/s3/s3.py +0 -0
  75. {boto3_assist-0.2.6 → boto3_assist-0.2.8}/src/boto3_assist/s3/s3_connection.py +0 -0
  76. {boto3_assist-0.2.6 → boto3_assist-0.2.8}/src/boto3_assist/utilities/datetime_utility.py +0 -0
  77. {boto3_assist-0.2.6 → boto3_assist-0.2.8}/src/boto3_assist/utilities/file_operations.py +0 -0
  78. {boto3_assist-0.2.6 → boto3_assist-0.2.8}/src/boto3_assist/utilities/http_utility.py +0 -0
  79. {boto3_assist-0.2.6 → boto3_assist-0.2.8}/src/boto3_assist/utilities/logging_utility.py +0 -0
  80. {boto3_assist-0.2.6 → boto3_assist-0.2.8}/src/boto3_assist/utilities/serialization_utility.py +0 -0
  81. {boto3_assist-0.2.6 → boto3_assist-0.2.8}/src/boto3_assist/utilities/string_utility.py +0 -0
  82. {boto3_assist-0.2.6 → boto3_assist-0.2.8}/tests/__init__.py +0 -0
  83. {boto3_assist-0.2.6 → boto3_assist-0.2.8}/tests/__top/__init__.py +0 -0
  84. {boto3_assist-0.2.6 → boto3_assist-0.2.8}/tests/dynamodb/__init__.py +0 -0
  85. {boto3_assist-0.2.6 → boto3_assist-0.2.8}/tests/dynamodb/dynamodb_model_base_test.py +0 -0
  86. {boto3_assist-0.2.6 → boto3_assist-0.2.8}/tests/dynamodb/dynamodb_model_projections_test.py +0 -0
  87. {boto3_assist-0.2.6 → boto3_assist-0.2.8}/tests/dynamodb/dynamodb_model_serializtion_test.py +0 -0
  88. {boto3_assist-0.2.6 → boto3_assist-0.2.8}/tests/dynamodb/dynamodb_moto_sorting_test.py +0 -0
  89. {boto3_assist-0.2.6 → boto3_assist-0.2.8}/tests/dynamodb/dynamodb_reindex_test.py +0 -0
  90. {boto3_assist-0.2.6 → boto3_assist-0.2.8}/tests/dynamodb/models/cms/base.py +0 -0
  91. {boto3_assist-0.2.6 → boto3_assist-0.2.8}/tests/dynamodb/models/cms/content_block.py +0 -0
  92. {boto3_assist-0.2.6 → boto3_assist-0.2.8}/tests/dynamodb/models/cms/page.py +0 -0
  93. {boto3_assist-0.2.6 → boto3_assist-0.2.8}/tests/dynamodb/models/cms/template.py +0 -0
  94. {boto3_assist-0.2.6 → boto3_assist-0.2.8}/tests/dynamodb/models/simple_model.py +0 -0
  95. {boto3_assist-0.2.6 → boto3_assist-0.2.8}/tests/dynamodb/models/user_model.py +0 -0
  96. {boto3_assist-0.2.6 → boto3_assist-0.2.8}/tests/examples_test/__init__.py +0 -0
  97. {boto3_assist-0.2.6 → boto3_assist-0.2.8}/tests/examples_test/user_service_test.py +0 -0
  98. {boto3_assist-0.2.6 → boto3_assist-0.2.8}/tests/s3/__init__.py +0 -0
  99. {boto3_assist-0.2.6 → boto3_assist-0.2.8}/tests/s3/files/test.txt +0 -0
  100. {boto3_assist-0.2.6 → boto3_assist-0.2.8}/tests/s3/s3_file_upload_test.py +0 -0
  101. {boto3_assist-0.2.6 → boto3_assist-0.2.8}/tests/utilities/__init__.py +0 -0
  102. {boto3_assist-0.2.6 → boto3_assist-0.2.8}/tests/utilities/serialization_utility_test.py +0 -0
@@ -1,22 +1,22 @@
1
- Metadata-Version: 2.3
1
+ Metadata-Version: 2.4
2
2
  Name: boto3_assist
3
- Version: 0.2.6
3
+ Version: 0.2.8
4
4
  Summary: Additional boto3 wrappers to make your life a little easier
5
5
  Author-email: Eric Wilson <boto3-assist@geekcafe.com>
6
+ License-File: LICENSE-EXPLAINED.txt
7
+ License-File: LICENSE.txt
6
8
  Classifier: License :: Other/Proprietary License
7
9
  Classifier: Operating System :: OS Independent
8
10
  Classifier: Programming Language :: Python :: 3
9
11
  Requires-Python: >=3.10
10
- Requires-Dist: aws-lambda-powertools==2.38.1
12
+ Requires-Dist: aws-lambda-powertools
11
13
  Requires-Dist: aws-xray-sdk
12
- Requires-Dist: boto3==1.34.110
13
- Requires-Dist: jsons==1.6.3
14
+ Requires-Dist: boto3
15
+ Requires-Dist: jsons
14
16
  Requires-Dist: python-dateutil
15
17
  Requires-Dist: python-dotenv
16
- Requires-Dist: python-dotenv==1.0.1
17
18
  Requires-Dist: pytz
18
- Requires-Dist: pytz==2024.1
19
- Requires-Dist: requests==2.31.0
19
+ Requires-Dist: requests
20
20
  Requires-Dist: types-python-dateutil
21
21
  Description-Content-Type: text/markdown
22
22
 
@@ -7,7 +7,8 @@ packages = ["src/boto3_assist"]
7
7
 
8
8
  [project]
9
9
  name = "boto3_assist"
10
- version = "0.2.6"
10
+ version = "0.2.8"
11
+
11
12
  authors = [
12
13
  { name="Eric Wilson", email="boto3-assist@geekcafe.com" }
13
14
  ]
@@ -21,15 +22,14 @@ classifiers = [
21
22
  ]
22
23
 
23
24
  dependencies = [
24
- "jsons==1.6.3",
25
- "aws-lambda-powertools==2.38.1",
25
+ "jsons",
26
+ "aws-lambda-powertools",
26
27
  "aws-xray-sdk",
27
- "boto3==1.34.110",
28
- "pytz==2024.1",
29
- "python-dotenv==1.0.1",
30
- "python-dateutil",
31
- "python-dotenv",
28
+ "boto3",
29
+ "pytz",
30
+ "python-dotenv",
31
+ "python-dateutil",
32
32
  "pytz",
33
- "requests==2.31.0",
33
+ "requests",
34
34
  "types-python-dateutil",
35
35
  ]
@@ -0,0 +1,18 @@
1
+ boto3-stubs[dynamodb]
2
+ build
3
+ mypy
4
+ mypy_boto3_dynamodb
5
+ mypy_boto3_ec2
6
+ mypy_boto3_cloudwatch
7
+ mypy_boto3_s3
8
+ moto [dynamodb2] # mocks for unit tests
9
+ # setuptools
10
+ types-python-dateutil
11
+ toml
12
+ twine
13
+ wheel
14
+ pkginfo # occasionally we need to upgrade this or we can get upload errors when it's out of sync
15
+ # the error may look like the following
16
+ # ERROR InvalidDistribution: Metadata is missing required fields: Name, Version.
17
+ # Make sure the distribution includes the files where those fields are specified, and is using a supported
18
+ # Metadata-Version: 1.0, 1.1, 1.2, 2.0, 2.1, 2.2, 2.3.
@@ -18,6 +18,7 @@ from boto3_assist.dynamodb.dynamodb_index import (
18
18
  DynamoDBIndex,
19
19
  )
20
20
  from boto3_assist.dynamodb.dynamodb_reserved_words import DynamoDBReservedWords
21
+ from boto3_assist.utilities.datetime_utility import DatetimeUtility
21
22
 
22
23
 
23
24
  def exclude_from_serialization(method):
@@ -214,6 +215,38 @@ class DynamoDBModelBase:
214
215
 
215
216
  return values
216
217
 
218
+ def to_timestamp_or_none(self, value: str | dt.datetime | None) -> float | None:
219
+ """
220
+ Convert a value to a timestamp (float) or None
221
+
222
+ Exceptions:
223
+ ValueError: If the value is not a datetime string or datetime
224
+ """
225
+
226
+ if isinstance(value, str):
227
+ # value = dt.datetime.fromisoformat(value)
228
+ value = DatetimeUtility.to_datetime_utc(value)
229
+
230
+ if value is None:
231
+ return None
232
+
233
+ if isinstance(value, dt.datetime):
234
+ return value.timestamp()
235
+
236
+ raise ValueError(
237
+ "Value must be a None, a string in a valid datetime format or datetime"
238
+ )
239
+
240
+ def to_utc(self, value: str | dt.datetime | None) -> dt.datetime | None:
241
+ """
242
+ Convert a datetime to UTC. This ensures all datetimes are stored in UTC format
243
+
244
+ Exceptions:
245
+ ValueError: If the value is not a datetime string or datetime
246
+ """
247
+
248
+ value = DatetimeUtility.to_datetime_utc(value)
249
+
217
250
 
218
251
  class DynamoDBSerializer:
219
252
  """Library to Serialize object to a DynamoDB Format"""
@@ -0,0 +1 @@
1
+ __version__ = '0.2.8'
@@ -1,13 +0,0 @@
1
- boto3-stubs[dynamodb]
2
- build
3
- mypy
4
- mypy_boto3_dynamodb
5
- mypy_boto3_ec2
6
- mypy_boto3_cloudwatch
7
- mypy_boto3_s3
8
- moto [dynamodb2] # mocks for unit tests
9
- # setuptools
10
- types-python-dateutil
11
- toml
12
- twine
13
- wheel
@@ -1 +0,0 @@
1
- __version__ = '0.2.6'
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes