debian.debtags module¶
Facilities to work with debtags - tags for Debian packages
Bases:
object
In-memory database mapping packages to tags and tags to packages.
Return the cardinality of a tag
Return a collection with only the packages in package_iter, sharing tagsets with this one
Return a collection with only the packages in package_iter, with a copy of the tagsets of this one
Return a copy of this collection, with the tagsets copied as well.
Generate the list of correlation as a tuple (hastag, hasalsotag, score).
Every tuple will indicate that the tag ‘hastag’ tends to also have ‘hasalsotag’ with a score of ‘score’.
Return the discriminance index if the tag.
Th discriminance index of the tag is defined as the minimum number of packages that would be eliminated by selecting only those tagged with this tag or only those not tagged with this tag.
Return a copy of this collection, but replaces the tag names with only their facets.
Return a collection with only those packages that match a filter, sharing tagsets with this one. The filter will match on the package.
Return a collection with only those packages that match a filter, with a copy of the tagsets of this one. The filter will match on the package.
Return a collection with only those packages that match a filter, sharing tagsets with this one. The filter will match on (package, tags).
Return a collection with only those packages that match a filter, with a copy of the tagsets of this one. The filter will match on (package, tags).
Return a collection with only those tags that match a filter, sharing package sets with this one. The filter will match on the tag.
Return a collection with only those tags that match a filter, with a copy of the package sets of this one. The filter will match on the tag.
Check if the collection contains the given package
Check if the collection contains packages tagged with tag
Return an ideal selection of the top tags in a list of tags.
Return the tagset made of the highest number of tags taken in consecutive sequence from the beginning of the given vector, that would intersect with the tagset of a comfortable amount of packages.
Comfortable is defined in terms of how far it is from 7.
Iterate over the packages
Iterate over 2-tuples of (pkg, tags)
Iterate over the tags
Iterate over 2-tuples of (tag, pkgs)
Return the number of packages
Return the package set of a tag
Return the set of packages that have all the tags in
tags
Quickly read the data from a pickled file
Quickly write the data to a pickled file
Read the database from a file.
- Example::
# Read the system Debtags database db.read(open(“/var/lib/debtags/package-tags”, “r”))
Return the reverse collection, sharing tagsets with this one
Return the reverse collection, with a copy of the tagsets of this one.
Return the number of tags
Return the tag set of a package
Return the set of tags that have all the packages in
pkgs
Write the tag database
Read the tag database, returning a pkg->tags dictionary
Read the tag database, returning a pkg->tags and a tag->pkgs dictionary
Read the tag database, returning a tag->pkgs dictionary
Reverse a tag database, from package -> tags to tag->packages