Debtags development

Python libraries

The Debtags python library is not as complete as the C++ library but it's the best place to start playing with Debtags and prototyping code.

It can be found as part of the python-debian package, which also comes with many examples. All methods are documented, and the package has a README.Debtags file with the aggregated documentation.

The core of the Python library is the DB object, which stores the mapping from package names to tag names and vice versa. Packages and tags are represented as simple strings.

C++ libraries

There are two C++ libraries that can be used to manipulate tag data: libtagcoll and libept.

libtagcoll provides generic functions to handle "items" tagged with "tags", without putting any limit on what an "item" and a "tag" are.

libept is designed to be the engine of a full-featured package manager application, and it implements a specialisation of libtagcoll for the Debian and Debtags case. It is currently used as the engine for the adept package manager.

libtagcoll

The library can be used to work with Debian packages and Debtags tags, or with books and categories, or even people and IRC channels. The item and tag types are template parameters, and the only requirement on the underlying type is that it can be stored in a std::set.

The library itself is a collection of all sorts of useful code, divided in various sections:

libept

libept provides abstractions for all the elements that a package manager application needs to handle: packages, versions, dependencies, caches, tags and so on.

The main design feature of libept is that the library can be reconfigured to use different kinds of packages and caches, allowing a package manager to be easily from Debian to another distribution based on different technology.

To achieve this, all classes are templatised on a configuration class, that defines what are the classes that implement all the various kinds of components used by the library.

In libept, the code that concerns Debtags is found in ept/cache, and its main parts are:

Javascript libraries

At http://debtags.alioth.debian.org/js/debtags.js there is the Javascript library that is used to support the various Debtags web applications.

If you are planning to handle Debtags information using Javascript, it probably contains code worth recycling.