Skip to main content
Join the official 2020 Python Developers SurveyStart the survey!

A Python bindings for Zopfli

Project description

A Python bindings for Zopfli.

https://img.shields.io/pypi/v/zopflipy.svg https://semaphoreci.com/api/v1/hattya/zopflipy/branches/master/badge.svg https://ci.appveyor.com/api/projects/status/98a7e7d6qlkvs6vl/branch/master?svg=true https://codecov.io/gh/hattya/zopflipy/branch/master/graph/badge.svg

Installation

$ pip install zopflipy

Requirements

  • Python 2.7 or 3.5+

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.

Download files

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

Files for zopflipy, version 1.3
Filename, size File type Python version Upload date Hashes
Filename, size zopflipy-1.3-cp27-cp27m-win32.whl (102.5 kB) File type Wheel Python version cp27 Upload date Hashes View
Filename, size zopflipy-1.3-cp27-cp27m-win_amd64.whl (132.8 kB) File type Wheel Python version cp27 Upload date Hashes View
Filename, size zopflipy-1.3-cp35-cp35m-win32.whl (87.7 kB) File type Wheel Python version cp35 Upload date Hashes View
Filename, size zopflipy-1.3-cp35-cp35m-win_amd64.whl (105.7 kB) File type Wheel Python version cp35 Upload date Hashes View
Filename, size zopflipy-1.3-cp36-cp36m-win32.whl (87.7 kB) File type Wheel Python version cp36 Upload date Hashes View
Filename, size zopflipy-1.3-cp36-cp36m-win_amd64.whl (105.8 kB) File type Wheel Python version cp36 Upload date Hashes View
Filename, size zopflipy-1.3-cp37-cp37m-win32.whl (87.7 kB) File type Wheel Python version cp37 Upload date Hashes View
Filename, size zopflipy-1.3-cp37-cp37m-win_amd64.whl (105.8 kB) File type Wheel Python version cp37 Upload date Hashes View
Filename, size zopflipy-1.3-cp38-cp38-win32.whl (87.9 kB) File type Wheel Python version cp38 Upload date Hashes View
Filename, size zopflipy-1.3-cp38-cp38-win_amd64.whl (105.9 kB) File type Wheel Python version cp38 Upload date Hashes View
Filename, size zopflipy-1.3.zip (202.7 kB) File type Source Python version None Upload date Hashes View

Supported by

Pingdom Pingdom Monitoring Google Google Object Storage and Download Analytics Sentry Sentry Error logging AWS AWS Cloud computing DataDog DataDog Monitoring Fastly Fastly CDN DigiCert DigiCert EV certificate StatusPage StatusPage Status page