📌  相关文章
📜  在 aws s3 存储桶 python 代码示例上使用最新文件

📅  最后修改于: 2022-03-11 14:46:56.531000             🧑  作者: Mango

代码示例1
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]