Github API v3 library for Python.
Pull request Compare This branch is 2 commits ahead, 59 commits behind ChristopherMacGown:master.
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Failed to load latest commit information.



Here are the beginning of a python library to take advantage of the new API. It
is still in development and the interfaces may (read: will) change but is full
featured enough now to be used for most tasks of the new API.


This is for the APIv3 featureset. If the stuff in APIv2 is a long time coming
then there is some vague chance of adding support for those features here, but
in general the style of the two versions are rather different so it is somewhat
preferable to limit this to the v3 style.


  from github3 import client

  # Build a client with our auth credentials, should work with oauth_token
  # instead of password, but that is not tested yet
  c = client.Client(username='some_user', password='some_password')

  # Most actions (issues and the like) are actions on a repo
  repo = client.repo('repo_user', 'repo_name')

  # We use a very pythonic interface to the data, most things act like dicts or
  # lists, though the interfaces still need a little massaging
  issues = repo.issues()

  # Iterate through all the issues, handle pagination for you so may make
  # multiple requests.
  for x in issues:
    print x['title']

  # Create a new issue
  new_issue = issues.append(title='foo')

  # Update that issue

  # Delete that issue