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 three modules:
isal_zlib
: A drop-in replacement for the zlib module that uses ISA-L to
accelerate its performance.igzip
: A drop-in replacement for the gzip module that uses isal_zlib
instead of zlib
to perform its compression and checksum tasks, which
improves performance.igzip_lib
: Provides compression functions which have full access to the
API of ISA-L's compression functions.isal_zlib
and igzip
are almost fully compatible with zlib
and
gzip
from the Python standard library. There are some minor differences
see: differences-with-zlib-and-gzip-modules.
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.
pip install isal
conda install python-isal
Installation is supported on Linux, Windows and MacOS. For more advanced installation options check the documentation.
zlib
and gzip
means no compression, while
in isal_zlib
and igzip
this is the lowest compression level.
This is a design choice that was inherited from the ISA-L library.isal_zlib.Z_DEFAULT_COMPRESSION
has been aliased to isal_zlib.ISAL_DEFAULT_COMPRESSION
(2).isal_zlib
only supports NO_FLUSH
, SYNC_FLUSH
, FULL_FLUSH
and
FINISH_FLUSH
. Other flush modes are not supported and will raise errors.zlib.Z_DEFAULT_STRATEGY
, zlib.Z_RLE
etc. are exposed as
isal_zlib.Z_DEFAULT_STRATEGY
, isal_zlib.Z_RLE
etc. for compatibility
reasons. However, isal_zlib
only supports a default strategy and will
give warnings when other strategies are used.zlib
supports different memory levels from 1 to 9 (with 8 default).
isal_zlib
supports memory levels smallest, small, medium, large and
largest. These have been mapped to levels 1, 2-3, 4-6, 7-8 and 9. So
isal_zlib
can be used with zlib compatible memory levels.isal_zlib
methods have a data
argument which is positional only. In
isal_zlib this is not enforced and it can also called as keyword argument.
This is due to implementing isal_zlib
in cython and maintaining backwards
compatibility with python 3.6.igzip.open
returns a class IGzipFile
instead of GzipFile
. Since
the compression levels are not compatible, a difference in naming was chosen
to reflect this. igzip.GzipFile
does exist as an alias of
igzip.IGzipFile
for compatibility reasons.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.
This project builds upon the software and experience of many. Many thanks to:
zlibmodule.c
and gzip.py
from the standard
library to make it easier for python users to adopt it.Python-isal would not have been possible without you!
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。