Skip to main content

Zopfli module for python

Project description

Travis Build Status Appveyor Build Status

PYZOPFLI

cPython bindings for zopfli.

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.1.4.zip (75.8 kB view details)

Uploaded Source

Built Distributions

zopfli-0.1.4-cp36-cp36m-win_amd64.whl (39.1 kB view details)

Uploaded CPython 3.6mWindows x86-64

zopfli-0.1.4-cp36-cp36m-win32.whl (33.2 kB view details)

Uploaded CPython 3.6mWindows x86

zopfli-0.1.4-cp36-cp36m-manylinux1_x86_64.whl (41.9 kB view details)

Uploaded CPython 3.6m

zopfli-0.1.4-cp36-cp36m-manylinux1_i686.whl (36.0 kB view details)

Uploaded CPython 3.6m

zopfli-0.1.4-cp36-cp36m-macosx_10_6_intel.macosx_10_9_intel.macosx_10_9_x86_64.macosx_10_10_intel.macosx_10_10_x86_64.whl (64.6 kB view details)

Uploaded CPython 3.6mmacOS 10.10+ Intel (x86-64, i386)macOS 10.10+ x86-64macOS 10.6+ Intel (x86-64, i386)macOS 10.9+ Intel (x86-64, i386)macOS 10.9+ x86-64

zopfli-0.1.4-cp35-cp35m-win_amd64.whl (39.1 kB view details)

Uploaded CPython 3.5mWindows x86-64

zopfli-0.1.4-cp35-cp35m-win32.whl (33.2 kB view details)

Uploaded CPython 3.5mWindows x86

zopfli-0.1.4-cp35-cp35m-manylinux1_x86_64.whl (41.9 kB view details)

Uploaded CPython 3.5m

zopfli-0.1.4-cp35-cp35m-manylinux1_i686.whl (36.0 kB view details)

Uploaded CPython 3.5m

zopfli-0.1.4-cp35-cp35m-macosx_10_6_intel.macosx_10_9_intel.macosx_10_9_x86_64.macosx_10_10_intel.macosx_10_10_x86_64.whl (64.6 kB view details)

Uploaded CPython 3.5mmacOS 10.10+ Intel (x86-64, i386)macOS 10.10+ x86-64macOS 10.6+ Intel (x86-64, i386)macOS 10.9+ Intel (x86-64, i386)macOS 10.9+ x86-64

zopfli-0.1.4-cp27-cp27mu-manylinux1_x86_64.whl (41.8 kB view details)

Uploaded CPython 2.7mu

zopfli-0.1.4-cp27-cp27mu-manylinux1_i686.whl (35.9 kB view details)

Uploaded CPython 2.7mu

zopfli-0.1.4-cp27-cp27m-win_amd64.whl (33.9 kB view details)

Uploaded CPython 2.7mWindows x86-64

zopfli-0.1.4-cp27-cp27m-win32.whl (28.8 kB view details)

Uploaded CPython 2.7mWindows x86

zopfli-0.1.4-cp27-cp27m-manylinux1_x86_64.whl (41.8 kB view details)

Uploaded CPython 2.7m

zopfli-0.1.4-cp27-cp27m-manylinux1_i686.whl (35.9 kB view details)

Uploaded CPython 2.7m

zopfli-0.1.4-cp27-cp27m-macosx_10_6_intel.macosx_10_9_intel.macosx_10_9_x86_64.macosx_10_10_intel.macosx_10_10_x86_64.whl (64.5 kB view details)

Uploaded CPython 2.7mmacOS 10.10+ Intel (x86-64, i386)macOS 10.10+ x86-64macOS 10.6+ Intel (x86-64, i386)macOS 10.9+ Intel (x86-64, i386)macOS 10.9+ x86-64

File details

Details for the file zopfli-0.1.4.zip.

File metadata

  • Download URL: zopfli-0.1.4.zip
  • Upload date:
  • Size: 75.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No

File hashes

Hashes for zopfli-0.1.4.zip
Algorithm Hash digest
SHA256 95cdbadb8732ef0881aa310079e324c22a800d59ddd44456a1cddb1d42744b62
MD5 a9571edecf351821337bd260ab4ba02c
BLAKE2b-256 dedc3543f7b6ef2a45a84dce7661967bdf314e1d5cc816ff5bde597b24ab9a7c

See more details on using hashes here.

File details

Details for the file zopfli-0.1.4-cp36-cp36m-win_amd64.whl.

File metadata

File hashes

Hashes for zopfli-0.1.4-cp36-cp36m-win_amd64.whl
Algorithm Hash digest
SHA256 810127a7307101a5137eb6fcecee11b82c23853b18625c533d1558f737aab164
MD5 664193368abd4dbc5bd7341ca39fbe21
BLAKE2b-256 4f8d4992ee8aec76ef645d89e453fbbb26f53340fd73dfef281bb9b67481adf9

See more details on using hashes here.

File details

Details for the file zopfli-0.1.4-cp36-cp36m-win32.whl.

File metadata

File hashes

