Skip to content
/ pylzf Public

Python 3 bindings for liblzf, a free, fast, easy to embed data compression library.

License

Notifications You must be signed in to change notification settings

00xc/pylzf

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

pylzf

Python 3 bindings for liblzf. From the liblzf homepage:

LibLZF is a very small data compression library. It consists of only two .c and two .h files and is very easy to incorporate into your own programs. The compression algorithm is very, very fast, yet still written in portable C.

LibLZF is an ideal library for the following applications:

  • Fast, real-time compression, where liblzf can save I/O without costing too much CPU time.
  • Block compression. If you have repeated blocks of data (IP packets, application state etc..), then liblzf is ideal to decrease the size at a very small cost, as liblzf is basically free on modern cpus.

Installation

$ git clone https://github.com/00xc/pylzf.git
$ cd pylzf && python3 -m pip install .

Usage

Using pylzf is extremely simple. Its API consists of two functions, compress and decompress:

import os
import pylzf

random_data = os.urandom(1024)
compressed_data = pylzf.compress(random_data)
decompressed_data = pylzf.decompress(compressed_data)

assert(random_data == decompressed_data)

About

Python 3 bindings for liblzf, a free, fast, easy to embed data compression library.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published