GitHub - pycompression/python-isal: Faster zlib and gzip compatible compression and decompression by providing python bindings for the isa-l library. (original) (raw)

python-isal

Faster zlib and gzip compatible compression and decompression by providing Python bindings for the ISA-L library.

This package provides Python bindings for the ISA-L library. The Intel(R) Intelligent Storage Acceleration Library (ISA-L) implements several key algorithms in assembly language. This includes a variety of functions to provide zlib/gzip-compatible compression.

python-isal provides the bindings by offering four modules:

isal_zlib and igzip are almost fully compatible with zlib andgzip from the Python standard library. There are some minor differences see: differences-with-zlib-and-gzip-modules.

Quickstart

The python-isal modules can be imported as follows

from isal import isal_zlib from isal import igzip from isal import igzip_lib

isal_zlib and igzip are meant to be used as drop in replacements so their api and functions are the same as the stdlib's modules. Except where ISA-L does not support the same calls as zlib (See differences below).

A full API documentation can be found on our readthedocs page.

python -m isal.igzip implements a simple gzip-like command line application (just like python -m gzip). Full usage documentation can be found on our readthedocs page.

Installation

Installation is supported on Linux, Windows and MacOS. For more advanced installation options check the documentation.

python-isal as a dependency in your project

Python-isal supports a limited amount of platforms for which wheels have been made available. To prevent your users from running into issues when installing your project please list a python-isal dependency as follows.

setup.cfg:

install_requires = isal; platform.machine == "x86_64" or platform.machine == "AMD64" or platform.machine == "aarch64"

setup.py:

extras_require={ ":platform.machine == 'x86_64' or platform.machine == 'AMD64' or platform.machine == 'aarch64'": ['isal'] },

Differences with zlib and gzip modules

Contributing

Please make a PR or issue if you feel anything can be improved. Bug reports are also very welcome. Please report them on the github issue tracker.

Development

The repository needs to be cloned recursively to make sure theISA-L repository is checked out:git clone --recursive https://github.com/pycompression/python-isal.git. If the repository is already checked out you can use git submodule update --init.

Patches should be made on a feature branch. To run the testing install toxwith pip install tox and run the commands tox -e lint andtox. That will run most of the testing that is also performed by the CI. For changes to the documentation run tox -e docs. For changes to the C code please also run tox -e asan to check for memory leaks. This requires libasan to be installed.

Building requires theISA-L build requirementsas well.

Acknowledgements

This project builds upon the software and experience of many. Many thanks to:

Python-isal would not have been possible without you!