{ "info": { "author": "GaLaXy1036", "author_email": "", "bugtrack_url": null, "classifiers": [ "License :: OSI Approved :: MIT License", "Operating System :: OS Independent", "Programming Language :: Python :: 3" ], "description": "# PyLZHAM\n**PyLZHAM** is a python 3 wrapper for the LZHAM Compression Codec\n\n## Installation\nIn order to install pylzham, you'll simply need to use the following command\n> python -m pip install pylzham\n\n**Note**: PyLZHAM use C++ extension which means python need a compiler to build this module\n## Usage\n### Compression\nYou can easily compress data using the following snippet:\n\n >>> import lzham\n >>> lzham.compress(b'yourdatahere' * 100)\n b'@\\x0b\\x9f\\x85\\x07\\x96\\xf7W&F\\x17F\\x16\\x86P\\x07&W\\x98(C\\xf4\\x03\\xf7\\xf4\\x02m\\x98\\xc0P\\xeb\\xf9$'\n\nHowever if you need to compress many files/data, using the `LZHAMCompressor` class might be a better idea. Here is a quick example:\n\n >>> from lzham import LZHAMCompressor\n >>> compressor = LZHAMCompressor()\n >>> compressor.compress(b'yourdatahere' * 100)\n b'@\\x0b\\x9f\\x85\\x07\\x96\\xf7W&F\\x17F\\x16\\x86P\\x07&W\\x98(C\\xf4\\x03\\xf7\\xf4\\x02m\\x98\\xc0P\\xeb\\xf9$'\n >>> compressor.compress(b'yourotherdata' * 100)\n b'@\\x07\\xcd\\xd9\\x07\\x96\\xf7W&\\xf7F\\x86W&D\\xc6\\x17F\\x17\\x98(D\\x03\\xf7\\xf4\\x03\\xf7\\xf4\\x01\\x98\\xc03i*k'\n\n##### Using compression option\nIf you wanna set compression options you should use a compression filter. Filters support the following options (specified as additional entries in the dictionary representing the filter):\n\n- `dict_size_log2`\n- `level`\n- `table_update_rate`\n- `max_helper_threads`\n- `table_max_update_interval`\n- `table_update_interval_slow_rate`\n\nFor more information about thoses options you can look [there](https://github.com/richgel999/lzham_codec/wiki/LZHAM-Codec-API-Reference#compression-parameters-struct).\n\nHere is an example of using filters with both `lzham.compress` and `LZHAMCompressor`:\n\n >>> filters = {'dict_size_log2': 18}\n >>> lzham.compress(b'yourdata', filters)\n >>> compressor = lzham.LZHAMCompressor(filters)\n >>> compressor.compress(b'yourdata')\n\n###Decompression\nYou can easily decompress data using the following snippet:\n\n >>> import lzham\n >>> lzham.decompress(b'D\\xad\\xc0\\x00\\x07FW7@\\x07i1\\x98\\xc0f\\xb1\\x11\\x81', 40)\n b'testtesttesttesttesttesttesttesttesttest'\n\n**Note**: Since there is no offical header for LZHAM you have to give the decompressed data size to the lib (`40` in our case). \n\nHowever if you need to decompress many files/data, using the `LZHAMDeompressor` class might be a better idea. Here is a quick example:\n\n >>> from lzham import LZHAMDecompressor\n >>> decompressor = LZHAMDecompressor()\n >>> decompressor.decompress(b'D\\xad\\xc0\\x00\\x07FW7@\\x07i1\\x98\\xc0f\\xb1\\x11\\x81', 40)\n\tb'testtesttesttesttesttesttesttesttesttest'\n\t>>> decompressor.decompress(b'D\\xad\\xc0\\x00\\x07FW7@\\x07i1\\x98\\xc0f\\xb1\\x11\\x81', 40)\n\tb'testtesttesttesttesttesttesttesttesttest'\n\n##### Using decompression option\nIf you wanna set decompression options you should use a decompression filter. Filters support the following options (specified as additional entries in the dictionary representing the filter):\n\n- `dict_size_log2`\n- `table_update_rate`\n- `table_max_update_interval`\n- `table_update_interval_slow_rate`\n- `compute_adler32_during_decomp`\n- `unbuffered_decompression`\n\nFor more information about thoses options you can look [there](https://github.com/richgel999/lzham_codec/wiki/LZHAM-Codec-API-Reference#decompression-parameters-struct).\n\nHere is an example of using filters with both `lzham.decompress` and `LZHAMDecompressor`:\n\n >>> filters = {'dict_size_log2': 18}\n >>> lzham.decompress(b'D\\xad\\xc0\\x00\\x07FW7@\\x0fi3\\x98\\xc0f\\xb1\\x11\\x81', 40, filters)\n\t>>> decompressor = lzham.LZHAMDecompressor(filters)\n\t>>> decompressor.decompress(b'D\\xad\\xc0\\x00\\x07FW7@\\x0fi3\\x98\\xc0f\\xb1\\x11\\x81', 40)\n\nIf you need to modify your `LZHAMDecompressor` instance filters you can simply call its `reinit` function like this:\n\n\t>>> decompressor.reinit(filters)\n\n## Note\n\nI'm a C++ newbie so my code might be really trash. If you have any bug to report feel free to contact me at @GaLaXy1036#1601 on Discord.\n\n", "description_content_type": "text/markdown", "docs_url": null, "download_url": "", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/Galaxy1036/pylzham", "keywords": "", "license": "MIT", "maintainer": "", "maintainer_email": "", "name": "pylzham", "package_url": "https://pypi.org/project/pylzham/", "platform": "", "project_url": "https://pypi.org/project/pylzham/", "project_urls": { "Homepage": "https://github.com/Galaxy1036/pylzham" }, "release_url": "https://pypi.org/project/pylzham/0.1.1/", "requires_dist": null, "requires_python": "", "summary": "Python 3 Wrapper for LZHAM Codec", "version": "0.1.1" }, "last_serial": 5222019, "releases": { "0.1": [ { "comment_text": "", "digests": { "md5": "37d61d36962901f9f43629169c0ae21c", "sha256": "eec86571fd98531905481368f5baaa6af4dde0dd6c6835cea17a4509e5175aee" }, "downloads": -1, "filename": "pylzham-0.1-cp36-cp36m-win_amd64.whl", "has_sig": false, "md5_digest": "37d61d36962901f9f43629169c0ae21c", "packagetype": "bdist_wheel", "python_version": "cp36", "requires_python": null, "size": 75624, "upload_time": "2019-05-01T19:32:54", "url": "https://files.pythonhosted.org/packages/6a/5a/e5a80fcadc9d5ff83c03ffcbe8195c4dc89ab7ffd14f1660c3179f507c0e/pylzham-0.1-cp36-cp36m-win_amd64.whl" }, { "comment_text": "", "digests": { "md5": "8da3487fbcfd5448b94115f05d4c286c", "sha256": "9c44c47df02b2c14c75f53dbe015a44bfff55325ca5174c3cfb3aa642111541f" }, "downloads": -1, "filename": "pylzham-0.1.tar.gz", "has_sig": false, "md5_digest": "8da3487fbcfd5448b94115f05d4c286c", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 109596, "upload_time": "2019-05-01T19:32:56", "url": "https://files.pythonhosted.org/packages/3d/cc/1b2badebd1758e8a1d84751cd12525bf19768e1a895201a6f8a74489a465/pylzham-0.1.tar.gz" } ], "0.1.1": [ { "comment_text": "", "digests": { "md5": "3d12df3690b40dd2ad2e8893456435dc", "sha256": "37b60402b8e4c47849448a5b0d511ca851a5d0c1e5ca486f2410a97303f6335c" }, "downloads": -1, "filename": "pylzham-0.1.1-cp36-cp36m-win_amd64.whl", "has_sig": false, "md5_digest": "3d12df3690b40dd2ad2e8893456435dc", "packagetype": "bdist_wheel", "python_version": "cp36", "requires_python": null, "size": 75675, "upload_time": "2019-05-03T14:07:54", "url": "https://files.pythonhosted.org/packages/4b/9b/28c13edaf42bf69928b3c10f48862b301d84b7d85e8687489dac7ddf8e36/pylzham-0.1.1-cp36-cp36m-win_amd64.whl" }, { "comment_text": "", "digests": { "md5": "ac4da671d86369c0bdba9cd6830726be", "sha256": "c8ffad290be00241ae6f6a0d329c89097a9c9966f3e2e0ea33c9bd79d150b4f5" }, "downloads": -1, "filename": "pylzham-0.1.1.tar.gz", "has_sig": false, "md5_digest": "ac4da671d86369c0bdba9cd6830726be", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 109608, "upload_time": "2019-05-03T14:07:55", "url": "https://files.pythonhosted.org/packages/16/28/e14cbac21b4f6be9611f0dc656c2b06f33b769b23297211087de4592ee13/pylzham-0.1.1.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "3d12df3690b40dd2ad2e8893456435dc", "sha256": "37b60402b8e4c47849448a5b0d511ca851a5d0c1e5ca486f2410a97303f6335c" }, "downloads": -1, "filename": "pylzham-0.1.1-cp36-cp36m-win_amd64.whl", "has_sig": false, "md5_digest": "3d12df3690b40dd2ad2e8893456435dc", "packagetype": "bdist_wheel", "python_version": "cp36", "requires_python": null, "size": 75675, "upload_time": "2019-05-03T14:07:54", "url": "https://files.pythonhosted.org/packages/4b/9b/28c13edaf42bf69928b3c10f48862b301d84b7d85e8687489dac7ddf8e36/pylzham-0.1.1-cp36-cp36m-win_amd64.whl" }, { "comment_text": "", "digests": { "md5": "ac4da671d86369c0bdba9cd6830726be", "sha256": "c8ffad290be00241ae6f6a0d329c89097a9c9966f3e2e0ea33c9bd79d150b4f5" }, "downloads": -1, "filename": "pylzham-0.1.1.tar.gz", "has_sig": false, "md5_digest": "ac4da671d86369c0bdba9cd6830726be", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 109608, "upload_time": "2019-05-03T14:07:55", "url": "https://files.pythonhosted.org/packages/16/28/e14cbac21b4f6be9611f0dc656c2b06f33b769b23297211087de4592ee13/pylzham-0.1.1.tar.gz" } ] }