Skip to main content

Build Status

PYZOPFLI

cPython bindings for zopfli.

It requires Python 3.10 or greater.

USAGE

pyzopfli is a straight forward wrapper around zopfli’s ZlibCompress method.

from zopfli.zlib import compress
from zlib import decompress
s = 'Hello World'
print decompress(compress(s))

pyzopfli also wraps GzipCompress, but the API point does not try to mimic the gzip module.

from zopfli.gzip import compress
from StringIO import StringIO
from gzip import GzipFile
print GzipFile(fileobj=StringIO(compress("Hello World!"))).read()

Both zopfli.zlib.compress and zopfli.gzip.compress support the following keyword arguments. All values should be integers; boolean parmaters are treated as expected, 0 and >0 as false and true.

  • verbose dumps zopfli debugging data to stderr

  • numiterations Maximum amount of times to rerun forward and backward pass to optimize LZ77 compression cost. Good values: 10, 15 for small files, 5 for files over several MB in size or it will be too slow.

  • blocksplitting If true, splits the data in multiple deflate blocks with optimal choice for the block boundaries. Block splitting gives better compression. Default: true (1).

  • blocksplittinglast If true, chooses the optimal block split points only after doing the iterative LZ77 compression. If false, chooses the block split points first, then does iterative LZ77 on each individual block. Depending on the file, either first or last gives the best compression. Default: false (0).

  • blocksplittingmax Maximum amount of blocks to split into (0 for unlimited, but this can give extreme results that hurt compression on some files). Default value: 15.

TODO

  • Stop reading the entire file into memory and support streaming

  • Monkey patch zlib and gzip so code with an overly tight binding can be easily modified to use zopfli.

Metadata

Release files for zopfli 0.4.3

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

Source distribution (sdist)

Source distribution for zopfli 0.4.3
File Size Uploaded
zopfli-0.4.3.tar.gz 179.2 kB Details

Built distributions (wheels)

Table of built distributions (wheels) for zopfli 0.4.3
File
zopfli-0.4.3-pp311-pypy311_pp73-win_amd64.whl PyPy 3.11 PyPy 3.11 7.3 Windows x86-64 Details
zopfli-0.4.3-pp311-pypy311_pp73-manylinux_2_24_aarch64.manylinux_2_28_aarch64.whl PyPy 3.11 PyPy 3.11 7.3 Linux glibc 2.24+ ARM64, Linux glibc 2.28+ ARM64 Details
zopfli-0.4.3-pp311-pypy311_pp73-manylinux2014_x86_64.manylinux_2_17_x86_64.whl PyPy 3.11 PyPy 3.11 7.3 Linux glibc 2.17+ x86-64 Details
zopfli-0.4.3-pp311-pypy311_pp73-macosx_10_15_x86_64.whl PyPy 3.11 PyPy 3.11 7.3 macOS 10.15+ x86-64 Details
zopfli-0.4.3-cp310-abi3-win_arm64.whl CPython 3.10 abi3 Windows ARM64 Details
zopfli-0.4.3-cp310-abi3-win_amd64.whl CPython 3.10 abi3 Windows x86-64 Details
zopfli-0.4.3-cp310-abi3-win32.whl CPython 3.10 abi3 Windows x86-32 Details
zopfli-0.4.3-cp310-abi3-musllinux_1_2_x86_64.whl CPython 3.10 abi3 Linux musl 1.2+ x86-64 Details
zopfli-0.4.3-cp310-abi3-musllinux_1_2_aarch64.whl CPython 3.10 abi3 Linux musl 1.2+ ARM64 Details
zopfli-0.4.3-cp310-abi3-manylinux_2_24_aarch64.manylinux_2_28_aarch64.whl CPython 3.10 abi3 Linux glibc 2.24+ ARM64, Linux glibc 2.28+ ARM64 Details
zopfli-0.4.3-cp310-abi3-manylinux2014_x86_64.manylinux_2_17_x86_64.whl CPython 3.10 abi3 Linux glibc 2.17+ x86-64 Details
zopfli-0.4.3-cp310-abi3-macosx_10_9_universal2.whl CPython 3.10 abi3 macOS 10.9+ universal2 (ARM64, x86-64) Details

