Created
June 12, 2017 15:36
-
-
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.
This file contains hidden or 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
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