Skip to content
Browse files

updating README to reflect cmdline usage

  • Loading branch information...
1 parent f14a218 commit e898f7639a4f728a1d9326cde6d66906a3dde0c4 @jtolds jtolds committed Dec 23, 2012
Showing with 31 additions and 3 deletions.
  1. +30 −2 README.rst
  2. +1 −1 snappy.py
View
32 README.rst
@@ -1,7 +1,7 @@
python-snappy
=============
-Python library for the snappy compression library from Google.
+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).
@@ -11,6 +11,8 @@ Dependencies
* snappy library >= 1.0.2 (or revision 27)
http://code.google.com/p/snappy/
+* Supports Python 2.7 and Python 3
+
Build & Install
===============
@@ -30,7 +32,7 @@ Install:
Or install it from PyPi:
::
-
+
pip install python-snappy
Run tests
@@ -73,6 +75,32 @@ Benchmarks
**Snappy** is **twice** as fast as zlib
+Commandline usage
+=================
+
+You can invoke Python Snappy to compress or decompress files or streams from
+the commandline after installation as follows
+
+Compressing and decompressing a file:
+
+::
+
+ $ python -m snappy -c uncompressed_file compressed_file.snappy
+ $ python -m snappy -d compressed_file.snappy uncompressed_file
+
+Compressing and decompressing a stream:
+
+::
+
+ $ cat uncompressed_data | python -m snappy -c > compressed_data.snappy
+ $ cat compressed_data.snappy | python -m snappy -d > uncompressed_data
+
+You can get help by running
+
+::
+
+ $ python -m snappy --help
+
Snappy - compression library from Google (c)
http://code.google.com/p/snappy
View
2 snappy.py
@@ -259,7 +259,7 @@ def stream_decompress(src, dst, blocksize=_STREAM_TO_STREAM_BLOCK_SIZE):
def cmdline_main():
"""This method is what is run when invoking snappy via the commandline.
- Try python -msnappy --help
+ Try python -m snappy --help
"""
import sys
if (len(sys.argv) < 2 or len(sys.argv) > 4 or "--help" in sys.argv or

0 comments on commit e898f76

Please sign in to comment.
Something went wrong with that request. Please try again.