Instantly share code, notes, and snippets.

What would you like to do?
Simple script to download Phoenix data from the Amazon S3 bucket to a local directory.
import os
from boto.s3.connection import S3Connection
conn = S3Connection('<aws access key>', '<aws secret key>')
mybucket = conn.get_bucket('oeda')
# Need to modify this line to make sure the directory is correct
directory = 'phox/'
for k in mybucket.list():
key = k.key
if 'current' in key:
sub_key = key.replace('data/current/', '')
dl_path = os.path.join(directory, sub_key)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment