All Projects → pycompression → python-isal

pycompression / python-isal

Licence: other
Faster zlib and gzip compatible compression and decompression by providing python bindings for the isa-l library.

Programming Languages

python
139335 projects - #7 most used programming language
c
50402 projects - #5 most used programming language

Projects that are alternatives of or similar to python-isal

zzlib
zlib-compressed file depacking library in Lua
Stars: ✭ 44 (+109.52%)
Mutual labels:  gzip, zlib, deflate
power-gzip
POWER9 gzip engine documentation and code samples
Stars: ✭ 16 (-23.81%)
Mutual labels:  gzip, zlib, deflate
deflate-rs
An implementation of a DEFLATE encoder in rust
Stars: ✭ 47 (+123.81%)
Mutual labels:  gzip, zlib, deflate
Turbobench
Compression Benchmark
Stars: ✭ 211 (+904.76%)
Mutual labels:  gzip, zlib
Uzlib
Radically unbloated DEFLATE/zlib/gzip compression/decompression library. Can decompress any gzip/zlib data, and offers simplified compressor which produces gzip-compatible output, while requiring much less resources (and providing less compression ratio of course).
Stars: ✭ 168 (+700%)
Mutual labels:  gzip, zlib
Datacompression
Swift libcompression wrapper as an extension for the Data type (GZIP, ZLIB, LZFSE, LZMA, LZ4, deflate, RFC-1950, RFC-1951, RFC-1952)
Stars: ✭ 191 (+809.52%)
Mutual labels:  gzip, zlib
Denoflate
WebAssembly powered Deflate/Gzip/Zlib compression for Deno, written in Rust
Stars: ✭ 80 (+280.95%)
Mutual labels:  gzip, zlib
restio
HTTP Client for Dart inspired by OkHttp
Stars: ✭ 46 (+119.05%)
Mutual labels:  gzip, deflate
Compression
Node.js compression middleware
Stars: ✭ 2,506 (+11833.33%)
Mutual labels:  gzip, deflate
compress
compress and uncompress for Deno
Stars: ✭ 29 (+38.1%)
Mutual labels:  gzip, deflate
zlib
Pure javascript implementation of Zlib nodejs core module.The zlib module provides compression functionality implemented using Gzip and Deflate/Inflate.
Stars: ✭ 14 (-33.33%)
Mutual labels:  gzip, zlib
Libflate
A Rust implementation of DEFLATE algorithm and related formats (ZLIB, GZIP)
Stars: ✭ 125 (+495.24%)
Mutual labels:  gzip, zlib
Swcompression
A Swift framework for working with compression, archives and containers.
Stars: ✭ 110 (+423.81%)
Mutual labels:  gzip, zlib
restler
Restler is a beautiful and powerful Android app for quickly testing REST API anywhere and anytime.
Stars: ✭ 120 (+471.43%)
Mutual labels:  gzip, deflate
Zippy
Pure Nim implementation of deflate, zlib, gzip and zip.
Stars: ✭ 88 (+319.05%)
Mutual labels:  gzip, zlib
em inflate
Fast, small, in-memory inflate (zlib, deflate and gzip decompression)
Stars: ✭ 59 (+180.95%)
Mutual labels:  gzip, zlib
Tinf
Tiny inflate library (inflate, gzip, zlib)
Stars: ✭ 57 (+171.43%)
Mutual labels:  gzip, zlib
Universal Zopfli Js
JavaScript binding to Zopfli with WebAssembly.
Stars: ✭ 70 (+233.33%)
Mutual labels:  gzip, zlib
Libz.jl
Fast, flexible zlib bindings.
Stars: ✭ 26 (+23.81%)
Mutual labels:  gzip, zlib
http compression
🗜️ Deno HTTP compression middleware
Stars: ✭ 34 (+61.9%)
Mutual labels:  gzip, deflate

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 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.

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

  • with pip: pip install isal
  • with conda: conda install python-isal

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.python_implementation == 'CPython' and (platform.machine == "x86_64" or platform.machine == "AMD64")

setup.py:

extras_require={
    ":platform.python_implementation == 'CPython' and "
    "(platform.machine == 'x86_64' or platform.machine == 'AMD64')": ['isal']
},

Differences with zlib and gzip modules

  • Compression level 0 in 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.
  • Compression levels range from 0 to 3, not 1 to 9. 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.
  • 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.

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.

Acknowledgements

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

  • The ISA-L contributors for making ISA-L. Special thanks to @gbtucker for always being especially helpful and responsive.
  • The Cython contributors for making it easy to create an extension and helping a novice get start with pointer addresses.
  • The CPython contributors. Python-isal mimicks zlibmodule.c and gzip.py from the standard library to make it easier for python users to adopt it.
  • @marcelm for taking a chance on this project and make it a dependency for his xopen and by extension cutadapt projects. This gave python-isal its first users who used python-isal in production.
  • The github actions team for creating the actions CI service that enables building and testing on all three major operating systems.
  • @animalize for explaining how to test and build python-isal for ARM 64-bit platforms.
  • And last but not least: everyone who submitted a bug report or a feature request. These make the project better!

Python-isal would not have been possible without you!

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].