I am trying to use a third-party utility that processes data from an iterable object e.g. a queue or a file. I need to push a bunch of AWS S3 files though this utility. Each one is a text file containing JSON messages, one complete message per line.
One approach would be to make a local copy of each file using key.get_contents_to_filename()
, then open the local file for reading and pass the file object to the utility, then delete the local copy when done. But I am trying to avoid downloading files locally and prefer instead to read directly from S3. Is it possible to create an iterable object from an S3 key directly?