boto3-assist 0.9.1__py3-none-any.whl → 0.9.3__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.
@@ -0,0 +1,4 @@
1
+ from aws_lambda_powertools.utilities.typing import LambdaContext
2
+
3
+
4
+ class MockLambdaContext(LambdaContext)
@@ -193,6 +193,12 @@ class S3Object:
193
193
 
194
194
  return response
195
195
 
196
+ def put(self, *, bucket: str, key: str, data: bytes | str) -> str:
197
+ """
198
+ Uploads a file object to s3. Returns the full s3 path s3://<bucket>/<key>
199
+ """
200
+ return self.upload_file_obj(bucket=bucket, key=key, file_obj=data)
201
+
196
202
  def upload_file_obj(self, *, bucket: str, key: str, file_obj: bytes | str) -> str:
197
203
  """
198
204
  Uploads a file object to s3. Returns the full s3 path s3://<bucket>/<key>
@@ -414,6 +420,19 @@ class S3Object:
414
420
  The "Body" is a streaming body object. You can read it like a file.
415
421
  For example:
416
422
 
423
+ with response["Body"] as f:
424
+ data = f.read()
425
+ print(data)
426
+
427
+ """
428
+ return self.get_object(bucket_name=bucket_name, key=key)
429
+
430
+ def get_object(self, bucket_name: str, key: str) -> Dict[str, Any]:
431
+ """
432
+ Gets a file from s3 and returns the response.
433
+ The "Body" is a streaming body object. You can read it like a file.
434
+ For example:
435
+
417
436
  with response["Body"] as f:
418
437
  data = f.read()
419
438
  print(data)
@@ -275,6 +275,9 @@ class Serialization:
275
275
  if coerce:
276
276
  # Attempt to coerce the value to the expected type
277
277
  try:
278
+ if isinstance(value, list) and expected_type is str:
279
+ value = "".join(value)
280
+
278
281
  value = expected_type(value)
279
282
  except ValueError as e:
280
283
  logger.warning(
boto3_assist/version.py CHANGED
@@ -1 +1 @@
1
- __version__ = '0.9.1'
1
+ __version__ = '0.9.3'
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: boto3_assist
3
- Version: 0.9.1
3
+ Version: 0.9.3
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,8 +3,9 @@ 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=pF8TnH2QJF8nfDmcD7oPTrAOnioy05dV4YmYDzkT5Es,22
6
+ boto3_assist/version.py,sha256=83oJ8nCWXwQbno1uqIRolJfmli7BtUNqtuSvnzeSyxg,22
7
7
  boto3_assist/aws_lambda/event_info.py,sha256=OkZ4WzuGaHEu_T8sB188KBgShAJhZpWASALKRGBOhMg,14648
8
+ boto3_assist/aws_lambda/mock_context.py,sha256=kLLwt46a2ZrGF8jEmBWDFrH9sFavZSrB4k7EZZK2hs8,105
8
9
  boto3_assist/cloudwatch/cloudwatch_connection.py,sha256=mnGWaLSQpHh5EeY7Ek_2o9JKHJxOELIYtQVMX1IaHn4,2480
9
10
  boto3_assist/cloudwatch/cloudwatch_connection_tracker.py,sha256=mzRtO1uHrcfJNh1XrGEiXdTqxwEP8d1RqJkraMNkgK0,410
10
11
  boto3_assist/cloudwatch/cloudwatch_log_connection.py,sha256=qQMZHjUJ6gA8wU9utjQhOURXNSPH2RjxSoAy83bvoCs,1737
@@ -39,7 +40,7 @@ boto3_assist/s3/s3.py,sha256=ESTPXtyDi8mrwHaYNWjQLNGTuTUV4CxKDqw-O_KGzKs,2052
39
40
  boto3_assist/s3/s3_bucket.py,sha256=GfyBbuI5BWz_ybwU_nDqUZiC0wt24PNt49GKZmb05OY,2018
40
41
  boto3_assist/s3/s3_connection.py,sha256=0JgEDNoDFPQTo5hQe-lS8mWnFBJ2S8MDSl0LPG__lZo,2008
41
42
  boto3_assist/s3/s3_event_data.py,sha256=vwty34zDgTeSLNCLAWVxvhSQKT7hIpM7fZrWm5w6znM,4063
42
- boto3_assist/s3/s3_object.py,sha256=8diOon_TbH0BWpVNM84grDgXOmXq5C41N8wDa6E2B8c,21319
43
+ boto3_assist/s3/s3_object.py,sha256=iPcdTByhVJJCadfoS2S6o-aTexULIWvaD7hYo5aHjNs,21976
43
44
  boto3_assist/securityhub/securityhub.py,sha256=nGmHd_R3awDeB_QRzPfNAtQauLdVA1hlRlkaZA4oZjg,5409
44
45
  boto3_assist/securityhub/securityhub_connection.py,sha256=hWfcj9gjS2lNXUObyw4cShtveoqJPIp8kKFuz-fz1J4,1449
45
46
  boto3_assist/utilities/datetime_utility.py,sha256=dgAMB9VqakrYIPXlSoVQiLSsc_yhrJK4gMfJO9mX90w,11112
@@ -48,10 +49,10 @@ boto3_assist/utilities/file_operations.py,sha256=Zy8fu8fpuVNf7U9NimrLdy5FRF71XSI
48
49
  boto3_assist/utilities/http_utility.py,sha256=koFv7Va-8ng-47Nt1K2Sh7Ti95e62IYs9VMLlGh9Kt4,1173
49
50
  boto3_assist/utilities/logging_utility.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
50
51
  boto3_assist/utilities/numbers_utility.py,sha256=EjCnQhSbD5TRnuReKBD_GQyynp7Wit5M2bSfOfQGJBU,10051
51
- boto3_assist/utilities/serialization_utility.py,sha256=DxVtJ8OPc25LagZxShH4cnXSmrwE8cVUGNTEIkj6stU,17050
52
+ boto3_assist/utilities/serialization_utility.py,sha256=oS-tVGfP0fPq6FD5RE09DuNUB6tqR76QmthJTDERJRE,17203
52
53
  boto3_assist/utilities/string_utility.py,sha256=5BpDaqGZI8cSM-3YFQLU1fKcWcqG9r1_GPgDstCWFIs,10318
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,,
54
+ boto3_assist-0.9.3.dist-info/METADATA,sha256=i9GglORO_pF5m48S9MznyLtqyk6w9WFPT65FlPYDUN8,1728
55
+ boto3_assist-0.9.3.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
56
+ boto3_assist-0.9.3.dist-info/licenses/LICENSE-EXPLAINED.txt,sha256=WFREvTpfTjPjDHpOLADxJpCKpIla3Ht87RUUGii4ODU,606
57
+ boto3_assist-0.9.3.dist-info/licenses/LICENSE.txt,sha256=PXDhFWS5L5aOTkVhNvoitHKbAkgxqMI2uUPQyrnXGiI,1105
58
+ boto3_assist-0.9.3.dist-info/RECORD,,