Skip to main content

Python bindings for rars RAR archive toolkit

Project description

rars

A Rust implementation of RAR.

Current Status

rars covers the RAR lineage from early RE~^ archives through RAR 7, compression and decompression. It's not fast, but it works. ish.

CLI

Inspect, test, and extract archives:

rars info archive.rar
rars test archive.rar
rars x archive.rar out/

Create archives with specific RAR generation:

rars a --format rar29 archive.rar files...
rars a --format rar50 --solid --auto-filter archive.rar files...
rars a --format rar70 --store --volume-size 10m archive.part1.rar files...

The writer supports stored and compressed members, split volumes, passwords, header encryption where implemented, comments, RARVM filters, RAR5 quick-open records, and supported recovery records. Run rars --help for the exact option set.

Fast Builds

The optional fast feature enables safe portable SIMD paths for selected hot compression and decompression helpers, including LZ match scanning, x86 filter scanning, and CRC-32 updates. It uses Rust's experimental std::simd API, so it requires a nightly toolchain. Default builds do not enable this feature and remain stable-compatible.

Build or run the CLI with the fast path:

cargo +nightly run -p rars-cli --features fast -- info archive.rar
cargo +nightly build --workspace --features fast

Run the fast test and benchmark paths:

cargo +nightly test --workspace --features fast
cargo +nightly bench -p rars-codec --bench chunk_sizes --features fast

Parallel Builds

The optional parallel feature enables Rayon worker threads for independent archive members. It parallelizes non-solid compression planning for supported writers and buffered extraction of non-solid, non-split single archives while preserving archive order for output. Solid archives and multivolume extraction fall back to the existing sequential stream because their codec state depends on member order.

Build or run the CLI with parallel workers:

cargo run -p rars-cli --features parallel -- --threads 4 a --format rar50 archive.rar files...
cargo run -p rars-cli --features parallel -- x --threads 4 archive.rar out/
cargo test --workspace --features parallel

Measure parallel archive-member work with Criterion:

cargo bench -p rars-format --bench parallel --features parallel
cargo +nightly bench -p rars-format --bench parallel --features fast,parallel

The parallel benchmark reports 1_thread and all_threads_N cases for RAR5 multi-member compression and extraction.

When --threads is omitted, rars uses all available cores. Passing --threads to a CLI built without parallel is rejected.

Python bindings

The workspace includes PyO3 bindings packaged as the rars Python module for Python 3.10 and newer. The default Python build enables the Rust parallel feature; the optional fast feature is available for nightly Rust builds only because it relies on std::simd.

maturin develop
RUSTUP_TOOLCHAIN=nightly maturin develop --features fast

The Python API exposes a rarfile-style RarFile for listing, reading, testing, and extracting archives, plus RarBuilder for creating or rewriting archives. Rewrites are staged into a new archive; existing RAR files are not edited in place.

Development

Run the test suite:

cargo test --workspace --all-targets

Generate a local coverage report:

rustup component add llvm-tools-preview
./scripts/coverage.py

The script prints a line-coverage summary, saves it to target/coverage/summary.txt, and writes HTML output to target/coverage/html/library/index.html and target/coverage/html/cli/index.html.

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

rars-0.3.1.tar.gz (4.6 MB view details)

Uploaded Source

Built Distributions

If you're not sure about the file name format, learn more about wheel file names.

rars-0.3.1-cp310-abi3-win_amd64.whl (894.9 kB view details)

Uploaded CPython 3.10+Windows x86-64

rars-0.3.1-cp310-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (1.0 MB view details)

Uploaded CPython 3.10+manylinux: glibc 2.17+ x86-64

rars-0.3.1-cp310-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl (949.1 kB view details)

Uploaded CPython 3.10+manylinux: glibc 2.17+ ARM64

rars-0.3.1-cp310-abi3-macosx_10_12_x86_64.macosx_11_0_arm64.macosx_10_12_universal2.whl (1.9 MB view details)

