--- id: py7zr version: "1.1.3" license: LGPL-2.1-or-later license_treatment: copyleft maintenance: active --- # py7zr — Pure python 7-zip library License: copyleft · Maintenance: active · Downloads: 9.6M/mo ## What it is and what it does py7zr is a pure-Python implementation of 7z archive handling, providing both a library API and command-line tools for compression, decompression, encryption, and decryption. It wraps Python's standard lzma module and adds support for additional algorithms (Brotli, ZStandard, PPMd) and encryption (7zAES) via third-party libraries. The package works on Linux, macOS, Windows, and ARM platforms. You use it when you need to work with 7z archives from Python without external system dependencies. It supports password-protected archives, selective file extraction, multi-volume archives, and custom filter chains. The library provides both context-manager-based file operations and a shutil integration layer for archive registration. Use it for: - Extract password-protected 7z archives in a Python application without calling external tools - Create compressed archives with custom algorithms like Brotli or ZStandard for distribution - Selectively extract files from large archives using regex patterns without full decompression - Build multi-volume archives for storage or transfer across size-limited media - Integrate 7z support into backup or data pipeline tools via the shutil interface ## Worth the install? AI-flagged interpretation of the facts above — verify before relying. py7zr is a pure-Python library for reading, writing, and managing 7z archives with support for multiple compression algorithms, encryption, and both programmatic and command-line interfaces. Yes. py7zr is actively maintained, has no known vulnerabilities, installs with low friction, and offers broad algorithm support. The LGPL-2.1-or-later license is permissive for most use cases as long as you distribute source. Install if you need 7z handling in Python; avoid only if your project cannot accept copyleft licensing. ## Install pip install py7zr uv add py7zr poetry add py7zr ## Installing py7zr Before you install: Low friction: pure-Python wheel with no compiled dependencies. Active maintenance with recent releases; last commit 2026-07-17. Requires Python 3.10 or later. License in practice: LGPL-2.1-or-later (copyleft): you may use and modify freely, but derivative works and distributions must remain under the same license and include source. Quickstart: import py7zr with py7zr.SevenZipFile('sample.7z', mode='r') as archive: archive.extractall(path='/tmp') # Or compress: with py7zr.SevenZipFile('target.7z', 'w') as archive: archive.writeall('/path/to/base_dir', 'base') Requires Python 3.10 or later; standard lzma module support varies by Python implementation. Verify before relying: - Exact compatibility with original 7-zip on Windows and p7zip on Linux/macOS for all algorithms - Performance characteristics compared to system 7z tools for large archives - Symbolic link handling safety guarantees beyond the documented ValueError checks ## Package facts - License: LGPL-2.1-or-later (copyleft) - Python support: supports_current - Install friction: low - Maintenance: active - Downloads: 9.6M/month (top 5,000 on PyPI) - Known vulnerabilities: none known ## Tags 7z archive compression decompression, 7zip library python, lzma zstandard brotli compression, encrypted archive handling, multi-volume archive creation, password-protected 7z files, compression, archive-format, encryption [View on SkillFed](https://skillfed.io/packages/py7zr) · [View on PyPI](https://pypi.org/project/py7zr/)