rarfile

This is Python module for RAR archive reading. The interface follows the style of zipfile. Licensed under ISC license.

Features:

  • Supports both RAR3 and RAR5 format archives.

  • Supports multi volume archives.

  • Supports Unicode filenames.

  • Supports password-protected archives.

  • Supports archive and file comments.

  • Archive parsing and non-compressed files are handled in pure Python code.

  • Compressed files are extracted by executing external tool: unrar (preferred), unar, 7zip or bsdtar.

  • Works with Python 3.10+.

Backends:

Backend

Status

Notes

unrar

Supported

  • Recommended: full format support.

7zip

Supported

  • Requires 7zip-rar package on Debian/Ubuntu.

unar

Supported

  • Does not support RAR2 locked files.

  • Does not support RAR5 Blake2 hash checking.

bsdtar

Supported

  • Does not support multi-volume archives.

  • Does not support solid archives.

  • Does not support password-protected archives.

  • Does not support RARVM-based compression filters.

unrar-free

Supported

  • Based on libarchive, same as bsdtar.

  • Supports multi-volume archives. (v0.3.0+)

OS notes:

  • Windows: default tar is bsdtar.

  • MacOS: default tar is bsdtar. Use MacPorts instead Homebrew to install unrar or 7zip.

Links:

Documentation:

Indices and tables