【发布时间】:2020-01-12 14:36:10
【问题描述】:
我想根据文件的上次修改日期从特定的 s3 存储桶下载文件。
我研究了如何连接boto3,并且有大量的代码和文档可用于无条件下载文件。我做了一个伪代码
def download_file_s3(bucket_name,modified_date)
# connect to reseource s3
s3 = boto3.resource('s3',aws_access_key_id='demo', aws_secret_access_key='demo')
# connect to the desired bucket
my_bucket = s3.Bucket(bucket_name)
# Get files
for file in my_bucket.objects.all():
我想完成这个函数,基本上,传递一个修改日期,该函数返回 s3 存储桶中该特定修改日期的文件。
【问题讨论】:
标签: python-3.x amazon-s3 boto3