Skip to content

Python bindings for the snappy google library

Notifications You must be signed in to change notification settings

bos/python-snappy

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

42 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

python-snappy

Python library for the snappy compression library from Google. This library is distributed under the New BSD License (http://www.opensource.org/licenses/bsd-license.php).

Dependencies

Build & Install

Build:

python setup.py build

Install:

python setup.py install

Or install it from PyPi:

pip install python-snappy

Run tests

nosetest test_snappy.py

Benchmarks

snappy vs. zlib

Compressing:

%timeit zlib.compress("hola mundo cruel!")
100000 loops, best of 3: 9.64 us per loop

%timeit snappy.compress("hola mundo cruel!")
1000000 loops, best of 3: 849 ns per loop

Snappy is 11 times faster than zlib when compressing

Uncompressing:

r = snappy.compress("hola mundo cruel!")

%timeit snappy.uncompress(r)
1000000 loops, best of 3: 755 ns per loop

r = zlib.compress("hola mundo cruel!")

%timeit zlib.decompress(r)
1000000 loops, best of 3: 1.11 us per loop

Snappy is twice as fast as zlib

Snappy - compression library from Google (c)
http://code.google.com/p/snappy

About

Python bindings for the snappy google library

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Python 57.5%
  • C++ 42.5%