skip to navigation
skip to content

zopflipy 1.0

A Python bindings for Zopfli

A Python bindings for Zopfli.

Requirements

  • Python 2.7 or 3.3+

Installation

$ pip install zopflipy

Usage

ZopfliCompressor:

>>> import zopfli
>>> c = zopfli.ZopfliCompressor(zopfli.ZOPFLI_FORMAT_DEFLATE)
>>> z = c.compress(b'Hello, world!') + c.flush()
>>> d = zopfli.ZopfliDecompressor(zopfli.ZOPFLI_FORMAT_DEFLATE)
>>> d.decompress(z) + d.flush()
b'Hello, world!''

ZopfliDeflater:

>>> import zopfli
>>> c = zopfli.ZopfliDeflater()
>>> z = c.compress(b'Hello, world!') + c.flush()
>>> d = zopfli.ZopfliDecompressor(zopfli.ZOPFLI_FORMAT_DEFLATE)
>>> d.decompress(z) + d.flush()
b'Hello, world!''

ZopfliPNG:

>>> import zopfli
>>> png = zopfli.ZopfliPNG()
>>> with open('in.png', 'rb') as fp:
...     data = fp.read()
>>> len(png.optimize(data)) < len(data)
True

License

ZopfliPy is distributed under the terms of the Apache License, Version 2.0.

 
File Type Py Version Uploaded on Size
zopflipy-1.0-cp27-cp27m-win32.whl (md5) Python Wheel cp27 2017-09-26 84KB
zopflipy-1.0-cp27-cp27m-win_amd64.whl (md5) Python Wheel cp27 2017-09-26 109KB
zopflipy-1.0-cp33-cp33m-win32.whl (md5) Python Wheel cp33 2017-09-26 84KB
zopflipy-1.0-cp33-cp33m-win_amd64.whl (md5) Python Wheel cp33 2017-09-26 103KB
zopflipy-1.0-cp34-cp34m-win32.whl (md5) Python Wheel cp34 2017-09-26 84KB
zopflipy-1.0-cp34-cp34m-win_amd64.whl (md5) Python Wheel cp34 2017-09-26 102KB
zopflipy-1.0-cp35-cp35m-win32.whl (md5) Python Wheel cp35 2017-09-26 78KB
zopflipy-1.0-cp35-cp35m-win_amd64.whl (md5) Python Wheel cp35 2017-09-26 95KB
zopflipy-1.0-cp36-cp36m-win32.whl (md5) Python Wheel cp36 2017-09-26 78KB
zopflipy-1.0-cp36-cp36m-win_amd64.whl (md5) Python Wheel cp36 2017-09-26 95KB
zopflipy-1.0.zip (md5) Source 2017-09-26 172KB