Cómo extraer una carpeta usando Python

pip install patool
import patoolib

#case 1 specific output path
patoolib.extract_archive("filename.rar", outdir="outputpath")

#case 2 current working directory
patoolib.extract_archive("filename.rar")

MonsterBoy