Created
March 17, 2020 18:55
-
-
Save sengstacken/4674a12894e433a99d6df246e7e657be to your computer and use it in GitHub Desktop.
Read S3 File Into Python
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
import boto3 | |
import json | |
bucket = 'blah' | |
f = 'fileblah' | |
# get file from s3, read it, convert to json | |
s3 = boto3.resource('s3') | |
content_object = s3.Object(bucket, f) | |
file_content = content_object.get()['Body'].read().decode('utf-8') | |
json_content = json.loads(file_content) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment