Solving retrieve objects from Amazon S3 using boto get_all_keys() and get limited results


When you have more than 1000 objects in S3, you will realize that get_all_keys() doesn’t give you all objects you have.
This is because get_all_keys() have limitation. To fetch / retrieve all objects, please using list().

For example :

1
2
3
4
s3 = boto.connect_s3()
bucket = s3.get_bucket(‘your-bucket-name’)
for obj in bucket.list():
    print obj.name

Now you can retrieve all objects in S3.


Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.