I have a zip file on S3 and I need to get a single file from the zip. I would like to avoid downloading the whole ZIP, I don't know what size the ZIP may have and I only need a small file from that ZIP. I want to do this with a Lambda function (it can be nodejs or python).
Asked
Active
Viewed 66 times
0

John Rotenstein
- 241,921
- 22
- 380
- 470

CC.
- 2,736
- 11
- 53
- 70
-
1are you looking for this https://stackoverflow.com/questions/17729703/how-to-extract-file-from-zip-without-maintaining-directory-structure-in-python? โ Youcef LAIDANI Feb 09 '23 at 09:20
-
Hmm, could be, but not sure if it works with the ZIP being on S3. โ CC. Feb 09 '23 at 09:21
-
1You might be able to use [smart-open ยท PyPI](https://pypi.org/project/smart-open/), which knows how to talk to S3 and understands zip files. โ John Rotenstein Feb 09 '23 at 21:51