ZBIC compression algorithm of Nintendo Switch.
Maintained. Last release 4 months ago, commits in 3 of the last 26 weeks. Weaker on commit activity.
pip install zbicREADME as published on PyPI with version 1.0.1.post1.
ZBIC
This project provides a Python package that supports compression and decompression of the ZBIC algorithm that was first seen on the Nintendo Switch in version 22.0.0.
The zstd.c, zstd.h and zstd_errors.h files in this repository were copied from Atmosphere-NX.
Installation
The package can be installed with pip: pip3 install zbic.
API reference
def compress(data: bytes, level: int = 3) -> bytes: ...
def decompress(data: bytes) -> bytes: ...
Example usage
import zbic
data = b"Hello World!"
compressed = zbic.compress(data)
decompressed = zbic.decompress(compressed)
assert data == decompressed