Note
See the official GitHub API v2 documentation for repositories.
Repository container.
Homepage for this project.
Repository description.
Canonical URL to this repository
List of open issues for this repository.
If True, this repository has an issue tracker.
If True, this repository has downloads.
Integration branch, if set.
Name of repository.
If True, this repository has a wiki.
If True, this is a fork of another repository.
Number of people watching this repository.
If True, the repository is private.
Primary language for the repository.
Datetime the repository was created.
Username of the user owning this repository.
The parent project of this fork.
Number of forks of this repository.
The root project of this fork
Default branch, if set.
Datetime of the last push to this repository
GitHub API repository functionality.
Add an add_collaborator to a repo.
param str project: GitHub project param str username: GitHub user to add as collaborator
Warning
Requires authentication
Create a repository.
param str project: new project name param str description: optional project description param str homepage: optional project homepage param bool public: whether to make a public project
Warning
Requires authentication
Delete a repository.
param str project: project name to delete
Warning
Requires authentication
Fork a project.
param str project: GitHub project
Warning
Requires authentication
Get programming language data for project.
Parameters: | project (str) – GitHub project |
---|
Return a list of all repositories for a user.
Deprecated since version 0.4.0: Previous releases would attempt to display repositories for the logged-in user when user wasn’t supplied. This functionality is brittle and will be removed in a future release!
Parameters: |
---|
List all the collaborators in a project.
Parameters: | project (str) – GitHub project |
---|
List all the contributors in a project.
Parameters: | project (str) – GitHub project |
---|
Return a list of repos you can push to that are not your own.
New in version 0.3.0.
Warning
Requires authentication
Remove a collaborator from a repo.
param str project: GitHub project param str username: GitHub user to add as collaborator
Warning
Requires authentication
Get all repositories that match term.
Parameters: | query (str) – term to search issues for |
---|
Mark repository as private.
param str project: project name to set as private
Warning
Requires authentication
Mark repository as public.
param str project: project name to set as public
Warning
Requires authentication
Get tags for project.
Parameters: | project (str) – GitHub project |
---|
Unwatch a project.
param str project: GitHub project
Warning
Requires authentication
Watch a project.
param str project: GitHub project
Warning
Requires authentication
>>> repositories = github.repos.search("django")
>>> repo = github.repos.show("schacon/grit")
>>> repo.homepage
"http://grit.rubyforge.org/"
>>> repos = github.repos.list("schacon")
By default the first page of results is returned, you can return further results with the page parameter:
>>> repos = github.repos.list("schacon", page=2)
>>> github.repos.watch("schacon/grit")
>>> github.repos.unwatch("schacon/grit")
>>> fork = github.repos.fork("schacon/grit")
>>> new_repo = github.repos.create(name, description, homepage,
... public=True)
>>> github.repos.delete(name)
>>> github.repos.set_private("ask/chishop")
>>> github.repos.set_public("ask/chishop")
>>> pushables = github.repos.pushable()
>>> collabs = github.repos.list_collaborators("ask/chishop")
>>> github.repos.add_collaborator("ask/chishop", "schacon")
>>> github.repos.remove_collaborator("ask/chishop", "schacon")
>>> watchers = github.repos.watchers("ask/chishop")
>>> github.repos.network("ask/chishop")
Get a list of tags
>>> tags = github.repos.tags("ask/chishop")
Get a list of remote branches
>>> branches = github.repos.branches("ask/chishop")