PRO-PACK implementation in Python
Project description
PRO-PACK for Python
Based on RNC ProPack Source.
I wanted something I could install from pypi and I could import in Python projects. So here it is.
Test data can be found in this repo
Install
pip install propack
Usage
Python API
from propack import pack, unpack, parse_header
# Compress
raw = open('data.bin', 'rb').read()
packed = pack(raw, method=1) # method 1 (Huffman+LZ77) or 2
# Decompress
original = unpack(packed)
assert original == raw
# Inspect header
header = parse_header(packed)
print(f'method={header.method} {header.packed_size} -> {header.unpacked_size} bytes')
CLI
# Compress
propack pack data.bin # -> data.rnc1
propack pack data.bin -m 2 # -> data.rnc2
propack pack data.bin -m 1 output.rnc # explicit output
# Decompress
propack unpack data.rnc1 # -> data.bin
propack unpack data.rnc1 output.bin # explicit output
# Inspect
propack info data.rnc1 # show header fields
# Scan a file for embedded RNC data
propack scan rom.bin
# Extract all embedded RNC blocks
propack extract rom.bin -o output_dir/
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
propack-0.1.0.tar.gz
(11.1 kB
view details)
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
propack-0.1.0-py3-none-any.whl
(13.6 kB
view details)
File details
Details for the file propack-0.1.0.tar.gz.
File metadata
- Download URL: propack-0.1.0.tar.gz
- Upload date:
- Size: 11.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
cbbe985af4169e818ab1f048fbf397217e01345267893617ff9a4175361418d0
|
|
| MD5 |
e144f7c17c2b4b0d38a079ebc526eea6
|
|
| BLAKE2b-256 |
e874c50ecc34654fc534d02facfd13a8d806798ca7cd398babf3c5cfe0890e25
|
File details
Details for the file propack-0.1.0-py3-none-any.whl.
File metadata
- Download URL: propack-0.1.0-py3-none-any.whl
- Upload date:
- Size: 13.6 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
8d6e1373675b5c54b50bb49cc18df473bc130796e03f8318aade0fb7182a8cf7
|
|
| MD5 |
e21741ef4ba833e37c89e5bf5fa19124
|
|
| BLAKE2b-256 |
4539bf3a186143bf6707fd7ea9a86e5f33ff6aa048585f8b39cbe7b01ed18b14
|