Last active
October 13, 2020 08:11
-
-
Save milanboers/83eba1baaf1570517328cd2520c9bccb to your computer and use it in GitHub Desktop.
Streaming read lines from S3 in Python using boto
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
s3 = boto3.client('s3') | |
obj = s3.get_object(Bucket=bucket, Key=key) | |
lines = map(lambda x: x.decode('utf-8'), obj['Body'].iter_lines()) # Iterator which yields lines in file |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment