skillfed

python-debian

Modules to read and manipulate many file formats related to Debian packages and repositories

python-debian v1.1.1 1.5M downloads/30d#3,777 on PyPI
Copyleft license GPL-2.0-or-later Active released

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-debian

uv

uv add python-debian

poetry

poetry add python-debian

Installing 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

Development Status :: 5 - Production/StableIntended Audience :: DevelopersOperating System :: POSIXProgramming Language :: Python

Tags

debian package metadata parsingread debian changelogparse control filesdeb archive extractiondebian package informationRFC822 debian formatsdebian repository data
debian-packagingmetadata-parsing

More Software Development packages