Hashes for zopfli-0.1.4-cp36-cp36m-win32.whl
Algorithm Hash digest
SHA256 f5d7840833608f1be3a5f928dbcc0a5ff45ebd8040ea6177864f61a72b773423
MD5 5457b3e5cdda5049855c6e671bc09208
BLAKE2b-256 f75f0121e43110755e3f9da9b7909c2d64fc2fcf5af2d64e5361feab445325f7

See more details on using hashes here.

File details

Details for the file zopfli-0.1.4-cp36-cp36m-manylinux1_x86_64.whl.

File metadata

File hashes

Hashes for zopfli-0.1.4-cp36-cp36m-manylinux1_x86_64.whl
Algorithm Hash digest
SHA256 22e34ba3f3dfd35c5c086548ffb94548a18688ba8c0c4b7003e9efe0e666d8fc
MD5 ed6b217e8be7643b686cab20a7bf110d
BLAKE2b-256 01ba13b522508b00ba518d920eedf1ac94869af1180d10bac98a315743b41d05

See more details on using hashes here.

File details

Details for the file zopfli-0.1.4-cp36-cp36m-manylinux1_i686.whl.

File metadata

File hashes

Hashes for zopfli-0.1.4-cp36-cp36m-manylinux1_i686.whl
Algorithm Hash digest
SHA256 b263867044a817f4b9f0aa41a445b7651426cc31d52dd417f539b73404bccb92
MD5 194a49e796ccb0c3cf8beee327f4c077
BLAKE2b-256 f5857ac0eddbbdb243e03a3487b3306e491c365cefc1ebd2cb23f529d0ae174c

See more details on using hashes here.

File details

Details for the file zopfli-0.1.4-cp36-cp36m-macosx_10_6_intel.macosx_10_9_intel.macosx_10_9_x86_64.macosx_10_10_intel.macosx_10_10_x86_64.whl.

File metadata

File hashes

Hashes for zopfli-0.1.4-cp36-cp36m-macosx_10_6_intel.macosx_10_9_intel.macosx_10_9_x86_64.macosx_10_10_intel.macosx_10_10_x86_64.whl
Algorithm Hash digest
SHA256 df7f84a01c0d8c8936e764e63fd0478aa526dc405ee2ad437e633b28cf824141
MD5 abb366669d931e6ca290285f613f085c
BLAKE2b-256 f27bdc989509cf57c9c32cee2879a86376335bef413cddc17afe925911ed45f2

See more details on using hashes here.

File details

Details for the file zopfli-0.1.4-cp35-cp35m-win_amd64.whl.

File metadata

File hashes

Hashes for zopfli-0.1.4-cp35-cp35m-win_amd64.whl
Algorithm Hash digest
SHA256 b6e09ea567d1a54c1445cb0913ea3dc31a7d0918569ce2ca4655cb4898fdcf28
MD5 874be961380f253ae3f2af41842b74fd
BLAKE2b-256 3af674ccff227c1a573c86f244a16ac3696b2b16e6c66c2c1ec0c7ab94834d82

See more details on using hashes here.

File details

Details for the file zopfli-0.1.4-cp35-cp35m-win32.whl.

File metadata

File hashes

Hashes for zopfli-0.1.4-cp35-cp35m-win32.whl
Algorithm Hash digest
SHA256 b86d1ea19e8f799d943b0fe615a8932703251295d7f73dc3ada18ccfffefbaa5
MD5 b82ec2075a4296bff9bb5d2a2cf22159
BLAKE2b-256 a80f8bd9f703911aff45f14f5e4840178d11275787df982e98f4960bb133d5bf

See more details on using hashes here.

File details

Details for the file zopfli-0.1.4-cp35-cp35m-manylinux1_x86_64.whl.

File metadata

File hashes

Hashes for zopfli-0.1.4-cp35-cp35m-manylinux1_x86_64.whl
Algorithm Hash digest
SHA256 d4b5c2faf767f07e4ee7345c0d984eb6773d321ad5b5ae0efa19c2b15a26bdd8
MD5 9e21a06ba9fa04b2076de1cf1abdd557
BLAKE2b-256 a18f4562a7570503f9a5d15e5205c4be84ba7caeee8155075b25014dd8940a9a

See more details on using hashes here.

File details

Details for the file zopfli-0.1.4-cp35-cp35m-manylinux1_i686.whl.

File metadata

File hashes

Hashes for zopfli-0.1.4-cp35-cp35m-manylinux1_i686.whl
Algorithm Hash digest
SHA256 ea204478f5dd4b7c03ec8a25ac5512f5cd85b15e001724289d1676a52c4c1633
MD5 f49285a3e0ea2cb319808cb957df6fb1
BLAKE2b-256 f4bcbe5c0eb7f207bf4827b424e54f1800e6c85f3fc33309e0b01295469ff368

See more details on using hashes here.

File details

Details for the file zopfli-0.1.4-cp35-cp35m-macosx_10_6_intel.macosx_10_9_intel.macosx_10_9_x86_64.macosx_10_10_intel.macosx_10_10_x86_64.whl.

