Another ungoogleable question means it’s time to ask the Lazy Web again. Sometimes I wish that I could tell google what is the object and what is the subject.
Before I reinvent the wheel, does anybody know of a python module to unpack and parse debian packages, putting the information (such as the stuff in the control file) into a python object?
5 thoughts on “Parsing .deb packages with Python?”
A quick google with “python”, “libapt”, “dpkg” leads to the possibly useful:
Please install python-apt on a current debian/ubuntu system and have a look at /usr/share/doc/python-apt/examples/deb_inspect.py for example usage. I will be happy to help you (irc/mail) :)
Extract, the python binding to libextractor, is enable to extract informations about a deb file:
Maintainer: APT Development Team
Depends: python2.4-apt, python (= 2.4)
Description: Python interface to libapt-pkg
The apt-pkg Python interface will provide full access to the internal
libapt-pkg structures allowing Python programs to easily perform a
variety of functions, such as:
– Access to the APT configuration system
– Access to the APT package information database
– Parsing of Debian package control files, and other files with a
Task: ubuntu-desktop, kubuntu-desktop, edubuntu-desktop, xubuntu-desktop