awsimple 3.3.0__py3-none-any.whl → 3.5.0__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.

Potentially problematic release.


This version of awsimple might be problematic. Click here for more details.

awsimple/__version__.py CHANGED
@@ -1,7 +1,7 @@
1
1
  __application_name__ = "awsimple"
2
2
  __title__ = __application_name__
3
3
  __author__ = "abel"
4
- __version__ = "3.3.0"
4
+ __version__ = "3.5.0"
5
5
  __author_email__ = "j@abel.co"
6
6
  __url__ = "https://github.com/jamesabel/awsimple"
7
7
  __download_url__ = "https://github.com/jamesabel/awsimple"
awsimple/dynamodb.py CHANGED
@@ -180,6 +180,8 @@ def dict_to_dynamodb(input_value: Any, convert_images: bool = True, raise_except
180
180
  resp = image_byte_array.getvalue()
181
181
  elif isinstance(input_value, datetime.datetime):
182
182
  resp = input_value.isoformat()
183
+ elif isinstance(input_value, Path):
184
+ resp = input_value.as_posix()
183
185
  else:
184
186
  if raise_exception:
185
187
  raise NotImplementedError(type(input_value), input_value)
awsimple/s3.py CHANGED
@@ -18,7 +18,6 @@ from botocore.client import Config
18
18
  from botocore.exceptions import ClientError, EndpointConnectionError, ConnectionClosedError, SSLError
19
19
  from boto3.s3.transfer import TransferConfig
20
20
  from s3transfer import S3UploadFailedError
21
- import urllib3
22
21
  import urllib3.exceptions
23
22
  from typeguard import typechecked
24
23
  from hashy import get_string_sha512, get_file_sha512, get_bytes_sha512, get_dls_sha512 # type: ignore
@@ -33,6 +32,8 @@ json_extension = ".json"
33
32
 
34
33
  log = getLogger(__application_name__)
35
34
 
35
+ connection_errors = (S3UploadFailedError, ClientError, EndpointConnectionError, SSLError, urllib3.exceptions.ProtocolError, ConnectionClosedError)
36
+
36
37
 
37
38
  class BucketNotFound(AWSimpleException):
38
39
  def __init__(self, bucket_name):
@@ -232,7 +233,7 @@ class S3Access(CacheAccess):
232
233
  try:
233
234
  self.client.upload_file(str(file_path), self.bucket_name, s3_key, ExtraArgs=extra_args, Config=self.get_s3_transfer_config())
234
235
  uploaded_flag = True
235
- except (S3UploadFailedError, ClientError, EndpointConnectionError, SSLError, urllib3.exceptions.ProtocolError) as e:
236
+ except connection_errors as e:
236
237
  log.warning(f"{file_path} to {self.bucket_name}:{s3_key} : {transfer_retry_count=} : {e}")
237
238
  time.sleep(self.retry_sleep_time)
238
239
  except RuntimeError as e:
@@ -284,7 +285,7 @@ class S3Access(CacheAccess):
284
285
  else:
285
286
  s3_object.put(Body=json_as_bytes, Metadata=meta_data)
286
287
  uploaded_flag = True
287
- except (S3UploadFailedError, ClientError, EndpointConnectionError, SSLError, urllib3.exceptions.ProtocolError) as e:
288
+ except connection_errors as e:
288
289
  log.warning(f"{self.bucket_name}:{s3_key} : {transfer_retry_count=} : {e}")
289
290
  transfer_retry_count += 1
290
291
  time.sleep(self.retry_sleep_time)
@@ -327,7 +328,7 @@ class S3Access(CacheAccess):
327
328
  mtime_ts = s3_object_metadata.mtime.timestamp()
328
329
  os.utime(dest_path, (mtime_ts, mtime_ts)) # set the file mtime to the mtime in S3
329
330
  success = True
330
- except (ClientError, EndpointConnectionError, SSLError, ConnectionClosedError, urllib3.exceptions.ProtocolError) as e:
331
+ except connection_errors as e:
331
332
  # ProtocolError can happen for a broken connection
332
333
  log.warning(f"{self.bucket_name}/{s3_key} to {dest_path} ({Path(dest_path).absolute()}) : {transfer_retry_count=} : {e}")
333
334
  time.sleep(self.retry_sleep_time)
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: awsimple
3
- Version: 3.3.0
3
+ Version: 3.5.0
4
4
  Summary: Simple AWS API for S3, DynamoDB, SNS, and SQS
5
5
  Home-page: https://github.com/jamesabel/awsimple
6
6
  Download-URL: https://github.com/jamesabel/awsimple
@@ -14,8 +14,8 @@ Description-Content-Type: text/markdown
14
14
  License-File: LICENSE
15
15
  License-File: LICENSE.txt
16
16
  Requires-Dist: boto3
17
- Requires-Dist: typeguard <3
18
- Requires-Dist: hashy >=0.1.1
17
+ Requires-Dist: typeguard<3
18
+ Requires-Dist: hashy>=0.1.1
19
19
  Requires-Dist: dictim
20
20
  Requires-Dist: appdirs
21
21
  Requires-Dist: tobool
@@ -1,18 +1,18 @@
1
1
  awsimple/__init__.py,sha256=8aFfqWFAvRPweoZkKncvHAW2ytTW_5-AJ0nnmYqgUBw,916
2
- awsimple/__version__.py,sha256=0gbi5EXiJgxiHJoIVHQKkGDhYpjTNPHmc_shzXZMjX4,323
2
+ awsimple/__version__.py,sha256=lvkr0XziFtstOGw6YpJrnL1ET2diD3UgBeG9D0jTGzQ,323
3
3
  awsimple/aws.py,sha256=n5Mte2l0uUyLtxHx-Cv2RdVF2H2pvNiQPlrwrwddKcc,7636
4
4
  awsimple/cache.py,sha256=tdLeMw2IYW9Y4lGT2SAGUI7u_aTX_TFQs2udXcqW6fI,7163
5
- awsimple/dynamodb.py,sha256=xVPnRdedm19ORpmC1G0fMaQMnf9D72Ebq2lXKSLgtmc,39076
5
+ awsimple/dynamodb.py,sha256=8OlGbMg7uU1rpWbkjK9HdHMSfopRBrLb3AFALGgfLHg,39156
6
6
  awsimple/dynamodb_miv.py,sha256=4xPxQDYkIM-BVDGyAre6uqwJHsxguEbHbof8ztt-V7g,4645
7
7
  awsimple/logs.py,sha256=A2RmTT90pfFTthfENd7GSsEHSIBJXO8ICHPdA7sEsHY,4278
8
8
  awsimple/mock.py,sha256=eScbnxFF9xAosOAsL-NZgp_P-fezB6StQMkb85Y3TNo,574
9
9
  awsimple/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
10
- awsimple/s3.py,sha256=lUva23v6gQHYQ7DhtogEHrhJqbs1ngrpERf2MZybgVE,24000
10
+ awsimple/s3.py,sha256=lwMS8Xr06TB2LkQ7z8yaK6pnH9oOFU3-DEI3Ba6dEwo,23874
11
11
  awsimple/sns.py,sha256=dOx3VUS04xxeG1krGudN4A5fqoIpXeHqXNkBvfbr_6Q,3292
12
12
  awsimple/sqs.py,sha256=ejV9twP15X8-mZ9IHGEUlYWqufEcasYuPf1xlGQt2a8,15506
13
- awsimple-3.3.0.dist-info/LICENSE,sha256=d956YAgtDaxgxQmccyUk__EfhORZyBjvmJ8pq6zYTxk,1093
14
- awsimple-3.3.0.dist-info/LICENSE.txt,sha256=d956YAgtDaxgxQmccyUk__EfhORZyBjvmJ8pq6zYTxk,1093
15
- awsimple-3.3.0.dist-info/METADATA,sha256=KpLtikFMJ98iwkLOANbjbW6hoHZJVnpDKAlv1TJ2DFQ,6089
16
- awsimple-3.3.0.dist-info/WHEEL,sha256=oiQVh_5PnQM0E3gPdiz09WCNmwiHDMaGer_elqB3coM,92
17
- awsimple-3.3.0.dist-info/top_level.txt,sha256=mwqCoH_8vAaK6iYioiRbasXmVCQM7AK3grNWOKp2VHE,9
18
- awsimple-3.3.0.dist-info/RECORD,,
13
+ awsimple-3.5.0.dist-info/LICENSE,sha256=d956YAgtDaxgxQmccyUk__EfhORZyBjvmJ8pq6zYTxk,1093
14
+ awsimple-3.5.0.dist-info/LICENSE.txt,sha256=d956YAgtDaxgxQmccyUk__EfhORZyBjvmJ8pq6zYTxk,1093
15
+ awsimple-3.5.0.dist-info/METADATA,sha256=LyAC6YLIzErBg7QqjFG7VgAkXQ6An3JjVWdD7P5DSas,6087
16
+ awsimple-3.5.0.dist-info/WHEEL,sha256=cVxcB9AmuTcXqmwrtPhNK88dr7IR_b6qagTj0UvIEbY,91
17
+ awsimple-3.5.0.dist-info/top_level.txt,sha256=mwqCoH_8vAaK6iYioiRbasXmVCQM7AK3grNWOKp2VHE,9
18
+ awsimple-3.5.0.dist-info/RECORD,,
@@ -1,5 +1,5 @@
1
1
  Wheel-Version: 1.0
2
- Generator: bdist_wheel (0.42.0)
2
+ Generator: setuptools (74.1.2)
3
3
  Root-Is-Purelib: true
4
4
  Tag: py3-none-any
5
5