Git Product home page Git Product logo

python-lzw's Introduction

This is the README file for lzw, small, low level, pure python module
for simple, stream-friendly data compression, built around iterators.
Please see the accompanying LICENSE.txt file for license terms.

lzw currently requires python 2.7 or python 3.4 to run.

Before going on, potential users are advised to take a look at the
gzip, zlib, bz2, zipfile, and tarfile modules available in the python
standard library, which are dynamite-fast, mature, well supported, and
generally awesome.

Seriously, check them out! You've already got them!

----

This software is in Pre-Alpha release, any bug reports (or even
stories about ways you use the software, or wish you could use the
software) are appreciated! Mail [email protected] with your
info.

---

INSTALLING

you should be able to install this package with

   python setup.py install

----

Ok, moving on.

The easiest way to use lzw is probably something like this

>>> import lzw
>>>
>>> infile = lzw.readbytes("My Uncompressed File.txt")
>>> compressed = lzw.compress(infile)
>>> lzw.writebytes("My Compressed File.lzw", compressed)
>>>
>>> # Then later (or elsewhere)
>>> infile = lzw.readbytes("My Compressed File.lzw", compressed)
>>> uncompressed = lzw.decompress(infile)
>>> for bt in uncompressed:
>>> 	do_something_awesome_with_this_byte(bt)
>>>

See the module documentation for more details.

---

The underlying compression algorithm for this module is as expressed
in section 13 of the TIFF 6.0 specification, pages 58 to 62, available
at the time of this writing on-line at

    http://partners.adobe.com/public/developer/en/tiff/TIFF6.pdf

Wherever possible, I've tried to adhere to the algorithm and
conventions that are described (in exhaustive and yet very readable
detail!) in that document, even when it gets a bit Tiff
specific. Where there are differences, they are likely bugs in this
code.

---

Current dev priorities:

- Hunt down some potential user applications, see why they're
  potential rather than actual, and then get on that bus.


For now

- Keep things as simple and intelligible as possible
- Adhere as closely to the TIFF spec as is reasonable
- Keep memory use low for good use of the iterators
- Stay in pure python
- Faster would be nicer, though...


python-lzw's People

Contributors

johnpaulett avatar joeatwork avatar

Watchers

babooppa6 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.