Skip to main content

Library for data (de)compression using Nintendo's lzss11 algorithm

Project description

nlzss11

Library for data compression using Nintendo's variant of the lzss algorithm

Reference implementation: nlzss

Usage

nlzss11 can be installed with pip3 install nlzss11.

nlzss11.get_uncompressed_size(data)

Returns the size in bytes of the file if uncompressed or None if the bytes are not a valid Nintendo LZSS 11 compressed file

nlzss11.decompress(data)

Decompresses Yaz0-compressed data from a bytes-like object data. Returns a bytes object containing the uncompressed data.

nlzss11.decompress_unsafe(data)

Decompresses Yaz0-compressed data from a bytes (not bytes-like) object data. Returns a bytes object containing the uncompressed data.

Unlike nlzss11.decompress, this function assumes that the input data is well-formed. In exchange for slightly improved performance, no sanity checks are performed. Warning: Do not use on untrusted data.

nlzss11.compress(data, level=7)

Compresses a bytes-like object data. Returns a bytes-like object containing the compressed data.

level is the compression level (6-9). 6 is fastest and 9 is slowest. Higher compression levels result in better compression. 7 is a good compromise between compression ratio and performance.

Project information

This project is a fork from the amazing syaz0 Project, just modified to match the algorithm found in The Legend of Zelda: Skyward Sword.

Building from source

Building nlzss11 from source requires:

  • CMake 3.10+
  • A compiler that supports C++17
  • Everything needed to build zlib-ng
  • pybind11 2.4+ (including CMake config files)
  • setuptools

When no binary build is available, pip will automatically build from source during the install process.

To build and install from source run pip3 install ..

License

This software is licensed under the terms of the GNU General Public License, version 2 or later.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

nlzss11-1.1.tar.gz (701.8 kB view hashes)

Uploaded Source

Built Distributions

nlzss11-1.1-cp38-cp38-win_amd64.whl (124.5 kB view hashes)

Uploaded CPython 3.8 Windows x86-64

nlzss11-1.1-cp38-cp38-manylinux2014_x86_64.whl (167.4 kB view hashes)

Uploaded CPython 3.8

nlzss11-1.1-cp38-cp38-manylinux2010_x86_64.whl (156.1 kB view hashes)

Uploaded CPython 3.8 manylinux: glibc 2.12+ x86-64

nlzss11-1.1-cp37-cp37m-win_amd64.whl (124.3 kB view hashes)

Uploaded CPython 3.7m Windows x86-64

nlzss11-1.1-cp37-cp37m-manylinux2014_x86_64.whl (170.3 kB view hashes)

Uploaded CPython 3.7m

nlzss11-1.1-cp37-cp37m-manylinux2010_x86_64.whl (157.9 kB view hashes)

Uploaded CPython 3.7m manylinux: glibc 2.12+ x86-64

nlzss11-1.1-cp36-cp36m-win_amd64.whl (124.3 kB view hashes)

Uploaded CPython 3.6m Windows x86-64

nlzss11-1.1-cp36-cp36m-manylinux2014_x86_64.whl (170.3 kB view hashes)

Uploaded CPython 3.6m

nlzss11-1.1-cp36-cp36m-manylinux2010_x86_64.whl (157.8 kB view hashes)

Uploaded CPython 3.6m manylinux: glibc 2.12+ x86-64

nlzss11-1.1-cp35-cp35m-manylinux2010_x86_64.whl (152.3 kB view hashes)

Uploaded CPython 3.5m manylinux: glibc 2.12+ x86-64

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page