Skip to content

Instantly share code, notes, and snippets.

@morganmcg1
Created May 9, 2021 10:42
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 morganmcg1/eef76dbe7e9b6d1118967507333f7acb to your computer and use it in GitHub Desktop.
Save morganmcg1/eef76dbe7e9b6d1118967507333f7acb to your computer and use it in GitHub Desktop.
Download S3
import boto3
import os
import pickle
my_bucket = "prosecraft-manuscript-archives"
my_file = "manuscript-samples-2021-05-06.zip"
s3 = boto3.resource('s3')
obj = s3.Object(my_bucket, my_file)
body = obj.get()['Body'].read()
samples_file = open('samples.zip', 'wb')
pickle.dump(body, samples_file)
!unzip samples.zip
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment