Changes

Jump to: navigation, search

Package:Appi

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

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
* [https://appi.readthedocs.io/ Better documentation]
* [https://gitlab.com/apinsard/appi/ 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:

<console>
$ 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'>}
>>>
</console>

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

<console>
>>> atom.is_installed()
True
>>> # 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
>>>
</console>

Please [https://appi.readthedocs.io/en/latest/ 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.

{{EbuildFooter}}
wiki-staff
336
edits

Navigation menu