| 1 |
Introduction |
| 2 |
============ |
| 3 |
|
| 4 |
This package provides a Python interface for the `LZ4 compression library |
| 5 |
<http://lz4.github.io/lz4/>`_ by Yann Collet. Support is provided for Python 2 |
| 6 |
(from 2.7 onwards) and Python 3 (from 3.4 onwards). |
| 7 |
|
| 8 |
The LZ4 library provides support for three specifications: |
| 9 |
|
| 10 |
* The `frame <http://lz4.github.io/lz4/lz4_Frame_format.html>`_ format |
| 11 |
* The `block <http://lz4.github.io/lz4/lz4_Block_format.html>`_ format |
| 12 |
* The `stream <https://github.com/lz4/lz4/wiki/LZ4-Streaming-API-Basics>`_ format |
| 13 |
|
| 14 |
This Python interface currently supports the frame, block and double-buffer |
| 15 |
stream formats. |
| 16 |
|
| 17 |
For most applications, the frame format is what you should use as this |
| 18 |
guarantees interoperability with other bindings. The frame format defines a |
| 19 |
standard container for the compressed data. In the frame format, the data is |
| 20 |
compressed into a sequence of blocks. The frame format defines a frame header, |
| 21 |
which contains information about the compressed data such as its size, and |
| 22 |
defines a standard end of frame marker. |
| 23 |
|
| 24 |
The API provided by the frame format bindings follows that of the LZMA, zlib, |
| 25 |
gzip and bzip2 compression libraries which are provided with the Python standard |
| 26 |
library. As such, these LZ4 bindings should provide a drop-in alternative to the |
| 27 |
compression libraries shipped with Python. The package provides context managers |
| 28 |
and file handler support. |
| 29 |
|
| 30 |
The bindings drop the GIL when calling in to the underlying LZ4 library, and is |
| 31 |
thread safe. An extensive test suite is included. |