I'm trying to download a zip file via ftp, but then extract the files inside without ever actually saving the zip. Any idea how I do this?
The ftplib
module allows downloading files via FTP.
The zipfile
module allows extracting files from a zip file.
Here's the key, the io.BytesIO
class allows you to pass in-memory bytes to anything that expects a file. (In Python 2.x, the StringIO
module provides similar functionality.)