Total release size: 7.5 MB

Release files / zopfli-0.4.3.tar.gz

Download URL zopfli-0.4.3.tar.gz
Size 179.2 kB
Tags Source
SHA-256 checksum
How to use checksums
d3a50f91a13cea9bafe025de8fd87a005eb26de02a4f0c193127ddbf23ac8ebe
BLAKE2b-256 checksum
How to use checksums
74213b6af43a663b22b00e738bb0642931a2579e15da6852613d56c6aa535d28
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.13.12

Release files / zopfli-0.4.3-pp311-pypy311_pp73-win_amd64.whl

Download URL zopfli-0.4.3-pp311-pypy311_pp73-win_amd64.whl
Size 304.6 kB
Tags PyPy 3.11 PyPy 3.11 7.3 Windows x86-64
SHA-256 checksum
How to use checksums
62248dbf8dbcbd588ee194b210e5be9fa80bce29641f55599d6d394bd2a9d8a3
BLAKE2b-256 checksum
How to use checksums
c5955781bfb29782c39918686070dbf2ad1425c21384c3223f5c6bd911a806f8
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.13.12

Release files / zopfli-0.4.3-pp311-pypy311_pp73-manylinux_2_24_aarch64.manylinux_2_28_aarch64.whl

Download URL zopfli-0.4.3-pp311-pypy311_pp73-manylinux_2_24_aarch64.manylinux_2_28_aarch64.whl
Size 124.3 kB
Tags Linux glibc 2.24+ ARM64 Linux glibc 2.28+ ARM64 PyPy 3.11 PyPy 3.11 7.3
SHA-256 checksum
How to use checksums
d4f51dd1ab5312e837e2091284e0d9f1a138188f2e65812f9a5799dc02c45f94
BLAKE2b-256 checksum
How to use checksums
043a76bdfd8b35300391666b090357d059ce4c555b9d9ce9878dd551a9ad63a0
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.13.12

Release files / zopfli-0.4.3-pp311-pypy311_pp73-manylinux2014_x86_64.manylinux_2_17_x86_64.whl

Download URL zopfli-0.4.3-pp311-pypy311_pp73-manylinux2014_x86_64.manylinux_2_17_x86_64.whl
Size 127.3 kB
Tags Linux glibc 2.17+ x86-64 PyPy 3.11 PyPy 3.11 7.3
SHA-256 checksum
How to use checksums
f2e0adcf7d36c6fd0dd36cc771ef7f0c5803a05666feafcd90d7170174a4148e
BLAKE2b-256 checksum
How to use checksums
bd5fafaa18db62ab44da01a3fc39b6cb110478d26cd2287baa83461c6454ed45
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.13.12

Release files / zopfli-0.4.3-pp311-pypy311_pp73-macosx_10_15_x86_64.whl

Download URL zopfli-0.4.3-pp311-pypy311_pp73-macosx_10_15_x86_64.whl
Size 147.0 kB
Tags PyPy 3.11 PyPy 3.11 7.3 macOS 10.15+ x86-64
SHA-256 checksum
How to use checksums
0087c9a6f0c8a052be0f6d1a9bb71b6caffdd3e10201d6d6166e28d482cebe6d
BLAKE2b-256 checksum
How to use checksums
6fbf403da5a753731d9a4e4d65a494c4a9ae5a0fe62e7afffe5ab49915adc9a3
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.13.12

Release files / zopfli-0.4.3-cp310-abi3-win_arm64.whl

Download URL zopfli-0.4.3-cp310-abi3-win_arm64.whl
Size 451.3 kB
Tags CPython 3.10 Windows ARM64 abi3
SHA-256 checksum
How to use checksums
7e9703ca6e7ef66c8d05e0826b6f558b680c9db8206f84f05a3ee93430a12e42
BLAKE2b-256 checksum
How to use checksums
e6446264f929057236fde72dd6d271f54612b4811ce37288e002f5d5339d696a
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.13.12

Release files / zopfli-0.4.3-cp310-abi3-win_amd64.whl

