Skip to content

Instantly share code, notes, and snippets.

@cmwright
Created January 15, 2014 20:15
Show Gist options
  • Save cmwright/8443668 to your computer and use it in GitHub Desktop.
Save cmwright/8443668 to your computer and use it in GitHub Desktop.
Searching for s3 keys
from boto.s3.connection import S3Connection
from boto.s3.key import Key
import sys
conn = S3Connection('ACCESS_KEY_ID', 'SECRET_ACCESS_KEY')
bucket = conn.get_bucket('BUCKET')
rs = bucket.list('FOLDER')
file_search = "FILE_NAME"
for key in rs:
if file_search in str(key):
print key.name
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment