{
"info": {
"author": "Jim Fulton",
"author_email": "jim@zope.com",
"bugtrack_url": null,
"classifiers": [
"Programming Language :: Python",
"Programming Language :: Python :: 2.7",
"Programming Language :: Python :: 3.4",
"Programming Language :: Python :: 3.5",
"Programming Language :: Python :: 3.6",
"Programming Language :: Python :: Implementation :: CPython",
"Programming Language :: Python :: Implementation :: PyPy"
],
"description": "=============================================================\nZODB storage wrapper for zlib compression of database records\n=============================================================\n\nThe ``zc.zlibstorage`` package provides ZODB storage wrapper\nimplementations that provides compression of database records.\n\n.. contents::\n\nUsage\n=====\n\nThe primary storage is ``zc.zlibstorage.ZlibStorage``. It is used as\na wrapper around a lower-level storage. From Python, it is\nconstructed by passing another storage, as in::\n\n import ZODB.FileStorage, zc.zlibstorage\n\n storage = zc.zlibstorage.ZlibStorage(\n ZODB.FileStorage.FileStorage('data.fs'))\n\n.. -> src\n\n >>> import zlib\n >>> exec(src)\n >>> data = b'x'*100\n >>> storage.transform_record_data(data) == b'.z'+zlib.compress(data)\n True\n >>> storage.close()\n\nWhen using a ZODB configuration file, the zlibstorage tag is used::\n\n %import zc.zlibstorage\n\n \n \n \n path data.fs\n \n \n \n\n.. -> src\n\n >>> import ZODB.config\n >>> db = ZODB.config.databaseFromString(src)\n >>> db.storage.transform_record_data(data) == b'.z'+zlib.compress(data)\n True\n >>> db.close()\n\nNote the ``%import`` used to load the definition of the\n``zlibstorage`` tag.\n\nUse with ZEO\n============\n\nWhen used with a ZEO ClientStorage, you'll need to use a server zlib\nstorage on the storage server. This is necessary so that server\noperations that need to get at uncompressed record data can do so.\nThis is accomplished using the ``serverzlibstorage`` tag in your ZEO\nserver configuration file::\n\n %import zc.zlibstorage\n\n \n address 8100\n \n\n \n \n path data.fs\n \n \n\n.. -> src\n\n >>> src = src[:src.find('')]+src[src.find('')+7:]\n\n >>> storage = ZODB.config.storageFromString(src)\n >>> storage.transform_record_data(data) == b'.z'+zlib.compress(data)\n True\n >>> storage.__class__.__name__\n 'ServerZlibStorage'\n\n >>> storage.close()\n\nApplying compression on the client this way is attractive because, in\naddition to reducing the size of stored database records on the\nserver, you also reduce the size of records sent from the server to the\nclient and the size of records stored in the client's ZEO cache.\n\nDecompressing only\n==================\n\nBy default, records are compressed when written to the storage and\nuncompressed when read from the storage. A ``compress`` option can be\nused to disable compression of records but still uncompress compressed\nrecords if they are encountered. Here's an example from in Python::\n\n import ZODB.FileStorage, zc.zlibstorage\n\n storage = zc.zlibstorage.ZlibStorage(\n ZODB.FileStorage.FileStorage('data.fs'),\n compress=False)\n\n.. -> src\n\n >>> exec(src)\n >>> storage.transform_record_data(data) == data\n True\n >>> storage.close()\n\nand using the configurationb syntax::\n\n %import zc.zlibstorage\n\n \n \n compress false\n \n path data.fs\n \n \n \n\n.. -> src\n\n >>> db = ZODB.config.databaseFromString(src)\n >>> db.storage.transform_record_data(data) == data\n True\n >>> db.close()\n\nThis option is useful when deploying the storage when there are\nmultiple clients. If you don't want to update all of the clients at\nonce, you can gradually update all of the clients with a zlib storage\nthat doesn't do compression, but recognizes compressed records. Then,\nin a second phase, you can update the clients to compress records, at\nwhich point, all of the clients will be able to read the compressed\nrecords produced.\n\nCompressing entire databases\n============================\n\nOne way to compress all of the records in a database is to copy data\nfrom an uncompressed database to a compressed one, as in::\n\n import ZODB.FileStorage, zc.zlibstorage\n\n orig = ZODB.FileStorage.FileStorage('data.fs')\n new = zc.zlibstorage.ZlibStorage(\n ZODB.FileStorage.FileStorage('data.fs-copy'))\n new.copyTransactionsFrom(orig)\n\n orig.close()\n new.close()\n\n.. -> src\n\n >>> conn = ZODB.connection('data.fs', create=True)\n >>> conn.root.a = conn.root().__class__([(i,i) for i in range(1000)])\n >>> conn.root.b = conn.root().__class__([(i,i) for i in range(2000)])\n >>> import transaction\n >>> transaction.commit()\n >>> conn.close()\n\n >>> exec(src)\n\n >>> new = zc.zlibstorage.ZlibStorage(\n ... ZODB.FileStorage.FileStorage('data.fs-copy'))\n >>> conn = ZODB.connection(new)\n >>> dict(conn.root.a) == dict([(i,i) for i in range(1000)])\n True\n >>> dict(conn.root.b) == dict([(i,i) for i in range(2000)])\n True\n\n >>> import ZODB.utils\n >>> for i in range(3):\n ... if not new.base.load(ZODB.utils.p64(i))[0][:2] == b'.z':\n ... print('oops {}'.format(i))\n >>> len(new)\n 3\n\n >>> conn.close()\n\nRecord prefix\n=============\n\nCompressed records have a prefix of \".z\". This allows a database to\nhave a mix of compressed and uncompressed records.\n\nStand-alone Compression and decompression functions\n===================================================\n\nIn anticipation of wanting to plug the compression and decompression\nlogic into other tools without creating storages, the functions used\nto compress and uncompress data records are available as\n``zc.zlibstorage`` module-level functions:\n\n``compress(data)``\n Compress the given data if:\n\n - it is a string more than 20 characters in length,\n - it doesn't start with the compressed-record marker, ``b'.z'``, and\n - the compressed size is less the original.\n\n The compressed (or original) data are returned.\n\n``decompress(data)``\n Decompress the data if it is compressed.\n\n The decompressed (or original) data are returned.\n\n.. basic sanity check :)\n\n >>> _ = (zc.zlibstorage.compress, zc.zlibstorage.decompress)\n\n\n\n=========\n Changes\n=========\n\n1.2.0 (2017-01-20)\n==================\n\n- Add support for Python 3.6 and PyPy.\n\n- Test with both ZODB/ZEO 4 and ZODB/ZEO 5.\n Note that ServerZlibStorage cannot be used in a ZODB 5 Connection\n (e.g., client-side, which wouldn't make sense :-]).\n (https://github.com/zopefoundation/zc.zlibstorage/issues/5).\n\n- Close the underlying iterator used by the ``iterator`` wrapper when\n it is closed. (https://github.com/zopefoundation/zc.zlibstorage/issues/4)\n\n1.1.0 (2016-08-03)\n==================\n\n- Fixed an incompatibility with ZODB5. The previously optional and\n ignored version argument to the database ``invalidate`` method is now\n disallowed.\n\n- Drop Python 2.6, 3.2, and 3.3 support. Added Python 3.4 and 3.5 support.\n\n1.0.0 (2015-11-11)\n==================\n\n- Python 3 support contributed by Christian Tismer.\n\n0.1.1 (2010-05-26)\n==================\n\n- Fixed a packaging bug.\n\n0.1.0 (2010-05-20)\n==================\n\nInitial release\n",
"description_content_type": null,
"docs_url": null,
"download_url": "",
"downloads": {
"last_day": -1,
"last_month": -1,
"last_week": -1
},
"home_page": "",
"keywords": "",
"license": "ZPL 2.1",
"maintainer": "",
"maintainer_email": "",
"name": "zc.zlibstorage",
"package_url": "https://pypi.org/project/zc.zlibstorage/",
"platform": "",
"project_url": "https://pypi.org/project/zc.zlibstorage/",
"project_urls": null,
"release_url": "https://pypi.org/project/zc.zlibstorage/1.2.0/",
"requires_dist": null,
"requires_python": "",
"summary": "ZODB storage wrapper for zlib compression of database records",
"version": "1.2.0"
},
"last_serial": 2588001,
"releases": {
"0.1.0": [
{
"comment_text": "",
"digests": {
"md5": "9e990e63dc7fa82d246948bdd5141704",
"sha256": "8faf12e8c3857b330fcc00a48b1b0712ecb1cb09162fd9872f369197cf9430dc"
},
"downloads": -1,
"filename": "zc.zlibstorage-0.1.0.tar.gz",
"has_sig": false,
"md5_digest": "9e990e63dc7fa82d246948bdd5141704",
"packagetype": "sdist",
"python_version": "source",
"requires_python": null,
"size": 8428,
"upload_time": "2010-05-20T21:45:25",
"url": "https://files.pythonhosted.org/packages/7c/b0/45974b1988ce7ebc67ebbb0190b65b86ab166695edaebc910b1a9c385dc0/zc.zlibstorage-0.1.0.tar.gz"
}
],
"0.1.1": [
{
"comment_text": "",
"digests": {
"md5": "f336d8b3376cc590acf421e80d17b1f5",
"sha256": "0233051718e085433e4ba2967dd8204dc0c2b9ea3c479372d00763a4974b081d"
},
"downloads": -1,
"filename": "zc.zlibstorage-0.1.1.tar.gz",
"has_sig": false,
"md5_digest": "f336d8b3376cc590acf421e80d17b1f5",
"packagetype": "sdist",
"python_version": "source",
"requires_python": null,
"size": 8839,
"upload_time": "2010-05-26T20:57:00",
"url": "https://files.pythonhosted.org/packages/62/fd/b2a57892123ba5f1b14352af1f2878a53a9937c3993ce14afef740ff6890/zc.zlibstorage-0.1.1.tar.gz"
}
],
"1.0.0": [
{
"comment_text": "",
"digests": {
"md5": "5f85a39c5590c953a91923b70a4f5971",
"sha256": "520a60bfcca151eefa32ffc88b99254545dbe76c0c3b1ec08c59b22d16f1c327"
},
"downloads": -1,
"filename": "zc.zlibstorage-1.0.0.tar.gz",
"has_sig": false,
"md5_digest": "5f85a39c5590c953a91923b70a4f5971",
"packagetype": "sdist",
"python_version": "source",
"requires_python": null,
"size": 12092,
"upload_time": "2015-11-11T22:52:13",
"url": "https://files.pythonhosted.org/packages/6e/e0/824149cdfccd571359f2e0331ad74abc0728e65b175098485ec4ff3a82e1/zc.zlibstorage-1.0.0.tar.gz"
}
],
"1.1.0": [
{
"comment_text": "",
"digests": {
"md5": "50155370f230462c5ab739bc3628ebf8",
"sha256": "f1bd17668109a5c71d288e19a775ae8413a528884b452d1f9824dc746f02a215"
},
"downloads": -1,
"filename": "zc.zlibstorage-1.1.0.tar.gz",
"has_sig": false,
"md5_digest": "50155370f230462c5ab739bc3628ebf8",
"packagetype": "sdist",
"python_version": "source",
"requires_python": null,
"size": 12336,
"upload_time": "2016-08-03T14:06:58",
"url": "https://files.pythonhosted.org/packages/62/1e/408070cddde08403b1db59f070b0484e9d7a5b25839ff10577b13aedf64a/zc.zlibstorage-1.1.0.tar.gz"
}
],
"1.2.0": [
{
"comment_text": "",
"digests": {
"md5": "3c0b18b4341ff77a5346cfb367caad17",
"sha256": "629003bf86da4e4b9bc3cac6487bf4bd476c0cb15a3b85c3b4037215288de6aa"
},
"downloads": -1,
"filename": "zc.zlibstorage-1.2.0.tar.gz",
"has_sig": false,
"md5_digest": "3c0b18b4341ff77a5346cfb367caad17",
"packagetype": "sdist",
"python_version": "source",
"requires_python": null,
"size": 13923,
"upload_time": "2017-01-20T16:41:36",
"url": "https://files.pythonhosted.org/packages/03/9d/1895d5c881336f7fe7312c1eef92b9700e2a8e39fb6ce7be299ff0d93217/zc.zlibstorage-1.2.0.tar.gz"
}
]
},
"urls": [
{
"comment_text": "",
"digests": {
"md5": "3c0b18b4341ff77a5346cfb367caad17",
"sha256": "629003bf86da4e4b9bc3cac6487bf4bd476c0cb15a3b85c3b4037215288de6aa"
},
"downloads": -1,
"filename": "zc.zlibstorage-1.2.0.tar.gz",
"has_sig": false,
"md5_digest": "3c0b18b4341ff77a5346cfb367caad17",
"packagetype": "sdist",
"python_version": "source",
"requires_python": null,
"size": 13923,
"upload_time": "2017-01-20T16:41:36",
"url": "https://files.pythonhosted.org/packages/03/9d/1895d5c881336f7fe7312c1eef92b9700e2a8e39fb6ce7be299ff0d93217/zc.zlibstorage-1.2.0.tar.gz"
}
]
}