Skip to main content

pigz - python bindings to pigz (parallel gzip)

Project description

pigz

2.8 (19 Aug 2022) by Mark Adler

pigz, which stands for Parallel Implementation of GZip, is a fully functional replacement for gzip that exploits multiple processors and multiple cores to the hilt when compressing data.

pigz was written by Mark Adler and does not include third-party code. I am making my contributions to and distributions of this project solely in my personal capacity, and am not conveying any rights to any intellectual property of any third parties.

This version of pigz is written to be portable across Unix-style operating systems that provide the zlib and pthread libraries.

Type "make" in this directory to build the "pigz" executable. You can then install the executable wherever you like in your path (e.g. /usr/local/bin/). Type "pigz" to see the command help and all of the command options.

The latest version of pigz can be found at http://zlib.net/pigz/ . You need zlib version 1.2.3 or later to compile pigz. zlib version 1.2.6 or later is recommended, which reduces the overhead between blocks. You can find the latest version of zlib at http://zlib.net/ . You can look in pigz.c for the change history.

Questions, comments, bug reports, fixes, etc. can be emailed to Mark at his address in the license below.

The license from pigz.c is copied here:

This software is provided 'as-is', without any express or implied warranty. In no event will the author be held liable for any damages arising from the use of this software.

Permission is granted to anyone to use this software for any purpose, including commercial applications, and to alter it and redistribute it freely, subject to the following restrictions:

  1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required.
  2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software.
  3. This notice may not be removed or altered from any source distribution.

Mark Adler madler@alumni.caltech.edu

Python Bindings

Python Bindings are powered by Pybind11 and the source code is available at https://github.com/thammegowda/pigz.

Install pigz

# Option 1: from PyPI
pip install pigz

# Option 2: from source code
pip install git+https://github.com/thammegowda/pigz

Features

  1. Drop-in replacement for built in gzip (Aiming to be. Currently WIP)
  2. Handles context managers. Automatically opens and closes files when used correctly with with block

Limitations

  1. Python APIs are currently tailored for text mode
  2. Maybe unstable on some platforms. Tested on GNU/Linux for now.

Usage

import pigz

data = "Hello, World!\nThis is a test\nThis is the third line"
out_path = 'test_iterator.gz'

# How to write data
with pigz.open(str(out_path), 'wt') as f:
   f.write(data)

# How to read data
with pigz.open(str(out_path), 'rt') as f:
   data2 = ''
   for line in f:
      data2 += line
assert data == data2

See tests/ directory for some more examples

Run Tests for Python Module

cmake -B build
cmake --build build
python -m pytest -vs tests/

Build Wheels for Release

NOTE: this for developers only

bash build.sh

Manylinux wheels are produced under dist-manylinux/

Upload to PyPI

twine twine upload -r pypi dist-manylinux/pigz-*.whl

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distributions

pigz-2.9rc3-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (162.8 kB view details)

Uploaded CPython 3.13 manylinux: glibc 2.17+ x86-64

pigz-2.9rc3-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (162.8 kB view details)

Uploaded CPython 3.12 manylinux: glibc 2.17+ x86-64

pigz-2.9rc3-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (163.8 kB view details)

Uploaded CPython 3.11 manylinux: glibc 2.17+ x86-64

pigz-2.9rc3-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (162.6 kB view details)

Uploaded CPython 3.10 manylinux: glibc 2.17+ x86-64

pigz-2.9rc3-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (162.8 kB view details)

Uploaded CPython 3.9 manylinux: glibc 2.17+ x86-64

pigz-2.9rc3-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (162.5 kB view details)

Uploaded CPython 3.8 manylinux: glibc 2.17+ x86-64

pigz-2.9rc3-cp37-cp37m-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (163.7 kB view details)

Uploaded CPython 3.7m manylinux: glibc 2.17+ x86-64

File details

Details for the file pigz-2.9rc3-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for pigz-2.9rc3-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 c6634ea0db3dc96cda8d67e635a6cdc7880b376c16a8d7f1dcb3cf7f3313c02a
MD5 5924f8f136e760b69b4598dd3efac62a
BLAKE2b-256 87d59f660bc2a7470434450e8be354b2f69db3a961ae28998e7a3ed8b5471faf

See more details on using hashes here.

File details

Details for the file pigz-2.9rc3-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for pigz-2.9rc3-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 28d3d17065fb1093e85c01a84362f1d1527ff4f08bbd01983b30b50eeb47d163
MD5 1528fe5d292393dab73948c18e072aac
BLAKE2b-256 b1aa59d255e37cb46081dc7ad25c6d903bbca4858f125d757b50d191be742001

See more details on using hashes here.

File details

Details for the file pigz-2.9rc3-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for pigz-2.9rc3-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 ff44a3fe77c0eaab827bc1800550cedf69df2cf09ec1175b7399f54cd5c2eb37
MD5 1e94c6fca93e1a2d32ca9cb2208e7340
BLAKE2b-256 ff3ea41e9e4e7ed399d7965ee30d16c8ac254983e80a6ab7f4b38b2ac074679e

See more details on using hashes here.

File details

Details for the file pigz-2.9rc3-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for pigz-2.9rc3-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 da232a197fb691222be010eb66557675f196d261fb3afc045c3e6e4398b158b7
MD5 d4ab9b66ce729a2c22e2f7428980d6f9
BLAKE2b-256 87b2744fcb947a4fe27895dfb4ce5d1ed4bdd2c2ac688ae7bfd72cbca9a4a47a

See more details on using hashes here.

File details

Details for the file pigz-2.9rc3-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for pigz-2.9rc3-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 305d87ed6a8467630789d5682bd0ac99e3784fa44455116e7b0491592a981376
MD5 56b923bc5099e4d353fe922207d382b7
BLAKE2b-256 e57b10e0d112528ca5021fd417c49a293ac8a7b9f257d669bf09ae5649cfc9c2

See more details on using hashes here.

File details

Details for the file pigz-2.9rc3-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for pigz-2.9rc3-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 efd6625ec25573ef466c16f3a1a7e05073dcfd0f066d89a3c6b3e266236ba48e
MD5 829bb0a4f75ab4af325de42bd87ee28e
BLAKE2b-256 a9cd56fc1d05738fc2ec2a21314046bdf28082fc66903bdcfd050530042a5c0d

See more details on using hashes here.

File details

Details for the file pigz-2.9rc3-cp37-cp37m-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for pigz-2.9rc3-cp37-cp37m-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 7ad10fe46f309dcd4de83eb39fcab551711ce4c8e02db5db5d6333481173ee1b
MD5 ac52ad7a7b801dbcbff6f0953794d939
BLAKE2b-256 24f6c36aa628701c1e394532a0fe3ea3f9bf9e6fbbf48b44345d394bfae9d0ab

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page