skillfed

rarfile

RAR archive reader for Python

rarfile v4.5 6.0M downloads/30d#1,980 on PyPI267
Permissive license ISC Active released

What it is and what it does

rarfile is a Python module that reads RAR archive files following the interface style of the standard zipfile library. It handles both RAR3 and RAR5 formats, multi-volume archives, password-protected files, and Unicode filenames. Archive parsing and non-compressed file access are implemented in pure Python, while compressed file extraction delegates to an external tool such as unrar, 7zip, unar, or bsdtar.

The module is designed for developers who need to programmatically work with RAR archives in Python. It requires an external decompression tool to be installed on the system for extracting compressed content, but provides a straightforward API for reading archive metadata and accessing file contents without requiring additional Python dependencies.

Use it for:

  • Extract files from RAR archives in a Python application without calling command-line tools directly.
  • Read metadata and list contents of multi-volume RAR archives.
  • Access password-protected RAR files programmatically with password support.
  • Process RAR archives with Unicode filenames across different operating systems.
  • Migrate legacy code that works with zip files to also handle RAR format archives.

Worth the install?

AI-flagged interpretation of the facts on this page — verify before relying

Reads RAR archive files (RAR3 and RAR5 formats) in pure Python, with support for multi-volume archives, password protection, and Unicode filenames, delegating decompression to external tools like unrar or 7zip.

Yes. rarfile is actively maintained, has no Python dependencies, carries a permissive ISC license, and fills a clear need for RAR archive support in Python. The requirement for an external decompression tool is a known and documented constraint, not a deficiency. Suitable for production use when the external tool dependency is acceptable.

Install

rarfile on PyPI

pip

pip install rarfile

uv

uv add rarfile

poetry

poetry add rarfile

Installing rarfile

Before you install

Low install friction with no runtime dependencies. Actively maintained as of 2026-08-13 with recent releases. Requires Python 3.10 or later and an external decompression tool (unrar, 7zip, unar, or bsdtar) to extract compressed files.

License in practice

Licensed under ISC (permissive), allowing commercial and private use with minimal restrictions. No copyleft obligations.

Quickstart

pip install rarfile

import rarfile

with rarfile.RarFile('archive.rar') as rf:
    rf.extractall()

An external decompression tool (unrar, 7zip, unar, or bsdtar) must be installed on the system; archive parsing and non-compressed file reading work in pure Python, but compressed files require the external tool.

Verify before relying

  • Whether the package's external tool detection is automatic or requires manual configuration.
  • Performance characteristics when handling large multi-volume archives.
  • Specific Python 3.10+ compatibility details beyond the stated requirement.

Package facts

License ISC (permissive)
Python support supports the current Python release (>=3.10)
Install friction low — pure-Python wheel
Runtime dependencies none
Maintenance actively maintained — 12 days since the last release
Last repo commit
First released
Downloads 6,033,515/month — #1,980 on PyPI (30-day window, as of 2026-08-14)
Known vulnerabilities none known (OSV.dev, checked 2026-08-14)

Evidence: rarfile-4.5-py3-none-any.whl

Keywords: rar, unrar, archive

Development Status :: 5 - Production/StableIntended Audience :: DevelopersLicense :: OSI Approved :: ISC License (ISCL)Operating System :: OS IndependentProgramming Language :: Python :: 3Topic :: Software Development :: Libraries :: Python ModulesTopic :: System :: Archiving :: Compression

Tags

rar archive reader pythonextract rar filesread rar archivesrar3 rar5 supportpassword protected rarmulti-volume rar extractionrar file parser
archive-formatfile-handling

More Python Modules packages