bdraco / zlib-fast

A wrapper to use the fastest available zlib

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

zlib-fast

CI Status Documentation Status Test coverage percentage

Poetry black pre-commit

PyPI Version Supported Python versions License


Documentation: https://zlib-fast.readthedocs.io

Source Code: https://github.com/bdraco/zlib-fast


A wrapper to use the fastest available zlib

zlib is be a bottleneck for creating backups with tarfile. zlib-fast replaces usage of zlib with isal which is a drop-in faster replacement.

Unlike the base isal implementation, this module maps zlib compression levels for compressobj to their nearest isal equivalent which allows it to be used as a drop in replacement with tarfile.

Installation

Install this via pip (or your favourite package manager):

pip install zlib-fast

Usage

Enable zlib-fast support by calling zlib_fast.enable().

import zlib_fast

zlib_fast.enable()
zlib_fast.disable()

The most common use case is for use with tarfile which does a late import. enable will only be effective for future imports of zlib, and will not redirect existing imports. If you need to use this module for other use cases, be sure to call zlib_fast.enable() before any code that loads zlib.

Contributors ✨

Thanks goes to these wonderful people (emoji key):

This project follows the all-contributors specification. Contributions of any kind welcome!

Credits

This package was created with Copier and the browniebroke/pypackage-template project template.

About

A wrapper to use the fastest available zlib

License:Apache License 2.0


Languages

Language:Python 96.4%Language:JavaScript 3.6%