0
使用boto3我有一个few csv files inside
我buckets on amazon s3.
下载最新上传的文件S3在python
我需要download the latest uploaded csv file.
如何使用boto3 in python??
由于实现这一目标。
使用boto3我有一个few csv files inside
我buckets on amazon s3.
下载最新上传的文件S3在python
我需要download the latest uploaded csv file.
如何使用boto3 in python??
由于实现这一目标。
S3没有列出按日期排列的文件的API 但是,如果确实只有少数几个,则可以列出存储区中的文件并按上次修改时间排序。
bucketList = s3Client.list_objects(Bucket=<MyBucket>) # notice this is up to 1000 files
orderedList = sorted(bucketList, key=lambda k: k.last_modified)
lastUpdatedKey = orderedList[-1]
object = s3Client.get_object(Bucket=<MyBucket>, Key=lastUpdatedKey)
注意我在https://stackoverflow.com/questions/7969653/s3-boto-list-files-within-a-bucket-by-upload-time中引用了答案。 –