boto3-assist 0.9.0__py3-none-any.whl → 0.9.1__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.
@@ -5,7 +5,7 @@ MIT License. See Project Root for the license information.
5
5
  """
6
6
 
7
7
  import os
8
-
8
+ import json
9
9
  from typing import List, Union, Optional, IO
10
10
  from pathlib import Path
11
11
  from dotenv import load_dotenv
@@ -109,3 +109,20 @@ class EnvironmentLoader:
109
109
  )
110
110
 
111
111
  return None
112
+
113
+ def load_event_file(self, full_path: str) -> dict:
114
+ """Loads an AWS event file"""
115
+ if not os.path.exists(full_path):
116
+ raise RuntimeError(f"Failed to locate event file: {full_path}")
117
+
118
+ event = {}
119
+ with open(full_path, mode="r", encoding="utf-8") as json_file:
120
+ event = json.load(json_file)
121
+
122
+ if isinstance(event, dict) and "message" in event:
123
+ event = event.get("message", {})
124
+
125
+ if isinstance(event, dict) and "event" in event:
126
+ event = event.get("event", {})
127
+
128
+ return event
boto3_assist/version.py CHANGED
@@ -1 +1 @@
1
- __version__ = '0.9.0'
1
+ __version__ = '0.9.1'
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: boto3_assist
3
- Version: 0.9.0
3
+ Version: 0.9.1
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
@@ -3,7 +3,7 @@ boto3_assist/boto3session.py,sha256=Q9sByNC0r_aMQfHnIEnxtTaiCMUqikm8UeSTxV7-Np0,
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=_DlwPNmTZTKflLiAF8YIqSr2ao66CTjj4bQtA6hz0jM,22
6
+ boto3_assist/version.py,sha256=pF8TnH2QJF8nfDmcD7oPTrAOnioy05dV4YmYDzkT5Es,22
7
7
  boto3_assist/aws_lambda/event_info.py,sha256=OkZ4WzuGaHEu_T8sB188KBgShAJhZpWASALKRGBOhMg,14648
8
8
  boto3_assist/cloudwatch/cloudwatch_connection.py,sha256=mnGWaLSQpHh5EeY7Ek_2o9JKHJxOELIYtQVMX1IaHn4,2480
9
9
  boto3_assist/cloudwatch/cloudwatch_connection_tracker.py,sha256=mzRtO1uHrcfJNh1XrGEiXdTqxwEP8d1RqJkraMNkgK0,410
@@ -31,7 +31,7 @@ boto3_assist/dynamodb/readme.md,sha256=wNMzdRwk0qRV0kE88UUYnJos3pEK0HNjEIVkq2PAT
31
31
  boto3_assist/dynamodb/troubleshooting.md,sha256=uGpBaBUt_MyzjzwFOLOe0udTgcvaOpiTFxfj7ilLNkM,136
32
32
  boto3_assist/ec2/ec2_connection.py,sha256=IrtaidH6_SF5l3OeNehRsTlC-sX7EURVqcO-U6P6ff8,1318
33
33
  boto3_assist/environment_services/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
34
- boto3_assist/environment_services/environment_loader.py,sha256=zCA4mRdVWMLKzjDRvrJbhQfRVP4HAMGpuQFi07zzULk,3396
34
+ boto3_assist/environment_services/environment_loader.py,sha256=1uVLqSPQriUWazGXpxPJBLveGL8rLZaT5ZsciqqjVek,3979
35
35
  boto3_assist/environment_services/environment_variables.py,sha256=4ccBKdPt6O7hcRT3zBHd8vqu8yQU8udmoD5RLAT3iMs,6801
36
36
  boto3_assist/errors/custom_exceptions.py,sha256=zC2V2Y4PUtKj3uLPn8mB-JessksKWJWvKM9kp1dmvt8,760
37
37
  boto3_assist/models/serializable_model.py,sha256=ZMrRJRvJWLY8PBSKK_nPCgYKv1qUxDPEVdcADKbIHsI,266
@@ -50,8 +50,8 @@ boto3_assist/utilities/logging_utility.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5N
50
50
  boto3_assist/utilities/numbers_utility.py,sha256=EjCnQhSbD5TRnuReKBD_GQyynp7Wit5M2bSfOfQGJBU,10051
51
51
  boto3_assist/utilities/serialization_utility.py,sha256=DxVtJ8OPc25LagZxShH4cnXSmrwE8cVUGNTEIkj6stU,17050
52
52
  boto3_assist/utilities/string_utility.py,sha256=5BpDaqGZI8cSM-3YFQLU1fKcWcqG9r1_GPgDstCWFIs,10318
53
- boto3_assist-0.9.0.dist-info/METADATA,sha256=KO3sYgvY4zZZlZ4KWibjx_YAkEHCzROJDpRiX31iVWI,1728
54
- boto3_assist-0.9.0.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
55
- boto3_assist-0.9.0.dist-info/licenses/LICENSE-EXPLAINED.txt,sha256=WFREvTpfTjPjDHpOLADxJpCKpIla3Ht87RUUGii4ODU,606
56
- boto3_assist-0.9.0.dist-info/licenses/LICENSE.txt,sha256=PXDhFWS5L5aOTkVhNvoitHKbAkgxqMI2uUPQyrnXGiI,1105
57
- boto3_assist-0.9.0.dist-info/RECORD,,
53
+ boto3_assist-0.9.1.dist-info/METADATA,sha256=XBcXFjiU5ZtkYWMfSWiDGALH2G5ZqOAm-tSKULSTJ1k,1728
54
+ boto3_assist-0.9.1.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
55
+ boto3_assist-0.9.1.dist-info/licenses/LICENSE-EXPLAINED.txt,sha256=WFREvTpfTjPjDHpOLADxJpCKpIla3Ht87RUUGii4ODU,606
56
+ boto3_assist-0.9.1.dist-info/licenses/LICENSE.txt,sha256=PXDhFWS5L5aOTkVhNvoitHKbAkgxqMI2uUPQyrnXGiI,1105
57
+ boto3_assist-0.9.1.dist-info/RECORD,,