module documentation

_ziputil.py - ZMS ZIP Utility for Exporting and Importing ZODB Objects

This module provides utility functions for exporting ZODB objects to ZIP archives and importing ZIP archives into the ZODB.

License: GNU General Public License v2 or later, Organization: ZMS Publishing

Function exportZodb2Zip Export ZODB objects from root container to a ZIP archive.
Function importZip2Zodb Extract and import a ZIP archive into the ZODB.
Function _exportZodb2Zip Recursively export ZODB objects (Images/Files) from a container into a ZIP file.
def exportZodb2Zip(root): (source)

Export ZODB objects from root container to a ZIP archive.

Parameters
root:OFS.ObjectManagerRoot container to export
Returns
bytesZIP archive data
def importZip2Zodb(root, data): (source)

Extract and import a ZIP archive into the ZODB.

Creates Folder, Image, and File objects in the ZODB hierarchy matching the ZIP archive structure.

Parameters
root:OFS.ObjectManagerRoot container to import into
data:bytes or str or io.BytesIOZIP archive data
def _exportZodb2Zip(zf, root, container): (source)

Recursively export ZODB objects (Images/Files) from a container into a ZIP file.

Parameters
zf:zipfile.ZipFileOpen ZIP file object to write to
root:OFS.ObjectManagerRoot container for calculating relative archive paths
container:OFS.ObjectManagerContainer whose child objects are exported