It returns an iterable, where each yielded item is a tuple of the file name, file size, and another iterable itself yielding the unzipped bytes of that file. Installation pip install stream-unzipĪ single function is exposed, stream_unzip, that takes a single argument: an iterable that should yield the bytes of a ZIP file. ![]() To create ZIP files on the fly try stream-zip. These facts make the streaming decompression of ZIP archives possible. Also, the Deflate algorithm that most ZIP files use indicates when it has reached the end of the stream of a member file. While the ZIP format does have its main directory at the end, each compressed file in the archive is prefixed with a header that contains its name. Deflate and Deflate64/Enhanced Deflate ZIPs are supported, as well as AES and legacy (ZipCrypto/Zip 2.0) encrypted/password-protected ZIPs. Python function to stream unzip all the files in a ZIP archive, without loading the entire ZIP file into memory or any of its uncompressed files.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |