Project: pygithub

Use the full Github API v3

Project Details

Latest version
2.1.1
Home Page
https://github.com/pygithub/pygithub
PyPI Page
https://pypi.org/project/pygithub/

Project Popularity

PageRank
0.011579999987594857
Number of downloads
13829086

(Very short) Tutorial

First create a Github instance::

from github import Github

# Authentication is defined via github.Auth
from github import Auth

# using an access token
auth = Auth.Token("access_token")

# Public Web Github
g = Github(auth=auth)

# Github Enterprise with custom hostname
g = Github(auth=auth, base_url="https://{hostname}/api/v3")

Then play with your Github objects::

for repo in g.get_user().get_repos():
    print(repo.name)
    repo.edit(has_wiki=False)
    # to see all the available attributes and methods
    print(dir(repo))

To close connections after use::

g.close()

Reference documentation

See http://pygithub.readthedocs.io/en/stable/