Skip to content

Commit

Permalink
Merge pull request #136 from martindurant/streams
Browse files Browse the repository at this point in the history
Streams
  • Loading branch information
martindurant authored Feb 28, 2024
2 parents 0862b62 + 3e4d49b commit c6d2a7d
Show file tree
Hide file tree
Showing 9 changed files with 61 additions and 656 deletions.
81 changes: 6 additions & 75 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -10,27 +10,12 @@ Dependencies

* cramjam

* crc32c
* Supports Python >=3.8

* Supports Python 3
Install
=======

Build & Install
===============

Build:

::

python setup.py build

Install:

::

python setup.py install


Or install it from PyPi:
Install it from PyPi:

::

Expand All @@ -50,35 +35,7 @@ Run tests
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
See ``cramjam`` for speed tests.

Commandline usage
=================
Expand Down Expand Up @@ -108,30 +65,4 @@ You can get help by running


Snappy - compression library from Google (c)
http://google.github.io/snappy

Frequently Asked Questions
==========================

**How to install it on Mac OS X?**

It has been reported a few times (Issue #7 and #23) that it can't be installed correctly the library in Mac.
The procedure should be,

::

$ brew install snappy # snappy library from Google
$ CPPFLAGS="-I/usr/local/include -L/usr/local/lib" pip install python-snappy

Try this command if libstdc++ is deprecated

::
$ CPPFLAGS="-I/usr/local/include -L/usr/local/lib -stdlib=libc++ " pip install python-snappy

Or this command in Apple Silicon:

::
$ CPPFLAGS="-I/opt/homebrew/include -L/opt/homebrew/lib" pip install python-snappy
http://google.github.io/snappy
8 changes: 4 additions & 4 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,23 +31,23 @@

import os

version = '0.7.0'
version = '0.7.1'
long_description = """
Python bindings for the snappy compression library from Google.
More details about Snappy library: http://google.github.io/snappy
"""

packages = ['snappy']
install_requires = ['cramjam>=2.6.0', 'crc32c']
setup_requires = ['cramjam>=2.6.0', 'crc32c']
install_requires = ["cramjam"]
setup_requires = ['cramjam>=2.6.0']

setup(
name='python-snappy',
version=version,
author='Andres Moreira',
author_email='[email protected]',
url='http://github.com/andrix/python-snappy',
url='http://github.com/intake/python-snappy',
description='Python library for the snappy compression library from Google',
long_description=long_description,
keywords='snappy, compression, google',
Expand Down
7 changes: 1 addition & 6 deletions src/snappy/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,4 @@
isValidCompressed,
)

from .hadoop_snappy import (
stream_compress as hadoop_stream_compress,
stream_decompress as hadoop_stream_decompress,
)

__version__ = '0.7.0'
__version__ = '0.7.1'
216 changes: 0 additions & 216 deletions src/snappy/hadoop_snappy.py

This file was deleted.

Loading

0 comments on commit c6d2a7d

Please sign in to comment.