Metadata-Version: 2.4
Name: lzsslib
Version: 0.0.5
Summary: A library for inflating and deflating LZSS (Lempel, Ziv, Storer, Szymanski) buffers.
Project-URL: Source Code, https://github.com/antoniovazquezblanco/lzsslib/
Project-URL: Issue Tracker, https://github.com/antoniovazquezblanco/lzsslib/issues
Author-email: Antonio Vázquez <antoniovazquezblanco@gmail.com>
Maintainer-email: Antonio Vázquez <antoniovazquezblanco@gmail.com>
License: GPL-3.0-or-later
Classifier: Development Status :: 4 - Beta
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: GNU General Public License v3 or later (GPLv3+)
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python
Requires-Python: >=3.7
Requires-Dist: bitstring>=4.0.1
Description-Content-Type: text/markdown

# lzsslib

[![Build](https://github.com/antoniovazquezblanco/lzsslib/actions/workflows/build.yml/badge.svg)](https://github.com/antoniovazquezblanco/lzsslib/actions/workflows/build.yml)
[![PyPI](https://img.shields.io/pypi/v/lzsslib)](https://pypi.org/project/lzsslib/)
[![Snyk](https://snyk.io/advisor/python/lzsslib/badge.svg)](https://snyk.io/advisor/python/lzsslib)
[![License: GPL v3](https://img.shields.io/badge/License-GPLv3-blue.svg)](LICENSE.md)

Lzsslib is an small library for inflating and deflating LZSS (Lempel, Ziv, Storer, Szymanski) buffers.

The LZSS format is originally described in a paper titled ["Data Compression via Textual Substitution" published in Journal of the ACM, 29(4):928-951, 1982 by J.A. Storer and T.G. Szymanski.](https://doi.org/10.1145/322344.322346)

## Installing

Install and update using `pip`:

```bash
$ pip install -U lzsslib
```

## Usage

The following example shows how to decompress a file using default options.

```python
from pathlib import Path
from lzsslib.decompress import LzssDecompressor

# Create a decompressor object with default options
decomp = LzssDecompressor()

# Open an input and output files
fin = Path('input.lzss').open(mode='rb')
fout = Path('output.bin').open(mode='wb')

# Read the input, decompress and write
while (buffer := fin.read(1024)):
    out = decomp.decompress(buffer, remaining_size)
    fout.write(out)

# Ensure output is written and close
fout.flush()
fin.close()
fout.close()
```

## Links

- PyPI Releases: https://pypi.org/project/lzsslib/
- Source Code: https://github.com/antoniovazquezblanco/lzsslib
- Issue Tracker: https://github.com/antoniovazquezblanco/lzsslib/issues
