The other questions I could find were refering to an older version of Boto. I would like to download the latest file of an S3 bucket. In the documentation I found that there
You can do
import boto3 s3_client = boto3.client('s3') response = s3_client.list_objects_v2(Bucket='bucket_name', Prefix='prefix') all = response['Contents'] latest = max(all, key=lambda x: x['LastModified'])