s365b.core.zipstream ==================== .. py:module:: s365b.core.zipstream .. autoapi-nested-parse:: Write a ZIP archive as a stream, for downloads of many files. The archive is produced while it is sent: nothing is held in memory but the piece being written, so a download of thousands of messages starts at once. Python's :mod:`zipfile` writes to a stream it cannot seek by putting each file's sizes after its data (ZIP64 where needed). Attributes ---------- .. autoapisummary:: s365b.core.zipstream.CHUNK Functions --------- .. autoapisummary:: s365b.core.zipstream.zip_stream Module Contents --------------- .. py:data:: CHUNK :value: 1048576 .. py:function:: zip_stream(files: collections.abc.Iterable[s365b.modules.sdk.ExportFile], when: datetime.datetime) -> collections.abc.AsyncIterator[bytes] :async: Yield a ZIP archive of files, compressed, as it is written. :param files: The files; their paths use ``/`` between folders. :param when: Modification time recorded for every file. :Yields: Pieces of the archive.