1boto3 offers a resource model that makes tasks like iterating through objects easier. Unfortunately, StreamingBody doesn't provide readline or readlines.
2
3s3 = boto3.resource('s3')
4bucket = s3.Bucket('test-bucket')
5# Iterates through all the objects, doing the pagination for you. Each obj
6# is an ObjectSummary, so it doesn't contain the body. You'll need to call
7# get to get the whole body.
8for obj in bucket.objects.all():
9 key = obj.key
10 body = obj.get()['Body'].read()