Uploaded CPython 3.10+macOS 10.12+ universal2 (ARM64, x86-64)macOS 10.12+ x86-64macOS 11.0+ ARM64

File details

Details for the file rars-0.3.1.tar.gz.

File metadata

  • Download URL: rars-0.3.1.tar.gz
  • Upload date:
  • Size: 4.6 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for rars-0.3.1.tar.gz
Algorithm Hash digest
SHA256 16955a7f21c1f7a4dd1c01d25ca9acb355584dfeac2bdf82757876dc2eb338d7
MD5 a24cadada0e121064c8ca9bd99f9df40
BLAKE2b-256 791bc3332c3db5d875655987e70c8f481736e79b28f1dce22ae8bc6fb28ff794

See more details on using hashes here.

Provenance

The following attestation bundles were made for rars-0.3.1.tar.gz:

Publisher: release.yml on bitplane/rars

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file rars-0.3.1-cp310-abi3-win_amd64.whl.

File metadata

  • Download URL: rars-0.3.1-cp310-abi3-win_amd64.whl
  • Upload date:
  • Size: 894.9 kB
  • Tags: CPython 3.10+, Windows x86-64
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for rars-0.3.1-cp310-abi3-win_amd64.whl
Algorithm Hash digest
SHA256 8602c28c9aa077b17b4061e101f3cade18ff8c457ff3e84102bbb116db70509a
MD5 a54a45f8524f517c273ee7109ed05213
BLAKE2b-256 c0a147f94d3f2e73a5b661dcdb64c4d83815615fab08b64d0ef1f5178c256b18

See more details on using hashes here.

Provenance

The following attestation bundles were made for rars-0.3.1-cp310-abi3-win_amd64.whl:

Publisher: release.yml on bitplane/rars

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file rars-0.3.1-cp310-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for rars-0.3.1-cp310-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 fc0d5276b1f7082ea03dfc2c7816c741600c072c6ee04b6db977b208d68b9100
MD5 51f44e7386add0985c513de091dba575
BLAKE2b-256 6143b96345859443503dca89624c26b41cd4ff25a20b41c393911ec0b5a7b10e

See more details on using hashes here.

Provenance

The following attestation bundles were made for rars-0.3.1-cp310-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl:

Publisher: release.yml on bitplane/rars

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file rars-0.3.1-cp310-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl.

File metadata

File hashes

Hashes for rars-0.3.1-cp310-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm Hash digest
SHA256 1c593d031ca708693b0657916ea1a758dd07bb55124b22242d45fa0138526b2c
MD5 fac95b6ab395c565c6f544a9e26d7d12
BLAKE2b-256 1f198c4b5943ddd7ddc7878a9796b25d1542dbcb613e9e35bc886976b709cad9

See more details on using hashes here.

Provenance

The following attestation bundles were made for rars-0.3.1-cp310-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl:

Publisher: release.yml on bitplane/rars

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file rars-0.3.1-cp310-abi3-macosx_10_12_x86_64.macosx_11_0_arm64.macosx_10_12_universal2.whl.

File metadata

File hashes

Hashes for rars-0.3.1-cp310-abi3-macosx_10_12_x86_64.macosx_11_0_arm64.macosx_10_12_universal2.whl
Algorithm Hash digest
SHA256 e3e69e8e3fb65366ddba77a419fc574a9760d76d614f16722b26902412b8ba19
MD5 d5f19423654ea61b7199ef2a71591d74
BLAKE2b-256 b3d5128adc694678c38beb702fcc8e317a7d83bf7f98b7469a4e9c00d809c9b2

See more details on using hashes here.

Provenance

The following attestation bundles were made for rars-0.3.1-cp310-abi3-macosx_10_12_x86_64.macosx_11_0_arm64.macosx_10_12_universal2.whl:

Publisher: release.yml on bitplane/rars

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

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