python-lz4
Overview
This package provides bindings for the lz4 compression library by Yann Collet.
Install
The package is hosted on PyPI:
$ pip install lz4 $ easy_install lz4
Usage
The library is pretty simple to use:
>>> import lz4 >>> compressed_data = lz4.dumps(data) >>> data == lz4.loads(compressed_data) True >>>
Methods
The bindings provides some aliases too:
>>> import lz4 >>> lz4.LZ4_compress == lz4.compress == lz4.dumps True >>> lz4.LZ4_uncompress == lz4.uncompress == lz4.loads True >>>
Is it fast ?
Yes. Here are the results on my 2011 Macbook Pro i7 with 128kb random data:
$ python tests/bench.py Data Size: Input: 131072 LZ4: 131601 Snappy: 131087 LZ4 / Snappy: 1.003921 Benchmark: 200000 calls LZ4 Compression: 3.651002s Snappy Compression: 8.066482s LZ4 Decompression: 1.482934s Snappy Decompression : 3.193481s
Important note
Because LZ4 doesn’t define a container format, the python bindings will insert the original data size as an integer at the start of the compressed payload, like most bindings do anyway (Java…)
Metadata
Release files for lz4 0.3.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| lz4-0.3.0.tar.gz | 9.2 kB | Without provenance | Details for lz4-0.3.0.tar.gz |
Release files / lz4-0.3.0.tar.gz
| Download URL | lz4-0.3.0.tar.gz |
|---|---|
| Size | 9.2 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
692d2d47ec8a9f1f61467e11f40158af15b67fba35bc271cd6e79d2b772a9656
|
|
BLAKE2b-256 checksum How to use checksums |
acd8cabdfb76723337d916a81919e54f9c48f47cb913f169523cc706f35a1fb5
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
Security for lz4 0.3.0
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.