File metadata

File hashes

Hashes for zopfli-0.1.4-cp35-cp35m-macosx_10_6_intel.macosx_10_9_intel.macosx_10_9_x86_64.macosx_10_10_intel.macosx_10_10_x86_64.whl
Algorithm Hash digest
SHA256 78cd66b273654cecd1d4a1a4d7a4468424db46dcc11c840062bacc545e3cc239
MD5 6fcb0199ccbabcfc3eac67cfdba1a22e
BLAKE2b-256 9b022534d61338bc5a8044267d7b667d497538936b3143809a9a7324be0671b8

See more details on using hashes here.

File details

Details for the file zopfli-0.1.4-cp27-cp27mu-manylinux1_x86_64.whl.

File metadata

File hashes

Hashes for zopfli-0.1.4-cp27-cp27mu-manylinux1_x86_64.whl
Algorithm Hash digest
SHA256 06e08efaaf750a69b1a59c91b003d44812f3b3bbe040f12cf4295861ce5d51a8
MD5 23ce0c02a4eacb54d9e294ef8610b257
BLAKE2b-256 0798dbfed547f1fed2d50bc082cadfbd7fdbbde533b6616881152f6f4afc3c24

See more details on using hashes here.

File details

Details for the file zopfli-0.1.4-cp27-cp27mu-manylinux1_i686.whl.

File metadata

File hashes

Hashes for zopfli-0.1.4-cp27-cp27mu-manylinux1_i686.whl
Algorithm Hash digest
SHA256 2351d6ca723841520f75ccfedffe79b8c72e28552d50f2530822125c5979bd87
MD5 daa607da50ec6ecbb63ac3492a7a01a7
BLAKE2b-256 70e82b334816ee1c3d244591e242d2e8e9ae9c8388d3c6861ab4b3fd7f088b6b

See more details on using hashes here.

File details

Details for the file zopfli-0.1.4-cp27-cp27m-win_amd64.whl.

File metadata

File hashes

Hashes for zopfli-0.1.4-cp27-cp27m-win_amd64.whl
Algorithm Hash digest
SHA256 c499fe9516e6c0d589e58f2ac2cf2862f26163e06340e89a06ffb7b4d611bbb3
MD5 6166d1dc80f481dd98d7622a2f0d525b
BLAKE2b-256 87eb9438efac1524fb55cc47e6a70ee3f1b723a6a014b9ada96e2240b8a85e4c

See more details on using hashes here.

File details

Details for the file zopfli-0.1.4-cp27-cp27m-win32.whl.

File metadata

File hashes

Hashes for zopfli-0.1.4-cp27-cp27m-win32.whl
Algorithm Hash digest
SHA256 242ab7671b64ce98fba82d481586e7563119a8bc407be6b9fd3e2bca9bb66954
MD5 ee55a7de81e4346f06605187464a7a6b
BLAKE2b-256 78435f088a3c4f2037b6ee7a29b3553b12aa5a78d2bdab92053f6280fd186142

See more details on using hashes here.

File details

Details for the file zopfli-0.1.4-cp27-cp27m-manylinux1_x86_64.whl.

File metadata

File hashes

Hashes for zopfli-0.1.4-cp27-cp27m-manylinux1_x86_64.whl
Algorithm Hash digest
SHA256 7bd94b955de77a662f50c75129516344f9308ad03124012318b73a0bc698bd25
MD5 b0bffc7d61fb0faabd83148810d97863
BLAKE2b-256 46bf921ee4a932fbcab7549eee40d00147d1ee622459a866b7d35379e6853179

See more details on using hashes here.

File details

Details for the file zopfli-0.1.4-cp27-cp27m-manylinux1_i686.whl.

File metadata

File hashes

Hashes for zopfli-0.1.4-cp27-cp27m-manylinux1_i686.whl
Algorithm Hash digest
SHA256 4c6df0390201455f8dd18e8849cf8d59080a4a3247794d8b5860468547afe314
MD5 f753fea9dfeba537e86122a89905b4a8
BLAKE2b-256 b4d95ff6465f3b53847fab7376d41bd04aa192eb5aa81b3729089a7d0ad18ac3

See more details on using hashes here.

File details

Details for the file zopfli-0.1.4-cp27-cp27m-macosx_10_6_intel.macosx_10_9_intel.macosx_10_9_x86_64.macosx_10_10_intel.macosx_10_10_x86_64.whl.

File metadata

File hashes

Hashes for zopfli-0.1.4-cp27-cp27m-macosx_10_6_intel.macosx_10_9_intel.macosx_10_9_x86_64.macosx_10_10_intel.macosx_10_10_x86_64.whl
Algorithm Hash digest
SHA256 819cadefe6d59df3015ea926c7c8ffc28dcad8685ba529dfa7d702d6a2cb6560
MD5 1ac2cf552ffc673db9adb59d10013ae4
BLAKE2b-256 11edce35310a9bfd545322da7ae59a8413dfaff27105844998050b8d8538cbea

See more details on using hashes here.

Supported by

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