Skip to main content

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 getting faster, and kinda works.

Rust API

Use the rars crate for Rust applications and libraries. Since 0.4, the lower-level rars-format, rars-codec, rars-crypto, rars-crc32, and rars-recovery crates are folded into rars; those standalone crates ended at 0.3.x. Applications should depend on rars, and command-line installs should use rars-cli.

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.

Non-solid RAR 5 and RAR 7 creation streams path inputs through bounded codec windows and disk-backed payload spools. The global compression workspace limit defaults to 256 MiB and is shared by Rayon jobs; a dictionary that cannot fit is rejected before compression starts. Temporary payloads are created beside the output archive by default.

rars a --memory-limit 128m --temp-dir /path/with/space archive.rar files...

Parallel work

Rayon worker threads process independent archive members. This 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.

Control the number of workers with --threads:

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

Measure parallel archive-member work with Criterion:

cargo bench -p rars --bench 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. Pass --threads 1 to run member work serially.

Python bindings

The workspace includes PyO3 bindings packaged as the rars Python module for Python 3.10 and newer. Independent archive members are processed in parallel.

maturin develop

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. RarBuilder.add() keeps path inputs lazy, and the common non-solid RAR 5/7 write() path writes directly instead of first constructing the complete archive in memory. add_bytes() and to_bytes() remain available as convenience wrappers.

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.

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.5.0.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.5.0-cp310-abi3-win_amd64.whl (946.7 kB view details)

Uploaded CPython 3.10+Windows x86-64

rars-0.5.0-cp310-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (1.1 MB view details)

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

rars-0.5.0-cp310-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl (994.3 kB view details)

Uploaded CPython 3.10+manylinux: glibc 2.17+ ARM64

rars-0.5.0-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.5.0.tar.gz.

File metadata

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

File hashes

Hashes for rars-0.5.0.tar.gz
Algorithm Hash digest
SHA256 cc76c28a5dc18cef09fdf1cd65f608b38d6079e1368870f55ae7ce19d106bdc4
MD5 8fce9331316ff34c3562d01894a9b5b1
BLAKE2b-256 b1f81c7bdbc90454f8c3cb6877aced7af99be410caae3a0b61e1eb6d846ae519

See more details on using hashes here.

Provenance

The following attestation bundles were made for rars-0.5.0.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.5.0-cp310-abi3-win_amd64.whl.

File metadata

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

File hashes

Hashes for rars-0.5.0-cp310-abi3-win_amd64.whl
Algorithm Hash digest
SHA256 61ef8460f615bdd719a5e1f0a52f4cf1b7d0425ca11ef0348ab4369d7261c957
MD5 14937fa027e6ce8cba4eb3f1ffcf34cb
BLAKE2b-256 04e3fa70d15b6b022eb8bb5d30a512f8f502f4b5e75fb4c82158cd047f6f7e56

See more details on using hashes here.

Provenance

The following attestation bundles were made for rars-0.5.0-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.5.0-cp310-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for rars-0.5.0-cp310-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 b7eba011ba8190252b588703cbc6ce8af1233d147ef563c92312a545c45ad369
MD5 74207b7bc6c4524cca8d0afe9d408858
BLAKE2b-256 9230d61edb724e635e1d199cca1f2f54324ac689df29df9dc8c5165580b310ef

See more details on using hashes here.

Provenance

The following attestation bundles were made for rars-0.5.0-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.5.0-cp310-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl.

File metadata

File hashes

Hashes for rars-0.5.0-cp310-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm Hash digest
SHA256 4dcc28eb6e89543c6635c2a04e9363f2bab91d345831ebbff50190642489ca33
MD5 4fdd83e032df3bf38caf3ce536ade539
BLAKE2b-256 7fe3804fa453df60eab0e23b6ce5cd272b41e710ad6c1178051dcd985caebc4b

See more details on using hashes here.

Provenance

The following attestation bundles were made for rars-0.5.0-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.5.0-cp310-abi3-macosx_10_12_x86_64.macosx_11_0_arm64.macosx_10_12_universal2.whl.

File metadata

File hashes

Hashes for rars-0.5.0-cp310-abi3-macosx_10_12_x86_64.macosx_11_0_arm64.macosx_10_12_universal2.whl
Algorithm Hash digest
SHA256 7dc3e21d8caae7119a82459a2f41cc3f88ad2f65c2692e3788de5a4cc2bd3bde
MD5 a7f0f4451715e3ec322c235890a81636
BLAKE2b-256 13d57e0ace81338f7698ed51d970f2e9ee8141346000c1e32936729f53ab3645

See more details on using hashes here.

Provenance

The following attestation bundles were made for rars-0.5.0-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.

Release history Release notifications | RSS feed

0.9.3

5 files

0.9.2

5 files

0.9.1

5 files

0.9.0

5 files

0.8.0

5 files

0.7.4

5 files

0.7.3

5 files

0.6.0

5 files

0.5.2

5 files

0.5.1

5 files

This release

0.5.0 This release

5 files

0.4.9

5 files

0.4.8

5 files

0.4.7

5 files

0.4.6

5 files

0.4.5

5 files

0.4.4

5 files

0.4.3

4 files

0.4.2

5 files

0.4.1

5 files

0.4.0

5 files

0.3.2

5 files

0.3.1

5 files

Supported by

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