The zc.bz2storage
package provides ZODB storage wrapper
implementations that provides compression of database records.
Bz2 version gives significant improvement of the compression. Originally, tested on JSON format 368kb string which resulted: 103kb zc.zlibstorage 78kb zc.bz2storage
pip install git+https://github.com/vir2alexport/zc.bz2storage
from ZODB import FileStorage, DB
import bz2
import zc.bz2storage
import transaction
# create storage
storage = zc.bz2storage.Bz2Storage(FileStorage.FileStorage('zcdata.fs'))
# create DB that uses our storage
db = DB(storage)
# open DB connection object
connection = db.open()
# get the root access
root = connection.root()
# Now you can use root.items() to list DB
for doc in root.items():
print(doc)
-
Major revision ideas taken from jimfulton's python library
See src/bc/bz2storage/README.txt.