This is a Python library to access the Github API v3.
With it, you can manage your Github resources (repositories, user profiles, organizations, etc.) from Python scripts.
It covers the full API, and all methods are tested against the real Github site.
Should you have any question, or if you find a bug, or if there is something you can do with the API but not with PyGithub, please open an issue.
Version 1.0 is out! You can now consider PyGithub stable. I will maintain it up to date with the API, and fix bugs if any, but I don't plan new heavy developments.
This package is in the Python Package Index, so easy_install PyGithub
or pip install PyGithub
should be enough.
You can also clone it on Github.
First create a Gihub instance:
from github import Github
g = Github( "user", "password" )
Then play with your Github objects:
for repo in g.get_user().get_repos():
print repo.name
repo.edit( has_wiki = False )
You can also create a Github instance with an OAuth token:
g = Github( token )
Or without authentication:
g = Github()
PyGithub is distributed under the GNU Lesser General Public Licence. See files COPYING and COPYING.LESSER, as requested by GNU.
(Open an issue if you want to be listed here, I'll be glad to add your project)
- Tratihubis converts Trac tickets to Github issues
- Complete rewrite, with no more complicated meta-description
- Full typing of attributes and parameters
- Full documentation of attributes and parameters
- More usable exceptions raised in case on problems with the API
- Some bugs and limitations fixed, special thanks to bilderbuchi, roskakori and tallforasmurf for reporting them!
- Use PyGithub with OAuth authentication or with no authentication at all
- Fix issue 21 (KeyError when accessing repositories)
- Re-completed the API with NamedUser.create_gist
- Major achievement: all APIs are implemented
- More refactoring, of course
- The list of the not implemented APIs is shorter than the list of the implemented APIs
- APIs not implemented:
- GET
/gists/public
- GET
/issues
- GET
/repos/:user/:repo/compare/:base...:head
- GET
/repos/:user/:repo/git/trees/:sha?recursive=1
- POST
/repos/:user/:repo/git/trees?base_tree=
- GET
- Gists
- Autorizations
- Keys
- Hooks
- Events
- Merge pull requests
- More refactoring, one more time
- More refactoring
- Issues, milestones and their labels
- NamedUser:
- emails
- Repository:
- downloads
- tags, branches, commits and comments (not the same as "Git objects" of version 0.2)
- pull requests (no automatic merge yet)
- Automatic generation of the reference documentation of classes, with less "see API"s, and less errors
- Refactoring
- Teams details and modification
- basic attributes
- list teams in organizations, on repositories
- Git objects
- create and get tags, references, commits, trees, blobs
- list and edit references
- User details and modification
- basic attributes
- followers, following, watching
- organizations
- repositories
- Repository details and modification
- basic attributes
- forking
- collaborators, contributors, watchers
- Organization details and modification
- basic attributes
- members and public members