Skip to main content

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/

🔗 Links

Release files for propack 0.2.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for propack 0.2.0
File Size Uploaded
propack-0.2.0.tar.gz 11.4 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for propack 0.2.0
File Interpreter ABI Platform
propack-0.2.0-py3-none-any.whl Python 3 none any Details

Total release size: 25.4 kB

Release files / propack-0.2.0.tar.gz

Download URL propack-0.2.0.tar.gz
Size 11.4 kB
Tags Source
SHA-256 checksum
How to use checksums
e500c1a908b1ffa8cba89b1ba2bb8710e948499603e37c7e1a21753acea92fc5
BLAKE2b-256 checksum
How to use checksums
b83d15fee798b0c418abedd21160b401fa62a7fecc098dbf8d7e95417d57056a
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.10.21

Release files / propack-0.2.0-py3-none-any.whl

Download URL propack-0.2.0-py3-none-any.whl
Size 14.0 kB
Tags Python 3
SHA-256 checksum
How to use checksums
f7fde8528a9ecaf88ae8c1b55643d5ab25a7184c348f3dbe02dbeae54519f368
BLAKE2b-256 checksum
How to use checksums
160c599a41111d72c318e1bd2faafabd10fbffa2fe9006a305727e00a4c57f71
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.10.21

Release history Release notifications | RSS feed

This release

0.2.0 This release

2 release files

0.1.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page