Skip to main content

Pigz wrapper

This repository is a wrapper for python to utilize gzip or pigz to compress or decompress data in parallel.

For installation:

python setup.py install

For reading:

from pigz import PigzFile
with PigzFile("input.gz") as f:
    for line in f:
        print(line)

For writing:

from pigz import PigzFile
threads = 4 # default
with PigzFile("output.gz", "wt", threads) as fw:
    for line in lines:
        fw.write(line)

For testing:

python setup.py test

the output is as follows:

============================================================
Read by gzip subprocess:
Number: 1, Time: 585.19 ms
Number: 2, Time: 726.82 ms
Number: 3, Time: 698.48 ms
Number: 4, Time: 728.64 ms
Number: 5, Time: 698.70 ms
Average time: 687.57 ms
============================================================
Write by gzip subprocess:
Number: 1, Time: 13652.26 ms
Number: 2, Time: 13413.61 ms
Number: 3, Time: 13303.46 ms
Number: 4, Time: 13369.65 ms
Number: 5, Time: 13340.88 ms
Average time: 13415.97 ms
============================================================
Read by pigz subprocess (4 threads):
Number: 1, Time: 339.37 ms
Number: 2, Time: 403.47 ms
Number: 3, Time: 401.11 ms
Number: 4, Time: 408.30 ms
Number: 5, Time: 425.89 ms
Average time: 395.63 ms
============================================================
Write by pigz subprocess (4 threads):
Number: 1, Time: 3562.05 ms
Number: 2, Time: 3511.68 ms
Number: 3, Time: 3519.51 ms
Number: 4, Time: 3518.98 ms
Number: 5, Time: 3513.09 ms
Average time: 3525.06 ms
============================================================
Read by gzip package:
Number: 1, Time: 867.79 ms
Number: 2, Time: 915.57 ms
Number: 3, Time: 893.22 ms
Number: 4, Time: 885.66 ms
Number: 5, Time: 889.74 ms
Average time: 890.40 ms
============================================================
Write by gzip package:
Number: 1, Time: 66520.40 ms
Number: 2, Time: 66305.25 ms
Number: 3, Time: 65591.92 ms
Number: 4, Time: 65327.56 ms
Number: 5, Time: 65716.15 ms
Average time: 65892.26 ms

The pigz subprocess show significantly high effectiveness in compressing and decompressing data.

Metadata

Release files for pygz 1.0.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for pygz 1.0.1
File Size Uploaded Provenance Actions
pygz-1.0.1.tar.gz 3.2 kB Without provenance Details for pygz-1.0.1.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for pygz 1.0.1
File Interpreter ABI Platform Actions
pygz-1.0.1-py3-none-any.whl Python 3 none any Details for pygz-1.0.1-py3-none-any.whl

Total release size: 7.2 kB

Release files / pygz-1.0.1.tar.gz

Download URL pygz-1.0.1.tar.gz
Size 3.2 kB
Tags Source
SHA-256 checksum
How to use checksums
059225a30ddcea55fa238d0ce416fc738c5c70e7e455764a7dade4e4a8680e21
BLAKE2b-256 checksum
How to use checksums
b63603f9069786e837d2f8d4cd20c2458bf890a083e68fbbf75b48f56cb95b26
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.8.0 pkginfo/1.8.2 readme-renderer/34.0 requests/2.25.1 requests-toolbelt/0.9.1 urllib3/1.26.6 tqdm/4.61.2 importlib-metadata/1.7.0 keyring/23.4.1 rfc3986/1.5.0 colorama/0.4.4 CPython/3.6.13

Release files / pygz-1.0.1-py3-none-any.whl

Download URL pygz-1.0.1-py3-none-any.whl
Size 4.0 kB
Tags Python 3
SHA-256 checksum
How to use checksums
faf5edd33460a5a98ce5d7c0ebb7643a2a279e5801e2947b9e2d699abedbc85a
BLAKE2b-256 checksum
How to use checksums
d1dcaa3b7628a40045b7f843343acdf27e323c73d17919544ea5e4c62b68476f
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.8.0 pkginfo/1.8.2 readme-renderer/34.0 requests/2.25.1 requests-toolbelt/0.9.1 urllib3/1.26.6 tqdm/4.61.2 importlib-metadata/1.7.0 keyring/23.4.1 rfc3986/1.5.0 colorama/0.4.4 CPython/3.6.13

Security for pygz 1.0.1

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

1.0.1 This release

2 release files No provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page