rars
A Rust implementation of RAR.
rars is free software for compression, decompression and recovery of RAR
archives. It supports all the archive types I could find - from the early RE~^
ones from the DOS days all the way through to RAR 7. It comes with a Rust
library, a CLI, Python and TypeScript bindings.
It started as an agentic development experiment, and has since matured as it gained some users. It's still a bit slower than WinRAR, uses more memory and has slightly worse compression. It could use more testing at volume, too. Other than that it's in pretty good shape.
Usage
The API is in the rars crate, which is used by the Python and TypeScript
bindings. For the CLI, run:
cargo install rars-cli.
To inspect, test, and extract archives:
rars info archive.rar
rars test archive.rar
rars x archive.rar out/
These commands accept parsing and decoding limits; see CLI reader controls.
To create archives with a specific RAR generation:
rars a --format rar29 archive.rar files...
rars a --format rar29 --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,
comments, RARVM filters, RAR5 quick-open records, recovery records and header
encryption. There are a lot of things I won't list here, so run rars --help
for more details.
On Unix, native filenames and legacy archive names can contain non-UTF-8 bytes.
The CLI, Python extraction and Rust path adapters preserve those bytes. RAR5/7
filesystem inputs use the format's reversible Unix byte mapping; member metadata
and lookup keys retain the encoded archive identity. Use byte names (or Python
RarInfo objects) for exact lookup, rather than lossy display names.
Legacy code pages are not guessed. Windows supports Unicode names; extracting
non-Unicode legacy byte names there still requires caller-selected decoding.
Use --legacy-name-encoding cp850 or the corresponding binding option; see
legacy filename decoding for supported encodings and
preservation semantics.
Library features
All features are enabled by default. For a sequential reader without encoders, recovery algorithms, cryptographic dependencies or Rayon:
[dependencies]
rars = { version = "0.10", default-features = false }
Enable encrypted reading independently when needed:
rars = { version = "0.10", default-features = false, features = ["encryption"] }
| Feature | Adds |
|---|---|
| None | Parsing and sequential decoding for RAR 1.3–7, metadata, checksums, comments, solid/split archives, cancellation and reader resource policies |
write |
Encoders, Builder, writer resources, archive writing and rewriting |
recovery |
Recovery generation and repair; recovery metadata remains readable without this feature |
encryption |
Encrypted headers and payloads, password derivation and cryptographic dependencies |
parallel |
Rayon execution on supported native targets |
Every combination is supported. Writing encrypted archives requires write and
encryption; writing recovery records requires write and recovery. Recovery
repair works without write. Without parallel, buffered extraction APIs use
sequential execution; bare WebAssembly also runs sequentially. Writing and
recovery enable entropy support, including encrypted header reconstruction during
repair; encrypted reading alone does not need entropy.
Without encryption, plaintext headers still expose encrypted member metadata.
Opening encrypted headers or extracting encrypted payloads returns
Error::FeatureDisabled { feature: "encryption" }, even if a password is supplied.
Recovery operations similarly return a disabled-feature error without recovery.
These errors have ErrorKind::UnsupportedFeature. Writer and encoder APIs are
absent when write is disabled. RAR 1.3's fixed archive-comment transformation
remains available to readers without encryption.
Cargo unifies features across consumers of the same crate. Another dependency
that enables rars defaults can therefore restore the full build. Use
cargo tree -e features to inspect the resolved configuration. The CLI, Python
and npm bindings retain their full builds. See the
independent consumer checks for reproduction
commands that avoid workspace feature unification.
Reader resources
Reader workspace limits are available as Rust
ArchiveReadOptions::with_max_reader_workspace_bytes, CLI
--max-reader-workspace-bytes, Python ReadOptions(max_reader_workspace_bytes=...)
and npm maxReaderWorkspaceBytes. They limit aggregate decoder workspace and
queued parallel results across an extraction call or volume set. The default is unlimited. Logical output, parsed sources and
caller output storage have separate costs; see the
reader resource contract.
Writer execution
For writer execution modes, workspace estimates and retained storage, see WRITER_EXECUTION.md.
RAR5/7 writers accept an optional aggregate managed-memory ceiling: Rust
WriterResources::with_max_memory_bytes, CLI rars a --max-memory 256m,
Python RarBuilder(max_memory_bytes=256 << 20), and npm
new RarWriter({ maxMemoryBytes: 256 * 1024 * 1024 }).
The default is unlimited. This counts writer execution allocations and retained
output, including binding copy peaks; caller inputs, sinks, runtime and allocator
overhead are excluded. Legacy writers refuse the policy. Reader and rewrite
staging limits are separate. See the resource contract
for ownership boundaries and the separate estimated-workspace policy.
Bindings
Python bindings are published to pypi, so you
can pip install rars. To build locally, it's just python.
RarBuilder.from_archive preserves supported RAR5/7 metadata and archive settings
by default, plus a limited subset of ordinary RAR2.9–4.x archives. Unsupported
preservation is rejected. Pass preserve=False explicitly
to convert to unencrypted RAR5, including from older archives. This default change
is intended for the next minor release; see the rewrite contract.
RarBuilder writes accept cancellation=rars.CancellationToken() for
cooperative cancellation from another Python thread, with or without progress
callbacks. Reader operations accept options=rars.ReadOptions(...) for
cancellation, output ceilings and RAR5/7 decoder limits. See the
reader controls and rewrite contract.
Repair operations also accept cancellation=; see repair cancellation.
For JS it's built to WebAssembly and published to
npm;
npm install @bitplane/rars. It reads and writes in the browser and in Node,
with no native module. To build locally, type just npm.
Licensed under the Apache License, Version 2.0.
Metadata
Release files for rars 0.10.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| rars-0.10.0.tar.gz | 5.3 MB | Details |
Built distributions (wheels)
| File | Reset | |||
|---|---|---|---|---|
| rars-0.10.0-cp310-abi3-win_amd64.whl | CPython 3.10 | abi3 | Windows x86-64 | Details |
| rars-0.10.0-cp310-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl | CPython 3.10 | abi3 | Linux glibc 2.17+ x86-64 | Details |
| rars-0.10.0-cp310-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl | CPython 3.10 | abi3 | Linux glibc 2.17+ ARM64 | Details |
| rars-0.10.0-cp310-abi3-macosx_10_12_x86_64.macosx_11_0_arm64.macosx_10_12_universal2.whl | CPython 3.10 | abi3 | macOS 10.12+ universal2 (ARM64, x86-64), macOS 10.12+ x86-64, macOS 11.0+ ARM64 | Details |
Total release size: 26.4 MB
Release files / rars-0.10.0.tar.gz
| Download URL | rars-0.10.0.tar.gz |
|---|---|
| Size | 5.3 MB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
0e03b88d9126cac00c3c1a7acf8fb259456817bea6c46c8935bf2e60f13115bb
|
|
BLAKE2b-256 checksum How to use checksums |
05d1cce0e5fa32bfe04bae9992cc19dc52621604254411a6e54c1febef8008a5
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Oct 3, 2026.
Transparency logRelease files / rars-0.10.0-cp310-abi3-win_amd64.whl
| Download URL | rars-0.10.0-cp310-abi3-win_amd64.whl |
|---|---|
| Size | 2.0 MB |
| Tags | CPython 3.10 Windows x86-64 abi3 |
|
SHA-256 checksum How to use checksums |
7feb60a84d08fa0910855a43e06963508c8c1e7d7b67c65f37a67bd0c153d9a2
|
|
BLAKE2b-256 checksum How to use checksums |
f5660684f69b07ffe83d7e84f2725cf0d5617e12591d96c12e14845cdfedd365
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Oct 3, 2026.
Transparency logRelease files / rars-0.10.0-cp310-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
| Download URL | rars-0.10.0-cp310-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl |
|---|---|
| Size | 7.6 MB |
| Tags | CPython 3.10 Linux glibc 2.17+ x86-64 abi3 |
|
SHA-256 checksum How to use checksums |
bc41915c3560904289b9a2f9ed9ef0c9a4f18af859dc193d8b738b42aea3148c
|
|
BLAKE2b-256 checksum How to use checksums |
46db218430681b830e83b867ed569a49d91f4b58b3a138d317777e50efbfa028
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Oct 3, 2026.
Transparency logRelease files / rars-0.10.0-cp310-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
| Download URL | rars-0.10.0-cp310-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl |
|---|---|
| Size | 7.0 MB |
| Tags | CPython 3.10 Linux glibc 2.17+ ARM64 abi3 |
|
SHA-256 checksum How to use checksums |
990457e089d4fcde48a27f2577e222679af15afef03417d555d35327ba88d64f
|
|
BLAKE2b-256 checksum How to use checksums |
d3f23378d98902b9027ae9e94c9124176df278e98d197ace8e12b63df4a4fa52
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Oct 3, 2026.
Transparency logRelease files / rars-0.10.0-cp310-abi3-macosx_10_12_x86_64.macosx_11_0_arm64.macosx_10_12_universal2.whl
| Download URL | rars-0.10.0-cp310-abi3-macosx_10_12_x86_64.macosx_11_0_arm64.macosx_10_12_universal2.whl |
|---|---|
| Size | 4.5 MB |
| Tags | CPython 3.10 abi3 macOS 10.12+ universal2 (ARM64, x86-64) macOS 10.12+ x86-64 macOS 11.0+ ARM64 |
|
SHA-256 checksum How to use checksums |
a495d8c52903b11259c700e527ac70505e7873b3c3c6dffcec6db78e1a177ba7
|
|
BLAKE2b-256 checksum How to use checksums |
fa2da7efeb92097285514eadda1fcd14dde5e262729b63032f268d3da2007b68
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Oct 3, 2026.
Transparency log