Skip to main content

Zopfli module for python

Project description

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.

Project details


Download files

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

Source Distribution

zopfli-0.4.3.tar.gz (179.2 kB view details)

Uploaded Source

Built Distributions

If you're not sure about the file name format, learn more about wheel file names.

zopfli-0.4.3-pp311-pypy311_pp73-win_amd64.whl (304.6 kB view details)

Uploaded PyPyWindows x86-64

zopfli-0.4.3-pp311-pypy311_pp73-manylinux_2_24_aarch64.manylinux_2_28_aarch64.whl (124.3 kB view details)

Uploaded PyPymanylinux: glibc 2.24+ ARM64manylinux: glibc 2.28+ ARM64

zopfli-0.4.3-pp311-pypy311_pp73-manylinux2014_x86_64.manylinux_2_17_x86_64.whl (127.3 kB view details)

Uploaded PyPymanylinux: glibc 2.17+ x86-64

zopfli-0.4.3-pp311-pypy311_pp73-macosx_10_15_x86_64.whl (147.0 kB view details)

Uploaded PyPymacOS 10.15+ x86-64

zopfli-0.4.3-cp310-abi3-win_arm64.whl (451.3 kB view details)

Uploaded CPython 3.10+Windows ARM64

zopfli-0.4.3-cp310-abi3-win_amd64.whl (288.6 kB view details)

Uploaded CPython 3.10+Windows x86-64

zopfli-0.4.3-cp310-abi3-win32.whl (271.7 kB view details)

Uploaded CPython 3.10+Windows x86

zopfli-0.4.3-cp310-abi3-musllinux_1_2_x86_64.whl (1.9 MB view details)

Uploaded CPython 3.10+musllinux: musl 1.2+ x86-64

zopfli-0.4.3-cp310-abi3-musllinux_1_2_aarch64.whl (1.8 MB view details)

Uploaded CPython 3.10+musllinux: musl 1.2+ ARM64

zopfli-0.4.3-cp310-abi3-manylinux_2_24_aarch64.manylinux_2_28_aarch64.whl (818.4 kB view details)

Uploaded CPython 3.10+manylinux: glibc 2.24+ ARM64manylinux: glibc 2.28+ ARM64

zopfli-0.4.3-cp310-abi3-manylinux2014_x86_64.manylinux_2_17_x86_64.whl (829.4 kB view details)

Uploaded CPython 3.10+manylinux: glibc 2.17+ x86-64

zopfli-0.4.3-cp310-abi3-macosx_10_9_universal2.whl (291.5 kB view details)

Uploaded CPython 3.10+macOS 10.9+ universal2 (ARM64, x86-64)

File details

Details for the file zopfli-0.4.3.tar.gz.

File metadata

  • Download URL: zopfli-0.4.3.tar.gz
  • Upload date:
  • Size: 179.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for zopfli-0.4.3.tar.gz
Algorithm Hash digest
SHA256 d3a50f91a13cea9bafe025de8fd87a005eb26de02a4f0c193127ddbf23ac8ebe
MD5 8978ce1fd86d28d2bd65ccbbcb2423c6
BLAKE2b-256 74213b6af43a663b22b00e738bb0642931a2579e15da6852613d56c6aa535d28

See more details on using hashes here.

File details

Details for the file zopfli-0.4.3-pp311-pypy311_pp73-win_amd64.whl.

File metadata

File hashes

Hashes for zopfli-0.4.3-pp311-pypy311_pp73-win_amd64.whl
Algorithm Hash digest
SHA256 62248dbf8dbcbd588ee194b210e5be9fa80bce29641f55599d6d394bd2a9d8a3
MD5 7c7059d11e47d36e42eec6326b819131
BLAKE2b-256 c5955781bfb29782c39918686070dbf2ad1425c21384c3223f5c6bd911a806f8

See more details on using hashes here.

File details

Details for the file zopfli-0.4.3-pp311-pypy311_pp73-manylinux_2_24_aarch64.manylinux_2_28_aarch64.whl.

File metadata

File hashes

Hashes for zopfli-0.4.3-pp311-pypy311_pp73-manylinux_2_24_aarch64.manylinux_2_28_aarch64.whl
Algorithm Hash digest
SHA256 d4f51dd1ab5312e837e2091284e0d9f1a138188f2e65812f9a5799dc02c45f94
MD5 cd35ba06db878495563dab2147e19834
BLAKE2b-256 043a76bdfd8b35300391666b090357d059ce4c555b9d9ce9878dd551a9ad63a0

See more details on using hashes here.

File details

Details for the file zopfli-0.4.3-pp311-pypy311_pp73-manylinux2014_x86_64.manylinux_2_17_x86_64.whl.

File metadata

File hashes

Hashes for zopfli-0.4.3-pp311-pypy311_pp73-manylinux2014_x86_64.manylinux_2_17_x86_64.whl
Algorithm Hash digest
SHA256 f2e0adcf7d36c6fd0dd36cc771ef7f0c5803a05666feafcd90d7170174a4148e
MD5 470a6498896206dda38ac0a449bb5901
BLAKE2b-256 bd5fafaa18db62ab44da01a3fc39b6cb110478d26cd2287baa83461c6454ed45

See more details on using hashes here.

File details

Details for the file zopfli-0.4.3-pp311-pypy311_pp73-macosx_10_15_x86_64.whl.

File metadata

File hashes

Hashes for zopfli-0.4.3-pp311-pypy311_pp73-macosx_10_15_x86_64.whl
Algorithm Hash digest
SHA256 0087c9a6f0c8a052be0f6d1a9bb71b6caffdd3e10201d6d6166e28d482cebe6d
MD5 8609e44519acdb4aff597370a8ce6623
BLAKE2b-256 6fbf403da5a753731d9a4e4d65a494c4a9ae5a0fe62e7afffe5ab49915adc9a3

