Jure Cuhalev

20 Mar, 2008

Listing all keys in S3 bucket using python boto

Posted by: Jure Cuhalev In: Planet Kiberpipa|Planet LiveCD|python|Tech

Source: FlickrWhen using python-boto package to list keys in your S3 bucket, you might hit a limit of 1000 keys when using function call bucket.get_all_keys(). In order to get full list of keys just do something along the lines of

keylist = [k for k in self.bucket]

since as it turns out, bucket has an iterator over key name.

(Discovered through patch of Mitchell Garnaat to Duplicity project).

Related posts:

  1. MSN Live Search python API access
  2. Python MySpace API proxy
  3. Posting to Koornk using Python
  4. Python SMTP sink server
  5. Seeing lots of Wikipedia in your Google searches?

No Responses to "Listing all keys in S3 bucket using python boto"

Comments are closed.