Create and extract archive files using shutil and py7zr.
from archive_tool import make_archive, extract_archive
def success_callback(msg: str):
print(msg)
def failure_callback(msg: str):
print(msg)
# Create
make_archive("path/to/input/dir", "path/to/output/dir", "zip", success_callback, failure_callback)
# Extract
extract_archive("path/to/archive/file", "path/to/output/dir", success_callback, failure_callback)
pip install py7zr==0.22.0
If you'd like to support my ongoing efforts in sharing fantastic open-source projects, you can contribute by making a donation via PayPal.