Skip to main content

Bundle your packages into a runnable, importable zip

Project description

Zipbundler 🗜️

CI License: MIT-a-NOAI Discord

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 .pyz files compatible with Python's zipapp module
  • Importable — Files can be imported directly using zipimport or importlib
  • Flat Structure — Preserves original package structure without path transformations
  • Standard Format — Works with python -m zipapp and 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 .pyz files
  • 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 .pyz files compatible with Python's zipapp module
  • 🔄 Importable — Files can be imported using zipimport or importlib
  • 📁 Flat Structure — Preserves original package paths without transformations
  • 🎯 zipapp-style CLI — Compatible with python -m zipapp command-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.

😐 Apathetic Tools © MIT-a-NOAI

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

zipbundler-0.6.0.tar.gz (51.4 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

zipbundler-0.6.0-py3-none-any.whl (57.3 kB view details)

Uploaded Python 3

File details

Details for the file zipbundler-0.6.0.tar.gz.

File metadata

  • Download URL: zipbundler-0.6.0.tar.gz
  • Upload date:
  • Size: 51.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for zipbundler-0.6.0.tar.gz
Algorithm Hash digest
SHA256 3029ebd049c0acb73c2df7ff3c36a6c9df3dbdea19048b07467374f2685ceccf
MD5 7b29bb5a19747bbbd528ae95751e5aa8
BLAKE2b-256 f3561432fd6c8460515893c957777a8f0b91e850a55f5c667bb917270d123223

See more details on using hashes here.

Provenance

The following attestation bundles were made for zipbundler-0.6.0.tar.gz:

Publisher: publish_pypi.yml on apathetic-tools/zipbundler

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file zipbundler-0.6.0-py3-none-any.whl.

File metadata

  • Download URL: zipbundler-0.6.0-py3-none-any.whl
  • Upload date:
  • Size: 57.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for zipbundler-0.6.0-py3-none-any.whl
Algorithm Hash digest
SHA256 e9b1af368c44d52f6c46100669edefa806851c6bd9ae6e65bccffb9a024c669e
MD5 be061250fda7c81d0e369b87faee8342
BLAKE2b-256 1320891637a33dc430b9a1a9b70286f555664fe15a3e522134eb406cc5e4ac9b

See more details on using hashes here.

Provenance

The following attestation bundles were made for zipbundler-0.6.0-py3-none-any.whl:

Publisher: publish_pypi.yml on apathetic-tools/zipbundler

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page