All formats

RAR libraries for Python

For Python, rarfile is the library to use. It has the same API as the standard zipfile module (infolist, open, read, extractall) and handles RAR4 and RAR5, passwords and volumes. It parses the archive in pure Python but runs an external program to decompress: unrar (best), 7z, unar or bsdtar must be installed.

The standard library has no RAR support; shutil.unpack_archive doesn’t know RAR.