Created
January 15, 2014 20:15
-
-
Save cmwright/8443668 to your computer and use it in GitHub Desktop.
Searching for s3 keys
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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