Skip to content
ZhouSicheng-2011 edited this page Jul 31, 2026 · 2 revisions

Welcome to the bit7z-python Wiki!

Welcome to the official documentation of bit7z-python – a Python binding for the powerful bit7z library, providing fast and feature-rich archive compression and extraction using 7‑zip.


πŸš€ Quick Start

Here is a minimal example to get you started:

import bit7z_python as b7z

lib = b7z.Bit7zLibrary()
compressor = b7z.BitFileCompressor(lib, b7z.FORMAT_7Z)

# Compress an entire directory
compressor.compress_directory_contents("./my_folder", "./archive.7z")

# Extract the archive
extractor = b7z.BitFileExtractor(lib, b7z.FORMAT_AUTO)
extractor.extract("./archive.7z", "./output/")

Tip: You can find a more comprehensive test script in the repository.


πŸ“¦ Running the test script locally

Clone the repository with Git LFS support (the test archives are stored with LFS):

git clone https://github.com/ZhouSicheng-2011/bit7z-python.git

⚠️ Important: Do not download the source code as a ZIP archive – the test files use Git LFS and will be corrupted if downloaded without LFS support.


πŸ“š API Reference

Topic Description
Bit7zLibrary Loading and configuring the 7‑zip shared library.
BitFileCompressor Compressing files and directories to the filesystem.
BitFileExtractor Extracting archives from the filesystem.
Formats Format classes (BitInFormat, BitInOutFormat) and all available format constants.
Enumerations All enum types (compression level, method, error codes, policies, etc.).
Callback definitions Signatures and examples for all supported callbacks (progress, password, file, etc.).

πŸ’‘ Using in GUI Programs (planned)

Support for integrating with GUI applications (e.g., progress bars in Qt or Tkinter) is planned for a future release. Stay tuned!


πŸ™ Acknowledgements

Special thanks to Riccardo (rikyoz), the author of bit7z, for creating such a clean and well-documented C++ library. His work made it possible to build this Python binding efficiently and with confidence.

Clone this wiki locally