{ "info": { "author": "Dusan Klinec (ph4r05)", "author_email": "dusan.klinec@gmail.com", "bugtrack_url": null, "classifiers": [ "Development Status :: 5 - Production/Stable", "Intended Audience :: Developers", "License :: OSI Approved :: Apache Software License", "Programming Language :: C", "Programming Language :: Python", "Programming Language :: Python :: 2.7", "Programming Language :: Python :: 3.2", "Programming Language :: Python :: 3.3", "Programming Language :: Python :: 3.4", "Programming Language :: Python :: 3.5", "Programming Language :: Python :: 3.6", "Topic :: Software Development :: Libraries", "Topic :: Software Development :: Libraries :: Python Modules" ], "description": "Overview\n========\n\nThis is an `LZ4 `__-frame compression library for Python\nv3.2+ (and 2.7+), bound to Yann Collet's `LZ4 C\nimplementation `__.\n\nInstalling / packaging\n======================\n\n.. code:: shell\n\n # To get from PyPI\n pip3 install py-lz4framed_ph4\n\n # To only build extension modules inline (e.g. in repository)\n python3 setup.py build_ext -i\n\n # To build & install globally\n python3 setup.py install\n\n # To install locally with pip\n pip install --upgrade --find-links=. .\n\n**Notes**\n\n- The above as well as all other python3-using commands should also run\n with v2.7+\n- This fork is based on https://github.com/Iotic-Labs/py-lz4framed\n\nImprovements\n============\n\nThis fork has several improvements I needed for my other project.\n\n- Streamed decompression continuation (on reconnect)\n- Streamed decompression state clone - checkpointing\n- Streamed decompression marshalling - failure recovery, checkpointing\n\nMore on improvements\n--------------------\n\nThe scenario improvements address is downloading & decompressing large\nLZ4 data stream on the fly (hundreds of GBs). If the download stream is\ninterrupted the original decompressor had no way to resume the\ndecompression where it stopped.\n\nContinuation\n------------\n\nThe main motivation is to recover from aforementioned interruptions.\nDecompressor object now supports changing of the file-like object that\nis read from. If input socket stream went down we can re-connect and\ncontinue from the position it stopped. More in test\n``test_decompressor_fp_continuation``.\n\nState cloning\n-------------\n\nIf the processing logic is more complex you can use\n``clone_decompression_context`` to clone decompressor context (the whole\ndecompression state) and revert to this checkpoint if something breaks.\nMore in test ``test_decompressor_fp_clone``.\n\nState marshalling\n-----------------\n\nIn order to recover also from program crashes you can marshal /\nserialize the decompressor context to the (byte) string which can be\nlater unmarshalled / deserialized and continue from that point.\nMarshalled state can be stored e.g., to a file. More in test\n``test_decompressor_fp_marshalling``.\n\nRandom access archive\n---------------------\n\nSituation: 800 GB LZ4 encrypted file. You want random access the file so\nit can be map/reduced or processed in parallel from different offsets.\n\nMarshalled decompressor state takes only the required amount of memory.\nIf the state dump is performed on the block boundaries (i.e., when the\nsize hint from the previous call was provided by the input stream) the\nmarhsalled size would be only 184 B, in the best case scenario, 66 kB in\nthe worse case - when LZ4 file is using linked mode.\n\nAnyway, when state marshalling returns this small state the application\ncan build a meta file, the mapping: position in the input stream ->\ndecompressor context. With this meta file a new decompressor can jump to\nthe particular checkpoint.\n\nUsage\n=====\n\nSingle-function operation:\n\n.. code:: python\n\n import lz4framed\n\n compressed = lz4framed.compress(b'binary data')\n\n uncompressed = lz4framed.decompress(compressed)\n\nTo iteratively compress (to a file or e.g. BytesIO instance):\n\n.. code:: python\n\n with open('myFile', 'wb') as f:\n # Context automatically finalises frame on completion, unless an exception occurs\n with Compressor(f) as c:\n try:\n while (...):\n c.update(moreData)\n except Lz4FramedNoDataError:\n pass\n\nTo decompress from a file-like object:\n\n.. code:: python\n\n with open('myFile', 'rb') as f:\n try:\n for chunk in Decompressor(f):\n decoded.append(chunk)\n except Lz4FramedNoDataError:\n # Compress frame data incomplete - error case\n ...\n\nSee also `lz4framed/\\_\\_main\\_\\_.py `__ for\nexample usage.\n\nDocumentation\n=============\n\n.. code:: python\n\n import lz4framed\n print(lz4framed.__version__, lz4framed.LZ4_VERSION, lz4framed.LZ4F_VERSION)\n help(lz4framed)\n\nCommand-line utility\n====================\n\n.. code:: shell\n\n python3 -mlz4framed\n USAGE: lz4framed (compress|decompress) (INFILE|-) [OUTFILE]\n\n (De)compresses an lz4 frame. Input is read from INFILE unless set to '-', in\n which case stdin is used. If OUTFILE is not specified, output goes to stdout.\n\nTests\n=====\n\nStatic\n------\n\nThis library has been checked using\n`flake8 `__ and\n`pylint `__, using a modified configuration - see\n*pylint.rc* and *flake8.cfg*.\n\nUnit\n----\n\n.. code:: shell\n\n python3 -m unittest discover -v .\n\nWhy?\n====\n\nThe only existing lz4-frame interoperable implementation I was aware of\nat the time of writing\n(`lz4tools `__) had the following\nlimitations:\n\n- Incomplete implementation in terms of e.g. reference & memory leaks\n on failure\n- Lack of unit tests\n- Not thread safe\n- Does not release GIL during low level (de)compression operations\n- Did not address the requirements for an external project\n\nFurther reading\n===============\n\n- https://github.com/lz4/lz4/wiki/lz4\\_Frame\\_format.md\n- https://github.com/lz4/lz4/wiki/lz4\\_Block\\_format.md\n- https://ticki.github.io/blog/how-lz4-works/\n- https://fastcompression.blogspot.cz/2011/05/lz4-explained.html", "description_content_type": null, "docs_url": null, "download_url": "UNKNOWN", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/ph4r05/py-lz4framed", "keywords": "lz4framed,lz4frame,lz4", "license": "Apache License 2.0", "maintainer": null, "maintainer_email": null, "name": "py-lz4framed_ph4", "package_url": "https://pypi.org/project/py-lz4framed_ph4/", "platform": "UNKNOWN", "project_url": "https://pypi.org/project/py-lz4framed_ph4/", "project_urls": { "Download": "UNKNOWN", "Homepage": "https://github.com/ph4r05/py-lz4framed" }, "release_url": "https://pypi.org/project/py-lz4framed_ph4/0.9.11/", "requires_dist": null, "requires_python": null, "summary": "LZ4Frame library for Python (via C bindings)", "version": "0.9.11" }, "last_serial": 2797154, "releases": { "0.9.10": [ { "comment_text": "", "digests": { "md5": "893c661fa3ecc48a0e3e86c4db54b03c", "sha256": "37d8571045ae64b73a0521a7e135c96031431c2ab4e61e30536f21a6c6c70c4a" }, "downloads": -1, "filename": "py-lz4framed_ph4-0.9.10.tar.gz", "has_sig": false, "md5_digest": "893c661fa3ecc48a0e3e86c4db54b03c", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 89227, "upload_time": "2017-04-03T23:10:54", "url": "https://files.pythonhosted.org/packages/af/ab/db688f7146c70d9ade2aadbf4834bf94eb525be3a7446ac3f1a8d3bca7e4/py-lz4framed_ph4-0.9.10.tar.gz" } ], "0.9.11": [ { "comment_text": "", "digests": { "md5": "9df194ca362ebc429b4e86375e778ada", "sha256": "1f83e3a603a497f9e7c87845f564d5482653a7a835a3c1e15268571184482899" }, "downloads": -1, "filename": "py-lz4framed_ph4-0.9.11.tar.gz", "has_sig": false, "md5_digest": "9df194ca362ebc429b4e86375e778ada", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 93045, "upload_time": "2017-04-11T23:35:40", "url": "https://files.pythonhosted.org/packages/de/96/6e3d6a4b39b78c4cff2887dbc6076dd19a2f0441d24032743f799cba5bfe/py-lz4framed_ph4-0.9.11.tar.gz" } ], "0.9.7": [ { "comment_text": "", "digests": { "md5": "56c157493db6f5263a6137d6ce6e41f9", "sha256": "1eb9c37cc6f49879e63b577c151f693dc6aef71fc7e3a6b265581d80e8dae77f" }, "downloads": -1, "filename": "py-lz4framed_ph4-0.9.7.tar.gz", "has_sig": false, "md5_digest": "56c157493db6f5263a6137d6ce6e41f9", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 87386, "upload_time": "2017-04-01T17:18:42", "url": "https://files.pythonhosted.org/packages/8e/bc/fb3b399f08e7c22f50af294abef5992fbad61ba233bad40f8bda071bde24/py-lz4framed_ph4-0.9.7.tar.gz" } ], "0.9.8": [ { "comment_text": "", "digests": { "md5": "14abfb6191845768ebb7aadb3039de32", "sha256": "25655e0447edbd457e14f4e7f3e3c3ec51c489e00e5a2d3c64ce8280125322a5" }, "downloads": -1, "filename": "py-lz4framed_ph4-0.9.8.tar.gz", "has_sig": false, "md5_digest": "14abfb6191845768ebb7aadb3039de32", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 87525, "upload_time": "2017-04-01T17:26:35", "url": "https://files.pythonhosted.org/packages/56/41/39d4d8e54c2a1101364db2464a7da5c07c561aca39445ceb8cb834eb478e/py-lz4framed_ph4-0.9.8.tar.gz" } ], "0.9.9": [ { "comment_text": "", "digests": { "md5": "6d89c186d7cc9df9a5964ecb1b5db079", "sha256": "dca24800ecd587c358dc11bc5d565140cefd862c1cd76c034fc6bf3fd657ce14" }, "downloads": -1, "filename": "py-lz4framed_ph4-0.9.9.tar.gz", "has_sig": false, "md5_digest": "6d89c186d7cc9df9a5964ecb1b5db079", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 87541, "upload_time": "2017-04-02T10:51:29", "url": "https://files.pythonhosted.org/packages/3d/ae/276e19e1921228a00d27e28ce096213062fe9d8c5d43a4b0180d68bf7988/py-lz4framed_ph4-0.9.9.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "9df194ca362ebc429b4e86375e778ada", "sha256": "1f83e3a603a497f9e7c87845f564d5482653a7a835a3c1e15268571184482899" }, "downloads": -1, "filename": "py-lz4framed_ph4-0.9.11.tar.gz", "has_sig": false, "md5_digest": "9df194ca362ebc429b4e86375e778ada", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 93045, "upload_time": "2017-04-11T23:35:40", "url": "https://files.pythonhosted.org/packages/de/96/6e3d6a4b39b78c4cff2887dbc6076dd19a2f0441d24032743f799cba5bfe/py-lz4framed_ph4-0.9.11.tar.gz" } ] }