0

I can do this easily using the smart_open package:

from smart_open import open

for line in open('s3://mybucket/myfolder/myfile.csv'):
   print(line)

How to do the same using boto3?

P.S. I need to do this in a Python Shell Job in AWS Glue, without having to package smart_open and set it up as a "Python library path" in the Glue Job.

bda
  • 372
  • 1
  • 7
  • 22
  • 1
    can you try it installing through easy install as answered in https://stackoverflow.com/a/54852126/4326922 ? – Prabhakar Reddy Feb 20 '20 at 08:26
  • Thanks for the reply. Can you please provide a clear good working example? Use the smart_open package as an example. – bda Feb 21 '20 at 15:55
  • https://stackoverflow.com/questions/28618468/read-a-file-line-by-line-from-s3-using-boto – Tom Jan 17 '22 at 03:21

0 Answers0