Skip to content

Instantly share code, notes, and snippets.

@johnb30
Created June 12, 2017 15:36
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save johnb30/13dd49022cc31b763305aef593dc1192 to your computer and use it in GitHub Desktop.
Save johnb30/13dd49022cc31b763305aef593dc1192 to your computer and use it in GitHub Desktop.
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)
k.get_contents_to_filename(dl_path)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment