Get S3 Object content by boto3 - Gatsby-Lee/cloud-storage GitHub Wiki
import io
import boto3
client = boto3.client('s3')
with io.BytesIO() as bytes_buffer:
client.download_fileobj(Bucket=bucket_name, Key=object_key, Fileobj=bytes_buffer)
return bytes_buffer.getvalue()