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 wrapps 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 arguements. 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.3.zip (75.8 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.1.3-cp36-cp36m-win_amd64.whl (41.1 kB view details)

Uploaded CPython 3.6mWindows x86-64

zopfli-0.1.3-cp36-cp36m-win32.whl (35.1 kB view details)

Uploaded CPython 3.6mWindows x86

zopfli-0.1.3-cp36-cp36m-manylinux1_x86_64.whl (112.6 kB view details)

Uploaded CPython 3.6m

zopfli-0.1.3-cp36-cp36m-manylinux1_i686.whl (99.9 kB view details)

Uploaded CPython 3.6m

zopfli-0.1.3-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 (66.9 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.3-cp35-cp35m-win_amd64.whl (41.1 kB view details)

Uploaded CPython 3.5mWindows x86-64

zopfli-0.1.3-cp35-cp35m-win32.whl (35.1 kB view details)

Uploaded CPython 3.5mWindows x86

zopfli-0.1.3-cp35-cp35m-manylinux1_x86_64.whl (112.5 kB view details)

Uploaded CPython 3.5m

zopfli-0.1.3-cp35-cp35m-manylinux1_i686.whl (99.7 kB view details)

Uploaded CPython 3.5m

zopfli-0.1.3-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 (66.9 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.3-cp27-cp27mu-manylinux1_x86_64.whl (110.1 kB view details)

Uploaded CPython 2.7mu

zopfli-0.1.3-cp27-cp27mu-manylinux1_i686.whl (98.2 kB view details)

Uploaded CPython 2.7mu

zopfli-0.1.3-cp27-cp27m-win_amd64.whl (35.9 kB view details)

Uploaded CPython 2.7mWindows x86-64

zopfli-0.1.3-cp27-cp27m-win32.whl (30.8 kB view details)

Uploaded CPython 2.7mWindows x86

zopfli-0.1.3-cp27-cp27m-manylinux1_x86_64.whl (110.1 kB view details)

Uploaded CPython 2.7m

zopfli-0.1.3-cp27-cp27m-manylinux1_i686.whl (98.2 kB view details)

Uploaded CPython 2.7m

zopfli-0.1.3-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 (66.8 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.3.zip.

File metadata

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

File hashes

Hashes for zopfli-0.1.3.zip
Algorithm Hash digest
SHA256 ecb69a56bb4a6b8e7f6aea25d058a9546243885aef9b232ddbbdcc35ab5fcd6e
MD5 bf2b2246a494c1cf3c48a72f9d9166e4
BLAKE2b-256 3d1d5308fd9ec13249e080dd6928c4703e902174057691ce9e61d6a6e4d63b27

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for zopfli-0.1.3-cp36-cp36m-win_amd64.whl
Algorithm Hash digest
SHA256 1112181faee831dc4ce0f5d90f44f1a61d7f3b939c42bcfd70e92e1fc7e31cc4
MD5 43b126ae964d3e05efeb7370f98774e3
BLAKE2b-256 a5993cdacf429910994d97fd0468ea14bf9ffcfb8d7e6240eaf071cb40893869

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for zopfli-0.1.3-cp36-cp36m-win32.whl
Algorithm Hash digest
SHA256 17d96f8ff23f272396313e234dc439055456aff668f9877a151f97360e51a486
MD5 7e2f0b700ebf2d9d13d804c6ca6ccc6d
BLAKE2b-256 826fa142a1625f205d81938c2ad2d82e50dbbc3c68bcac18f9afcce24c76ca2a

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for zopfli-0.1.3-cp36-cp36m-manylinux1_x86_64.whl
Algorithm Hash digest
SHA256 26530db687aedc5ed55e8df730da103e5bfbd2f6166be2574f9f774067a71d1d
MD5 64d7a0a1ecb765d15211f898f03563ea
BLAKE2b-256 6200f0e2b32d95096db4263c2edb8e7abfff871b1d441a570533bcd64d94c6e0

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for zopfli-0.1.3-cp36-cp36m-manylinux1_i686.whl
Algorithm Hash digest
SHA256 36a5b5e617e3204d6c937a575bc4f710b5c5732e1814ca4ec9d3d701d0245e15
MD5 58c081b9171c382d7684288733b9705d
BLAKE2b-256 7eaafdf1746476327571d8cb3323ffd98676778d5b71cfec98a5bb86bce1fe24

See more details on using hashes here.

File details

Details for the file zopfli-0.1.3-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.3-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 1bb03d7e3e06e3d9ff7edab4ea8d34d5852444626b6986fcb96e9e56012eedd2
MD5 41d5b2f58fae441657e49a159fe8997c
BLAKE2b-256 e92de4b84e95b6a1aa9f53acefd46ff6560c5481f992afe3dd1f86bd1a5c8c53

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for zopfli-0.1.3-cp35-cp35m-win_amd64.whl
Algorithm Hash digest
SHA256 cc9975dba3cc4874d0c0eb40f4aaef02698265db2bd5c0e8fe088e982dc7b160
MD5 e277813fee9f8b8c225b530e414f8bea
BLAKE2b-256 7eecbe5a84207090f7f30a48a36d8a13491756067226d330603f82dc42f4f8e9

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for zopfli-0.1.3-cp35-cp35m-win32.whl
Algorithm Hash digest
SHA256 5485ce6153e91e8319e9a0559ba9da64e15520e3286d53cfe1d86f99725b6ae4
MD5 7fccf3ba9cf108e7484318832bdd39d9
BLAKE2b-256 bfa4cf416c55081a69f292f621ebfc2fd2113c5616509fe6b84b44b2261bfdfc

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for zopfli-0.1.3-cp35-cp35m-manylinux1_x86_64.whl
Algorithm Hash digest
SHA256 766dfabdaf6c66ab8feb2958498d0ad25e647027c0b50e45e83fe226c0063d5a
MD5 be2772d40ee374d87b5ecd2214edbcdd
BLAKE2b-256 d62f647e2c272394d2c7b2eeae29b24192428dd91a533e8be7c92395c2542441

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for zopfli-0.1.3-cp35-cp35m-manylinux1_i686.whl
Algorithm Hash digest
SHA256 2e0c09e11e0416ec304141b9cc28e04043535ab5ff2d4ba4818143fd3dd7642b
MD5 5f4ad9e1214a34595b57806698093b3a
BLAKE2b-256 9a87f4371b7c77515f3afc414cb167ce203e6c3547897e24080af5b783dca0e5

See more details on using hashes here.

File details

Details for the file zopfli-0.1.3-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.3-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 1b4e315a9c16cd223bb04d95e49b9e272935a1c2c0bdea487473aa25c4276793
MD5 f4dba0f5dc8872c0af0c15babd87b140
BLAKE2b-256 77682ba7c1e5047e9cf0a242c3154924b35b9832c32fca1aa00c9c5625c5a7c2

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for zopfli-0.1.3-cp27-cp27mu-manylinux1_x86_64.whl
Algorithm Hash digest
SHA256 25e70428226f89d3e5105edc578a9d0273d5d84747436d829162bf357c0b3569
MD5 75ec0f6df0582bf5a66c4aead9fec353
BLAKE2b-256 75f4cbba736152f9655eed42542a6bf8bd51c2f6be3b1ef724ab2d6b5e855568

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for zopfli-0.1.3-cp27-cp27mu-manylinux1_i686.whl
Algorithm Hash digest
SHA256 9b82a74e54e6030e8692827aeb074d6ac6611e4b49ccc49ca92bd542a6cbe42c
MD5 3db2000a68d0da19b5edd90dd627bfa9
BLAKE2b-256 f753d53ee93ec63b4c05c2bdac43119bc029d645adcc06eb5839c54d35b30f87

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for zopfli-0.1.3-cp27-cp27m-win_amd64.whl
Algorithm Hash digest
SHA256 7ac513df1ff8871e65677efa1a171b033306b279d7c414405807a9b75220de18
MD5 d7a942f51dd45b2a26b474812e516684
BLAKE2b-256 5f92f0131857b699218b0af4af640afa661b11db7f783263b61def78a040a445

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for zopfli-0.1.3-cp27-cp27m-win32.whl
Algorithm Hash digest
SHA256 fb57717b0e6751b77a80a607383801f1f6a62c89dea9611a12c653ad9e03b00e
MD5 82db91f9f24931936fcb8c275c21b9ce
BLAKE2b-256 4ba4c1f477ce4143280d03e33ffd24c073d460110a01ece6fe6a82c79e8e0a77

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for zopfli-0.1.3-cp27-cp27m-manylinux1_x86_64.whl
Algorithm Hash digest
SHA256 fc2b84006fceb8fbccedee7037f152e8e5fde630f6a42f4a9e80af4d41e77482
MD5 c5bd828642edd263cfa400139c679b5b
BLAKE2b-256 0a9a37698fecf325ead296c00e430e95002f8b38a782da5146a12cb0d16d2d43

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for zopfli-0.1.3-cp27-cp27m-manylinux1_i686.whl
Algorithm Hash digest
SHA256 fc0a5c87ec4dd684affaa5945fabc3193601103bcbe13c50aa05f1769835cc0c
MD5 ce487c67d8dfb245aa25a3e5f9739687
BLAKE2b-256 4cb23924dad5ecf26635f41975e4aacaa75ce6e0280e1438e7b20c0579e0b151

See more details on using hashes here.

File details

Details for the file zopfli-0.1.3-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.3-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 ab11f137d3d202b0b12dbe12abd2ce06b3084c68f1795a614abd12f00f4ac57a
MD5 e905ca7b83ff007f298f1d49c687f8cb
BLAKE2b-256 3fb52285636186b8e8a0ef97a4e6928af0de323e3f6d7fe85eb3290c7d33f2b7

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