import zipfile
with zipfile.ZipFile(path_to_zip_file, 'r') as zip_ref:
zip_ref.extractall(directory_to_extract_to)
import shutil
shutil.unpack_archive(filename, extract_dir)
import zipfile
path = '/path_to_your/zip_file'
zip_ref = zipfile.ZipFile(path,'r')
zip_ref.extractall(directory_to_extract) # or leave blank to extract to current directory
# app.py
from zipfile import ZipFile
with ZipFile('Mail3.zip', 'r') as zipObj:
# Extract all the contents of zip file in different directory
zipObj.extractall('temp')
print('File is unzipped in temp folder')