Bundle your packages into a runnable, importable zip
Project description
Zipbundler 🗜️
Bundle your packages into a runnable, importable zip.
Because installation is optional.
📘 Roadmap · 📝 Release Notes
[!NOTE] Heads up: the AI cooked dinner. It's edible, but watch your step. Detailed bug reports welcome.
🚀 Quick Start
Zipbundler bundles your Python packages into runnable, importable zip files. Perfect for distributing single-file applications or creating portable package archives.
Installation
# Using poetry
poetry add zipbundler
# Using pip
pip install zipbundler
Basic Usage
# zipapp-style CLI (100% compatible with python -m zipapp)
zipbundler src/myapp -o app.pyz -p "/usr/bin/env python3" -m "myapp:main"
# With compression
zipbundler src/myapp -o app.pyz -m "myapp:main" -c
# Display info from existing archive
zipbundler app.pyz --info
# Or use configuration file
zipbundler init
zipbundler build
# Watch for changes and rebuild automatically
zipbundler watch
Configuration
Create a .zipbundler.jsonc file in your project root:
{
"packages": ["src/my_package/**/*.py"],
"exclude": ["**/__pycache__/**", "**/tests/**"],
"output": {
"path": "dist/my_package.zip"
},
"entry_point": "my_package.__main__:main",
"options": {
"shebang": true,
"main_guard": true
}
}
🎯 What is Zipbundler?
Zipbundler creates zipapp-compatible .pyz files that are both runnable (executable) and importable (usable as a package). Unlike tools like shiv or pex, zipbundler produces standard zipapp files that work with Python's built-in zipimport module.
Key Features:
- ✅ zipapp Compatible — Produces standard
.pyzfiles compatible with Python'szipappmodule - ✅ Importable — Files can be imported directly using
zipimportorimportlib - ✅ Flat Structure — Preserves original package structure without path transformations
- ✅ Standard Format — Works with
python -m zipappand all zipapp-compatible tools
Comparison with Other Tools:
| Feature | zipbundler | shiv | pex |
|---|---|---|---|
| zipapp compatible | ✅ Yes | ❌ No | ❌ No |
| Importable | ✅ Yes | ❌ No | ❌ No |
| Flat structure | ✅ Yes | ⚠️ Transforms paths | ⚠️ Transforms paths |
| Dependency resolution | ⚠️ Manual | ✅ Automatic | ✅ Automatic |
| Virtualenv support | ❌ No | ✅ Yes | ✅ Yes |
Note: shiv and pex excel at dependency management and virtualenv creation, but produce non-standard zip files that aren't importable or zipapp-compatible.
Use Cases
- CLI Tools: Bundle command-line applications into single executable
.pyzfiles - Importable Packages: Create packages that can be imported without installation
- Standard zipapp Format: Generate files compatible with Python's standard library
- Quick Deployment: Ship code without installation steps or path transformations
✨ Features
- 📦 zipapp Compatible — Produces standard
.pyzfiles compatible with Python'szipappmodule - 🔄 Importable — Files can be imported using
zipimportorimportlib - 📁 Flat Structure — Preserves original package paths without transformations
- 🎯 zipapp-style CLI — Compatible with
python -m zipappcommand-line interface - 🚫 Exclude Patterns — Fine-grained control over what gets included
- 🎬 Entry Points — Support for executable zip files with entry points
- ⚙️ Code Generation — Optional shebang and main guard insertion
- 🔍 Watch Mode — Automatically rebuild on file changes
- 📝 Dry Run — Preview what would be bundled without creating files
⚖️ License
You're free to use, copy, and modify the script under the standard MIT terms.
The additional rider simply requests that this project not be used to train or fine-tune AI/ML systems until the author deems fair compensation frameworks exist.
Normal use, packaging, and redistribution for human developers are unaffected.
🪶 Summary
Use it. Hack it. Ship it.
It's MIT-licensed, minimal, and meant to stay out of your way — just with one polite request: don't feed it to the AIs (yet).
✨ AI was used to help draft language, formatting, and code — plus we just love em dashes.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file zipbundler-0.2.0.tar.gz.
File metadata
- Download URL: zipbundler-0.2.0.tar.gz
- Upload date:
- Size: 45.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
32c5d6b21488fbaf23829fd604072432d143068d3e1afbbf00759680d09d546b
|
|
| MD5 |
7f38221548070655e71769391fe4e772
|
|
| BLAKE2b-256 |
08ed145f37b3beda4370d3249e33bc94c359a583f6e608cf72b392da7cda27df
|
Provenance
The following attestation bundles were made for zipbundler-0.2.0.tar.gz:
Publisher:
publish_pypi.yml on apathetic-tools/zipbundler
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
zipbundler-0.2.0.tar.gz -
Subject digest:
32c5d6b21488fbaf23829fd604072432d143068d3e1afbbf00759680d09d546b - Sigstore transparency entry: 763721520
- Sigstore integration time:
-
Permalink:
apathetic-tools/zipbundler@6dc0b95610d619fa6b6162c56b95328ac5ce50b4 -
Branch / Tag:
refs/heads/main - Owner: https://github.com/apathetic-tools
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish_pypi.yml@6dc0b95610d619fa6b6162c56b95328ac5ce50b4 -
Trigger Event:
workflow_run
-
Statement type:
File details
Details for the file zipbundler-0.2.0-py3-none-any.whl.
File metadata
- Download URL: zipbundler-0.2.0-py3-none-any.whl
- Upload date:
- Size: 50.7 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
66f88d77b7f17892fe5a2e180b5ba840c70d1948cc261d6da0318dee2f706e82
|
|
| MD5 |
a55a7fc505e96845945bda9515a4108b
|
|
| BLAKE2b-256 |
b9d83fdcc2ff2a53742d5a51c86d68d77c9dd5af255acfaba19648673a2f6c49
|
Provenance
The following attestation bundles were made for zipbundler-0.2.0-py3-none-any.whl:
Publisher:
publish_pypi.yml on apathetic-tools/zipbundler
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
zipbundler-0.2.0-py3-none-any.whl -
Subject digest:
66f88d77b7f17892fe5a2e180b5ba840c70d1948cc261d6da0318dee2f706e82 - Sigstore transparency entry: 763721521
- Sigstore integration time:
-
Permalink:
apathetic-tools/zipbundler@6dc0b95610d619fa6b6162c56b95328ac5ce50b4 -
Branch / Tag:
refs/heads/main - Owner: https://github.com/apathetic-tools
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish_pypi.yml@6dc0b95610d619fa6b6162c56b95328ac5ce50b4 -
Trigger Event:
workflow_run
-
Statement type: