Metadata-Version: 2.1
Name: github3apps.py
Version: 0.2.1
Summary: Access the Github API as an Application
Home-page: https://github.com/tedivm/github3apps.py
Author: Robert Hafner
Author-email: tedivm@tedivm.com
License: UNKNOWN
Download-URL: https://github.com/tedivm/github3apps.py/archive/v0.2.1.tar.gz
Keywords: automation github apps git
Platform: UNKNOWN
Classifier: Development Status :: 4 - Beta
Classifier: License :: OSI Approved :: MIT License
Classifier: Intended Audience :: Developers
Classifier: Topic :: Software Development :: Version Control
Classifier: Programming Language :: Python :: 3
Requires-Python: >=3
Requires-Dist: cryptography (<3,>=2.1.4)
Requires-Dist: github3.py (<2,>=1)
Requires-Dist: pyjwt (<2,>=1.5.3)
Requires-Dist: requests (<3,>=2.18.0)
Provides-Extra: dev
Requires-Dist: pypandoc ; extra == 'dev'
Requires-Dist: twine ; extra == 'dev'
Requires-Dist: wheel ; extra == 'dev'

github3apps.py
==============

This project is an extension to the
`github3.py <https://github.com/sigmavirus24/github3.py>`__ project,
with the purpose of enabling `GitHub
Application <https://developer.github.com/apps/>`__ development.

Using this library developers can access all of the special App
endpoints as well as pull out a ``github3.py`` client authenticated by a
specific installation.

Usage
-----

Connect to Github as Application
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

To connect you need to pass the app id and the location of your app’s
private key.

.. code:: python

   from github3apps import GithubApp

   gha = GithubApp(app_id, path_to_private_key)
   gha.set_user_agent('MyApp')
   gha.get_app()

List Available Installations
~~~~~~~~~~~~~~~~~~~~~~~~~~~~

This returns the list of installations IDs available to your
application.

.. code:: python

   from github3apps import GithubApp

   gha = GithubApp(app_id, path_to_private_key)
   installation_ids = gha.get_installations()

Get Repositories Available to Installation
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

This returns the list of repositories available to your specific
installation.

.. code:: python

   from github3apps import GithubApp

   gha = GithubApp(app_id, path_to_private_key)

   installation = gha.get_installation(installation_id)
   installation.get_repositories()

Communicate with Github API as Installation
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

This returns a
`github3.py <https://github.com/sigmavirus24/github3.py>`__ client
already authenticated against a specific installation.

.. code:: python

   from github3apps import GithubApp

   gha = GithubApp(app_id, path_to_private_key)
   installation = gha.get_installation(installation_id)
   gh = installation.get_github3_client()


