Late, but I wasn't satisfied with any of the answers.
pip install patoolimport patoolibpatoolib.extract_archive("foo_bar.rar", outdir="path here")
Works on Windows and linux without any other libraries needed.
Try the pyunpack package:
pyunpack
from pyunpack import ArchiveArchive('a.zip').extractall('/path/to')
A good package for it is rarfile :
rarfile
Infos and docs here :
https://pypi.python.org/pypi/rarfile/
https://rarfile.readthedocs.io/api.html