Read a file line by line from S3 using boto?

前端 未结 10 1029
刺人心
刺人心 2020-11-29 07:32

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

10条回答
  •  渐次进展
    2020-11-29 08:05

    I know it's a very old question.

    But as for now, we can just use s3_conn.get_object(Bucket=bucket, Key=key)['Body'].iter_lines()

提交回复
热议问题