Download URL zopfli-0.4.3-cp310-abi3-win_amd64.whl
Size 288.6 kB
Tags CPython 3.10 Windows x86-64 abi3
SHA-256 checksum
How to use checksums
921c2c9907f4364963848da5ad194b46d68865e07fdb975d04fd09bc42d47357
BLAKE2b-256 checksum
How to use checksums
9d3a4ff4fdead77ef30f5832b38a47eb7a1283e98b3c678576b83f8fdfff53eb
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.13.12

Release files / zopfli-0.4.3-cp310-abi3-win32.whl

Download URL zopfli-0.4.3-cp310-abi3-win32.whl
Size 271.7 kB
Tags CPython 3.10 Windows x86-32 abi3
SHA-256 checksum
How to use checksums
628c3e941752880b3491db8d44163d0aedb221944e22a17187ff7fc549b050f6
BLAKE2b-256 checksum
How to use checksums
8d209ca59d14b91f9fbc631793b4b085b309777edadaca496aa518a180817827
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.13.12

Release files / zopfli-0.4.3-cp310-abi3-musllinux_1_2_x86_64.whl

Download URL zopfli-0.4.3-cp310-abi3-musllinux_1_2_x86_64.whl
Size 1.9 MB
Tags CPython 3.10 Linux musl 1.2+ x86-64 abi3
SHA-256 checksum
How to use checksums
47604eee5c6704bdf0e94d8391fe3b74ddb2abd84128fbcfdc3ee0fc265feaef
BLAKE2b-256 checksum
How to use checksums
7a058f3aac10a858e89c2146d3a1f6ce33634c3db757365b4148fef1b85784d2
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.13.12

Release files / zopfli-0.4.3-cp310-abi3-musllinux_1_2_aarch64.whl

Download URL zopfli-0.4.3-cp310-abi3-musllinux_1_2_aarch64.whl
Size 1.8 MB
Tags CPython 3.10 Linux musl 1.2+ ARM64 abi3
SHA-256 checksum
How to use checksums
7fa3c35193475290e3f007bbcdebdbae64ba2f012d75c632da0d727e1da50d5e
BLAKE2b-256 checksum
How to use checksums
ded963568c54c8b68b9135f3456c5add83797a5528d596657f0e4f4910173b08
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.13.12

Release files / zopfli-0.4.3-cp310-abi3-manylinux_2_24_aarch64.manylinux_2_28_aarch64.whl

Download URL zopfli-0.4.3-cp310-abi3-manylinux_2_24_aarch64.manylinux_2_28_aarch64.whl
Size 818.4 kB
Tags CPython 3.10 Linux glibc 2.24+ ARM64 Linux glibc 2.28+ ARM64 abi3
SHA-256 checksum
How to use checksums
eb0c9c1d40a8cb1d58762d7e57290ccb753e0828c4d01be8acb59aae5d0ca206
BLAKE2b-256 checksum
How to use checksums
0e2bfbe8ba2ec40f5986b8983a4752f7a32672a80a10ea6e68213324a7055469
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.13.12

Release files / zopfli-0.4.3-cp310-abi3-manylinux2014_x86_64.manylinux_2_17_x86_64.whl

Download URL zopfli-0.4.3-cp310-abi3-manylinux2014_x86_64.manylinux_2_17_x86_64.whl
Size 829.4 kB
Tags CPython 3.10 Linux glibc 2.17+ x86-64 abi3
SHA-256 checksum
How to use checksums
769875152d0625c46707bcca57d4b2233fe653482067acd55fbf6ec525cb9bdc
BLAKE2b-256 checksum
How to use checksums
55c8d8d8d731e0b192024567b7198fb77b748821d355f3c8bf0109de27191f43
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.13.12

Release files / zopfli-0.4.3-cp310-abi3-macosx_10_9_universal2.whl

Download URL zopfli-0.4.3-cp310-abi3-macosx_10_9_universal2.whl
Size 291.5 kB
Tags CPython 3.10 abi3 macOS 10.9+ universal2 (ARM64, x86-64)
SHA-256 checksum
How to use checksums
88f4fbe429aad72bc206275d81fab11a097e0f951a5848d1f51083c37ea73073
BLAKE2b-256 checksum
How to use checksums
a55fb7d81b670daf990e15a0f7551da96c3c0700f69ae6d96b0245d6a19f51f3
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.13.12
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