Skip to content

Instantly share code, notes, and snippets.

import boto3
import gzip
from StringIO import StringIO
def get_contents_as_string(bucket, key_prefix,
aws_access_key_id=None, aws_secret_access_key=None):
"""Gets the contents as string from a gzipped file on s3
Yeah, it's all in memory, so not a good solution for large objects.