Jump to: navigation, search


1,951 bytes added, 3 years ago
Created page with "{{Ebuild |Summary=Another Portage Python Interface |CatPkg=dev-python/appi |Maintainer=pytony |Homepage= }} Appi is a python module to deal with p..."
|Summary=Another Portage Python Interface

Appi is a python module to deal with portage. It is an alternative to the official <code>portage</code> python module. It is designed to be more accessible to newcomers, which concretely consists in a:

* More straightforward interface / higher abstraction level
* [ Better documentation]
* [ Easier to read source code]

=== Examples ===

Let's say you want to list all ebuilds matching an atom. With <code>appi</code>, nothing's easier:

$ python
Python 3.5.3 (default, Jul 30 2017, 22:03:59)
[GCC 5.3.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import appi
>>> atom = appi.QueryAtom('~media-gfx/gimp-2.9.4')
>>> atom
<QueryAtom: '~media-gfx/gimp-2.9.4'>
>>> atom.list_matching_ebuilds()
{<Ebuild: 'media-gfx/gimp-2.9.4-r2::media-kit'>, <Ebuild: 'media-gfx/gimp-2.9.4-r1::media-kit'>}

Want to know if an ebuild matching this atom is installed? Not even harder:

>>> atom.is_installed()
>>> # Want to know which one?
>>> for ebuild in atom.list_matching_ebuilds():
... if ebuild.is_installed():
... print("{} is installed".format(ebuild))
... else:
... print("{} is not installed".format(ebuild))
media-gfx/gimp-2.9.4-r2::media-kit is installed
media-gfx/gimp-2.9.4-r1::media-kit is not installed

Please [ read the docs] for a complete overview of <code>appi</code>.

=== Contributing ===

Appi is still at an early stage. If you're interested in contributing to it, please contact me (<code>pytony</code>) on IRC. Whatever the help you can provide, it will be greatly appreciated.


Navigation menu