See more details on using hashes here.

File details

Details for the file zopfli-0.4.3-cp310-abi3-win_arm64.whl.

File metadata

  • Download URL: zopfli-0.4.3-cp310-abi3-win_arm64.whl
  • Upload date:
  • Size: 451.3 kB
  • Tags: CPython 3.10+, Windows ARM64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for zopfli-0.4.3-cp310-abi3-win_arm64.whl
Algorithm Hash digest
SHA256 7e9703ca6e7ef66c8d05e0826b6f558b680c9db8206f84f05a3ee93430a12e42
MD5 3b2df1d314abfe3450f336f6085957f3
BLAKE2b-256 e6446264f929057236fde72dd6d271f54612b4811ce37288e002f5d5339d696a

See more details on using hashes here.

File details

Details for the file zopfli-0.4.3-cp310-abi3-win_amd64.whl.

File metadata

  • Download URL: zopfli-0.4.3-cp310-abi3-win_amd64.whl
  • Upload date:
  • Size: 288.6 kB
  • Tags: CPython 3.10+, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for zopfli-0.4.3-cp310-abi3-win_amd64.whl
Algorithm Hash digest
SHA256 921c2c9907f4364963848da5ad194b46d68865e07fdb975d04fd09bc42d47357
MD5 4cffde18cd804b302a4f85f69ff15581
BLAKE2b-256 9d3a4ff4fdead77ef30f5832b38a47eb7a1283e98b3c678576b83f8fdfff53eb

See more details on using hashes here.

File details

Details for the file zopfli-0.4.3-cp310-abi3-win32.whl.

File metadata

  • Download URL: zopfli-0.4.3-cp310-abi3-win32.whl
  • Upload date:
  • Size: 271.7 kB
  • Tags: CPython 3.10+, Windows x86
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for zopfli-0.4.3-cp310-abi3-win32.whl
Algorithm Hash digest
SHA256 628c3e941752880b3491db8d44163d0aedb221944e22a17187ff7fc549b050f6
MD5 f6b618e220888ca78c8e72c348d196a6
BLAKE2b-256 8d209ca59d14b91f9fbc631793b4b085b309777edadaca496aa518a180817827

See more details on using hashes here.

File details

Details for the file zopfli-0.4.3-cp310-abi3-musllinux_1_2_x86_64.whl.

File metadata

File hashes

Hashes for zopfli-0.4.3-cp310-abi3-musllinux_1_2_x86_64.whl
Algorithm Hash digest
SHA256 47604eee5c6704bdf0e94d8391fe3b74ddb2abd84128fbcfdc3ee0fc265feaef
MD5 10545d28c412e6d830f504b65c939e35
BLAKE2b-256 7a058f3aac10a858e89c2146d3a1f6ce33634c3db757365b4148fef1b85784d2

See more details on using hashes here.

File details

Details for the file zopfli-0.4.3-cp310-abi3-musllinux_1_2_aarch64.whl.

File metadata

File hashes

Hashes for zopfli-0.4.3-cp310-abi3-musllinux_1_2_aarch64.whl
Algorithm Hash digest
SHA256 7fa3c35193475290e3f007bbcdebdbae64ba2f012d75c632da0d727e1da50d5e
MD5 5d5b2063c9155b5563988aa1508261ce
BLAKE2b-256 ded963568c54c8b68b9135f3456c5add83797a5528d596657f0e4f4910173b08

See more details on using hashes here.

File details

Details for the file zopfli-0.4.3-cp310-abi3-manylinux_2_24_aarch64.manylinux_2_28_aarch64.whl.

File metadata

File hashes

Hashes for zopfli-0.4.3-cp310-abi3-manylinux_2_24_aarch64.manylinux_2_28_aarch64.whl
Algorithm Hash digest
SHA256 eb0c9c1d40a8cb1d58762d7e57290ccb753e0828c4d01be8acb59aae5d0ca206
MD5 6f94121f3b29f19a69e0bd39e4dfd5eb
BLAKE2b-256 0e2bfbe8ba2ec40f5986b8983a4752f7a32672a80a10ea6e68213324a7055469

See more details on using hashes here.

File details

Details for the file zopfli-0.4.3-cp310-abi3-manylinux2014_x86_64.manylinux_2_17_x86_64.whl.

File metadata

File hashes

Hashes for zopfli-0.4.3-cp310-abi3-manylinux2014_x86_64.manylinux_2_17_x86_64.whl
Algorithm Hash digest
SHA256 769875152d0625c46707bcca57d4b2233fe653482067acd55fbf6ec525cb9bdc
MD5 0a5469f821a0897e5f4d6a167e2df6cc
BLAKE2b-256 55c8d8d8d731e0b192024567b7198fb77b748821d355f3c8bf0109de27191f43

See more details on using hashes here.

File details

Details for the file zopfli-0.4.3-cp310-abi3-macosx_10_9_universal2.whl.

File metadata

File hashes

Hashes for zopfli-0.4.3-cp310-abi3-macosx_10_9_universal2.whl
Algorithm Hash digest
SHA256 88f4fbe429aad72bc206275d81fab11a097e0f951a5848d1f51083c37ea73073
MD5 4c585c042aee3343413c0c5432c5c376
BLAKE2b-256 a55fb7d81b670daf990e15a0f7551da96c3c0700f69ae6d96b0245d6a19f51f3

See more details on using hashes here.

Supported by

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