I have a csv file in S3 and I'm trying to read the header line to get the size (these files are created by our users so they could be almost any size). Is there a way to do this using boto? I thought maybe I could us a python BufferedReader, but I can't figure out how to open a stream from an S3 key. Any suggestions would be great. Thanks!
You may find https://pypi.python.org/pypi/smart_open useful for your task.
From documentation:
for line in smart_open.smart_open('s3://mybucket/mykey.txt'):
print line