This is a pre-production deployment of Warehouse, however changes made here WILL affect the production instance of PyPI.
Latest Version Dependencies status unknown Test status unknown Test coverage unknown
Project Description


This package provides bindings for the lz4 compression library by Yann Collet.

Code specific to this project is covered by the BSD 3-Clause License


The package is hosted on PyPI:

$ pip install lz4
$ easy_install lz4


The library is pretty simple to use:

>>> import lz4
>>> compressed_data = lz4.dumps(data)
>>> data == lz4.loads(compressed_data)

Methods and Constants

The bindings provides some aliases too:

>>> import lz4
>>> lz4.LZ4_compress == lz4.compress == lz4.dumps
>>> lz4.LZ4_uncompress == lz4.uncompress == z4.decompress == lz4.loads
>>> lz4.VERSION == lz4.__version__  # e.g. "0.7.0"

Is it fast ?

Yes. Here are the results on my 2011 Macbook Pro i7 with lz4.c as input data:

$ python tests/
Data Size:
  Input: 24779
  LZ4: 10152 (0.41)
  Snappy: 9902 (0.40)
  LZ4 / Snappy: 1.025247
Benchmark: 200000 calls
  LZ4 Compression: 9.737272s
  Snappy Compression: 18.012336s
  LZ4 Decompression: 2.686854s
  Snappy Decompression : 5.146867s

Important note

Because LZ4 doesn’t define a container format, the python bindings will insert the original data size as an integer at the start of the compressed payload, like most bindings do anyway (Java…)

Release History

Release History


This version

History Node

TODO: Figure out how to actually get changelog content.

Changelog content for this version goes here.

Donec et mollis dolor. Praesent et diam eget libero egestas mattis sit amet vitae augue. Nam tincidunt congue enim, ut porta lorem lacinia consectetur. Donec ut libero sed arcu vehicula ultricies a non tortor. Lorem ipsum dolor sit amet, consectetur adipiscing elit.

Show More

Download Files

Download Files

TODO: Brief introduction on what you do with files - including link to relevant help section.

File Name & Checksum SHA256 Checksum Help Version File Type Upload Date
lz4a-0.7.0.tar.gz (28.5 kB) Copy SHA256 Checksum SHA256 Source Oct 12, 2015

Supported By

WebFaction WebFaction Technical Writing Elastic Elastic Search Pingdom Pingdom Monitoring Dyn Dyn DNS HPE HPE Development Sentry Sentry Error Logging CloudAMQP CloudAMQP RabbitMQ Heroku Heroku PaaS Kabu Creative Kabu Creative UX & Design Fastly Fastly CDN DigiCert DigiCert EV Certificate Rackspace Rackspace Cloud Servers DreamHost DreamHost Log Hosting