python-debian
Modules to read and manipulate many file formats related to Debian packages and repositories
What it is and what it does
python-debian provides a collection of Python modules for working with Debian-specific file formats and metadata. It handles changelogs, control files (debian/control, .changes, .dsc, Packages, Sources, Release), Debtags information, package indexes with pdiffs, and raw .deb and .ar archives. The library supports both reading and, for some formats, creating or editing these files.
The package is designed for developers who need to programmatically inspect or manipulate Debian packaging data. It has no runtime dependencies and requires Python 3.7 or later. Some modules can optionally use python-apt to speed up processing, but this is not required for basic functionality.
Use it for:
- Parse debian/changelog files to extract version history and release notes from Debian packages.
- Read control files (.dsc, .changes, Packages) to extract package metadata and dependencies.
- Extract and inspect contents of .deb archive files without unpacking them to disk.
- Process Debtags information to categorize or filter Debian packages by their tags.
- Build tools that analyze Debian repository indexes or generate package metadata.
Worth the install?
AI-flagged interpretation of the facts on this page — verify before relying
Reads and manipulates Debian packaging metadata formats including changelogs, control files, package indexes, and raw .deb archives.
Yes, if you work with Debian packaging data. Low install friction, no dependencies, production-stable, actively maintained, and no known vulnerabilities make it a straightforward choice for Debian-focused tooling. The copyleft license requires that any derivative work be open-source.
Install
python-debian on PyPI
pip
pip install python-debianuv
uv add python-debianpoetry
poetry add python-debianInstalling python-debian
Before you install
Low install friction with no runtime dependencies. Actively maintained with production-stable status and support for current Python versions.
License in practice
GPL-2.0-or-later copyleft license means any derivative work or bundled distribution must also be open-source under compatible terms.
Quickstart
pip install python-debian
from debian.changelog import Changelog
from debian.deb822 import Deb822
# Read a changelog
with open('debian/changelog') as f:
changelog = Changelog(f)
# Parse a control file
with open('debian/control') as f:
for para in Deb822.iter_paragraphs(f):
print(para['Package'])
Requires Python 3.7 or later.
Verify before relying
- Whether optional python-apt integration is automatically detected or requires manual configuration.
- Performance characteristics when processing large .deb files or repository indexes.
- Which specific Debian data formats support write/edit operations versus read-only access.
Package facts
| License | GPL-2.0-or-later (copyleft) |
| Python support | supports the current Python release (>=3.7) |
| Install friction | low — pure-Python wheel |
| Runtime dependencies | none |
| Maintenance | actively maintained — 68 days since the last release |
| First released | |
| Downloads | 1,548,228/month — #3,777 on PyPI (30-day window, as of 2026-08-14) |
| Known vulnerabilities | none known (OSV.dev, checked 2026-08-14) |
Evidence: python_debian-1.1.1-py3-none-any.whl
Keywords: debian, linux, metadata, packages, packaging
Tags
More Software Development packages
Provides backported and experimental type hints…
permissive · top 100 on PyPI
numpyNumPy provides an N-dimensional array object…
permissive · top 100 on PyPI
fastapiFastAPI is a Python web framework for building…
permissive · top 100 on PyPI
annotated-docProvides a way to document function parameters,…
permissive · top 100 on PyPI
typerTyper builds command-line applications from…
permissive · top 1,000 on PyPI
distlibDistlib provides low-level packaging utilities…
permissive · top 1,000 on PyPI
debian-inspectorParses Debian package metadata, copyright…
permissive · top 15,000 on PyPI
stdebConverts Python packages into Debian source and…
permissive · top 15,000 on PyPI
deb-pkg-toolsBuilds, inspects, and manages Debian binary…
permissive · top 15,000 on PyPI
arParses and reads ar archive files (.a),…
permissive · top 15,000 on PyPI
parverparver parses and manipulates PEP 440 version…
permissive · top 5,000 on PyPI
rosdistroParses and manipulates ROS distribution…
permissive · top 15,000 on PyPI
unix-arReads and writes AR archive files (Unix static…
permissive · top 5,000 on PyPI
version-utilsParses and compares package version strings in…
copyleft · top 15,000 on PyPI
conda-package-handlingCreate, extract, and convert conda packages in…
permissive · top 15,000 on PyPI
arpyArpy reads and extracts files from ar archives…
permissive · top 15,000 on PyPI