ghapi.connection#
- class ghapi.connection.Connection(token: Optional[str] = None, url: str = 'https://api.github.com')[source]#
Implements a GH API Connection object
>>> from ghapi.connection import Connection >>> con = Connection("DUMMY_TOKEN")
- Parameters
token – your GitHub token (cf. https://github.com/settings/tokens)
url – URL to the Github API
- resolve(route: str) str [source]#
Resolves the absolute URL of the route
- Parameters
route – relative URL of the route
- Returns
the absolute URL of the route
- set_token(token: Optional[str]) None [source]#
Sets the token used for this connection
- Parameters
token – your GitHub token (cf. https://github.com/settings/tokens)