Save directly to a zip
We could improve performance and simplify the logic if instead of building our structure we just append to a single zip file.
https://docs.python.org/3/library/zipfile.html#zipfile.ZipFile.writestr https://pymotw.com/2/zipfile/#writing-data-from-sources-other-than-files
For the single file output: https://techoverflow.net/2020/11/11/how-to-modify-file-inside-a-zip-file-using-python/