Answers for "use latest file on aws s3 bucket python"

0

use latest file on aws s3 bucket python

get_last_modified = lambda obj: int(obj['LastModified'].strftime('%s'))

s3 = boto3.client('s3')
objs = s3.list_objects_v2(Bucket='my_bucket')['Contents']
last_added = [obj['Key'] for obj in sorted(objs, key=get_last_modified)][0]
Posted by: Guest on December-05-2020

Code answers related to "use latest file on aws s3 bucket python"

Python Answers by Framework

Browse Popular Code Answers by Language