README.rst

python-github

A simple python library to access the GitHub API.

usage

API Usage all stems from the Github object. You can instantiate one
easily:

>>> import github
>>> gh = github.Github()
>>> gh
<Github API>

Github's API also has a lot of write access, and some private data for a user
is only accessible when authenticated as that user. Github's auth is HTTP
Basic over https, and you can authenticate with either a username/password
pair or a username/token pair. Your token can be found in the Account Admin
section of your github account preferences. You can auth either of these two
ways:

github mostly returns results that are unmodified from what the Github
REST API itself returns. The result formats can thus be mostly determined
from github's developer API documents.

paging

Some parts of github's API limits the number of results returned on a request,
and offers pagination to fetch older items. The calls that support this,
notably User.repositories and Repository.commits support both direct
access to paging via a page kwarg as well as an all kwarg that fetches
all pages. Note that large repositories with thousands of commits could
require more requests than fit within the 1-minute request limit for the Github
API, which means passing all=true can block for a substantial amount of
time.

throttling

Github's API has access limits throttled to 60 accesses per minute. By default,
Github objects will obey these limits by waiting until 60 accesses have
been made within a minute, and then waiting for the oldest access time + 60s to
perform subsequent requests. If you want to disable this (at the risk of
getting access limit errors from the Github API), pass throttle=False to
Github when instantiating a new handle.