User Guide

Installation

libpagure is available on PyPI, you can install it using pip:

$ python3 -m pip install libpagure

Connecting

Import the main Pagure class and instanciate it, passing a custom URL if necessary:

>>> from libpagure import Pagure
>>> pg = Pagure(instance_url="https://src.fedoraproject.org/")

Note

By default the Pagure class will connect to https://pagure.io.

Authentication

In order to use API endpoints that require authentication, you can provide and API token to the Pagure class:

>>> from libpagure import Pagure
>>> pg = Pagure(pagure_token="MYSECRETAPITOKEN")

User Information

>>> from libpagure import Pagure
>>> pg = Pagure()
>>> user = pg.user("cverna")
>>> user.fullname
>>> "Clement Verna"
>>> user.name
>>> "cverna"