Py2Debv2 is a Python utility for automatically creating Debian (.deb) packages from Python scripts. It simplifies packaging by handling dependencies, optional standalone binaries, man pages, and setup scripts—all in one tool.
- Automatically detect Python dependencies and map them to Debian packages.
- Optional standalone binary compilation using Nuitka (
--binflag). - Create setup installation scripts (
--setupflag). - Man page integration (
--manflag). - Bundle DEB and setup scripts into a
tar.gzarchive (--tar-gzflag). - CLI-friendly with progress bars for compilation and dependency inclusion.
- Supports multiple dependencies automatically.
- Fully automates
.debpackaging for Python scripts.
If you have the .deb package ready:
sudo dpkg -i py2debv2.deb
sudo apt-get install -f # Install missing dependencies if neededtar -xzf py2debv2.tar.gz
cd py2debv2
sudo ./install.shAfter installation, the py2debv2 command is available system-wide.
py2debv2 myscript.py --command myscript -cn "Avi Twil" -email "avitwil@example.com"py2debv2 myscript.py --command myscript --bin --setuppy2debv2 myscript.py --command myscript --man myscript.1py2debv2 myscript.py --command myscript --tar-gz --setup| Feature / Tool | Py2Debv2 | fpm (Effing Package Manager) | PyInstaller | Nuitka Standalone |
|---|---|---|---|---|
Debian .deb Packaging |
✅ | ✅ | ❌ | ✅ |
| Automatic Python deps mapping | ✅ | ❌ | ❌ | ❌ |
| Standalone binary option | ✅ (--bin) |
❌ | ✅ | ✅ |
| Tar.gz archive option | ✅ (--tar-gz) |
❌ | ❌ | ❌ |
| Man page integration | ✅ (--man) |
❌ | ❌ | ❌ |
| Easy setup script generation | ✅ (--setup) |
❌ | ❌ | ❌ |
| Supports multi-dependency detection | ✅ | ❌ | ❌ | ❌ |
| Cross-platform support | Partial (Linux) | ✅ | ✅ | Partial |
| CLI & terminal friendly | ✅ CLI | CLI only | CLI only | CLI only |
Installation via .deb |
✅ | ✅ | ❌ | ✅ |
Advantages of Py2Debv2:
- Fully automates dependency detection and mapping to Debian packages.
- Supports optional standalone binaries for easier distribution.
- Can generate man pages and setup scripts automatically.
- Can bundle DEB and setup scripts into a tar.gz archive for convenient distribution.
- Designed specifically for Python scripts, making it simpler than general-purpose packagers like
fpm.
MIT License – see LICENSE file for details.