Pygithub PDF
Pygithub PDF
Release 1.43.4
Vincent Jacques
1 Introduction 1
2 Examples 5
3 Reference 17
i
ii
CHAPTER 1
Introduction
PyGithub is a Python (2 and 3) library to use the Github API v3. With it, you can manage your Github resources
(repositories, user profiles, organizations, etc.) from Python scripts.
Should you have any question, any remark, 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.
1
PyGithub Documentation, Release 1.43.4
This package is in the Python Package Index, so pip install PyGithub should be enough. You can also clone
it on Github.
If you wish to use GitHub Integrations, you’ll want to be sure to install the ‘integrations’ option: pip install
PyGithub['integrations']
1.3 Licensing
PyGithub is distributed under the GNU Lesser General Public Licence. See files COPYING and COPYING.LESSER,
as requested by GNU.
You need to use a Github API and wonder which class implements it? Reference of APIs.
You want all the details about PyGithub classes? Reference of Classes.
(Open an issue if you want to be listed here, I’ll be glad to add your project)
• Github-iCalendar returns all of your Github issues and pull requests as a list of tasks / VTODO items in iCalendar
format.
• DevAssistant
• Upverter is a web-based schematic capture and PCB layout tool for people who design electronics. Designers
can attach a Github project to an Upverter project.
• Notifico receives messages (such as commits and issues) from services and scripts and delivers them to IRC
channels. It can import/sync from Github.
• Tratihubis converts Trac tickets to Github issues
• https://github.com/fga-gpp-mds/2018.1-Cardinals - website that shows metrics for any public repository (issues,
commits, pull requests etc)
• https://github.com/CMB/cligh
• https://github.com/natduca/quickopen uses PyGithub to automaticaly create issues
• https://gist.github.com/3433798
• https://github.com/zsiciarz/aquila-dsp.org
• https://github.com/robcowie/virtualenvwrapper.github
• https://github.com/kokosing/git-gifi - Git and github enhancements to git.
• https://github.com/csurfer/gitsuggest - A tool to suggest github repositories based on the repositories you have
shown interest in
• https://github.com/gomesfernanda/some-github-metrics - Python functions for relevant metrics on GitHub
repositories
2 Chapter 1. Introduction
PyGithub Documentation, Release 1.43.4
• http://stackoverflow.com/questions/10625190/most-suitable-python-library-for-github-api-v3
• http://stackoverflow.com/questions/12379637/django-social-auth-github-authentication
• http://www.freebsd.org/cgi/cvsweb.cgi/ports/devel/py-pygithub/
• https://bugzilla.redhat.com/show_bug.cgi?id=910565
4 Chapter 1. Introduction
CHAPTER 2
Examples
5
PyGithub Documentation, Release 1.43.4
2.2 Repository
6 Chapter 2. Examples
PyGithub Documentation, Release 1.43.4
2.2.5 Get all of the contents of the root directory of the repository
2.2. Repository 7
PyGithub Documentation, Release 1.43.4
8 Chapter 2. Examples
PyGithub Documentation, Release 1.43.4
2.2.12 Get the top 10 popular contents over the last 14 days
Path(path="/github/hubot/blob/master/docs/scripting.md", title="hubot/scripting.md
˓→at master · github/hubot · GitHub", count=1707, uniques=804),
Path(path="/github/hubot/blob/master/docs/index.md", title="hubot/index.md at
˓→master · github/hubot · GitHub", count=379, uniques=259),
Path(path="/github/hubot/blob/master/docs/adapters.md", title="hubot/adapters.md at
˓→master · github/hubot · GitHub", count=354, uniques=201),
Path(path="/github/hubot/blob/master/docs/deploying/heroku.md", title="hubot/heroku.
˓→md at master · github/hubot · GitHub", count=324, uniques=217),
Path(path="/github/hubot/blob/master/src/robot.coffee", title="hubot/robot.coffee
˓→at master · github/hubot · GitHub", count=293, uniques=191),
2.2.13 Get number of clones and breakdown for the last 14 days
2.2. Repository 9
PyGithub Documentation, Release 1.43.4
2.2.14 Get number of views and breakdown for the last 14 days
10 Chapter 2. Examples
PyGithub Documentation, Release 1.43.4
2.3 Branch
Note that the Branch object returned by get_branches() is not fully populated, and you can not query everything. Use
get_branch(branch=”master”) once you have the branch name.
2.4 Commit
2.3. Branch 11
PyGithub Documentation, Release 1.43.4
2.5 PullRequest
2.6 Issues
12 Chapter 2. Examples
PyGithub Documentation, Release 1.43.4
2.7 Milestone
2.7. Milestone 13
PyGithub Documentation, Release 1.43.4
Milestone(number=1)
2.8 Webhook
To receive a continuous stream of events, one can set up a wsgiref app using Pyramid to handle incoming POST
requests.
The below code sets up a listener which creates and utilizes a webhook. Using ‘pull_request’ and ‘push’ for the
EVENT attributes, any time a PR is opened, closed, merged, or synced, or a commit is pushed, Github sends a POST
containing a payload with information about the PR/push and its state.
The below example was drawn largely from Github’s Examples on working with Webhooks. A list of all applicable
event types for Webhooks can be found in Github’s documentation
ENDPOINT = "webhook"
@view_defaults(
route_name=ENDPOINT, renderer="json", request_method="POST"
)
class PayloadView(object):
"""
View receiving of Github payload. By default, this view it's fired only if
the request is json and method POST.
(continues on next page)
14 Chapter 2. Examples
PyGithub Documentation, Release 1.43.4
@view_config(header="X-Github-Event:push")
def payload_push(self):
"""This method is a continuation of PayloadView process, triggered if
header HTTP-X-Github-Event type is Push"""
print("No. commits in push:", len(self.payload['commits']))
return Response("success")
@view_config(header="X-Github-Event:pull_request")
def payload_pull_request(self):
"""This method is a continuation of PayloadView process, triggered if
header HTTP-X-Github-Event type is Pull Request"""
print("PR", self.payload['action'])
print("No. Commits in PR:", self.payload['pull_request']['commits'])
return Response("success")
@view_config(header="X-Github-Event:ping")
def payload_else(self):
print("Pinged! Webhook created with id {}!".format(self.payload["hook"]["id
˓→"]))
def create_webhook():
""" Creates a webhook for the specified repository.
USERNAME = ""
PASSWORD = ""
OWNER = ""
REPO_NAME = ""
EVENTS = ["push", "pull_request"]
HOST = ""
config = {
"url": "http://{host}/{endpoint}".format(host=HOST, endpoint=ENDPOINT),
"content_type": "json"
}
g = Github(USERNAME, PASSWORD)
repo = g.get_repo("{owner}/{repo_name}".format(owner=OWNER, repo_name=REPO_NAME))
repo.create_hook("web", config, EVENTS, active=True)
2.8. Webhook 15
PyGithub Documentation, Release 1.43.4
create_webhook()
config.add_route(ENDPOINT, "/{}".format(ENDPOINT))
config.scan()
app = config.make_wsgi_app()
server = make_server("0.0.0.0", 80, app)
server.serve_forever()
16 Chapter 2. Examples
CHAPTER 3
Reference
The primary class you will instanciate is github.MainClass.Github. From its get_, create_ methods, you
will obtain instances of all Github objects like github.NamedUser.NamedUser or github.Repository.
Repository.
All classes inherit from github.GithubObject.GithubObject.
17
PyGithub Documentation, Release 1.43.4
Type bool
per_page
Type int
rate_limiting
First value is requests remaining, second value is request limit.
Type (int, int)
rate_limiting_resettime
Unix timestamp indicating when rate limiting will reset.
Type int
get_rate_limit()
Rate limit status for different resources (core/search/graphql).
Calls GET /rate_limit
Return type github.RateLimit.RateLimit
oauth_scopes
Type list of string
get_license(key=NotSet)
Calls GET /license/:license
Parameters key – string
Return type github.License.License
get_licenses()
Calls GET /licenses
Return type github.PaginatedList.PaginatedList of github.License.
License
get_user(login=NotSet)
Calls GET /users/:user or GET /user
Parameters login – string
Return type github.NamedUser.NamedUser
get_users(since=NotSet)
Calls GET /users
Parameters since – integer
Return type github.PaginatedList.PaginatedList of github.NamedUser.
NamedUser
get_organization(login)
Calls GET /orgs/:org
Parameters login – string
Return type github.Organization.Organization
get_organizations(since=NotSet)
Calls GET /organizations
18 Chapter 3. Reference
PyGithub Documentation, Release 1.43.4
20 Chapter 3. Reference
PyGithub Documentation, Release 1.43.4
render_markdown(text, context=NotSet)
Calls POST /markdown
Parameters
• text – string
• context – github.Repository.Repository
Return type string
get_hook(name)
Calls GET /hooks/:name
Parameters name – string
Return type github.HookDescription.HookDescription
get_hooks()
Calls GET /hooks
Return type list of github.HookDescription.HookDescription
get_gitignore_templates()
Calls GET /gitignore/templates
Return type list of string
get_gitignore_template(name)
Calls GET /gitignore/templates/:name
Return type github.GitignoreTemplate.GitignoreTemplate
get_emojis()
Calls GET /emojis
Return type dictionary of type => url for emoji‘
create_from_raw_data(klass, raw_data, headers={})
Creates an object from raw_data previously obtained by github.GithubObject.GithubObject.
raw_data, and optionaly headers previously obtained by github.GithubObject.
GithubObject.raw_headers.
Parameters
• klass – the class of the object to create
• raw_data – dict
• headers – dict
Return type instance of class klass
dump(obj, file, protocol=0)
Dumps (pickles) a PyGithub object to a file-like object. Some effort is made to not pickle sensitive infor-
mations like the Github credentials used in the Github instance. But NO EFFORT is made to remove
sensitive information from the object’s attributes.
Parameters
• obj – the object to pickle
• file – the file-like object to pickle to
3.2 APIs
• /api/last-message.json
– GET: github.MainClass.Github.get_last_api_status_message()
• /api/messages.json
– GET: github.MainClass.Github.get_api_status_messages()
• /api/status.json
– GET: github.MainClass.Github.get_api_status()
• /authorizations
– GET: github.AuthenticatedUser.AuthenticatedUser.get_authorizations()
– POST: github.AuthenticatedUser.AuthenticatedUser.create_authorization()
• /authorizations/:id
– GET: github.AuthenticatedUser.AuthenticatedUser.get_authorization()
– PATCH: github.Authorization.Authorization.edit()
– DELETE: github.Authorization.Authorization.delete()
• /emojis
– GET: github.MainClass.Github.get_emojis()
22 Chapter 3. Reference
PyGithub Documentation, Release 1.43.4
• /events
– GET: github.AuthenticatedUser.AuthenticatedUser.get_events()
• /gists
– GET: github.AuthenticatedUser.AuthenticatedUser.get_gists()
– POST: github.AuthenticatedUser.AuthenticatedUser.create_gist()
• /gists/:gist_id/comments
– GET: github.Gist.Gist.get_comments()
– POST: github.Gist.Gist.create_comment()
• /gists/:gist_id/comments/:id
– GET: github.Gist.Gist.get_comment()
– PATCH: github.GistComment.GistComment.edit()
– DELETE: github.GistComment.GistComment.delete()
• /gists/:id
– GET: github.MainClass.Github.get_gist()
– PATCH: github.Gist.Gist.edit()
– DELETE: github.Gist.Gist.delete()
• /gists/:id/forks
– POST: github.Gist.Gist.create_fork()
• /gists/:id/star
– GET: github.Gist.Gist.is_starred()
– PUT: github.Gist.Gist.set_starred()
– DELETE: github.Gist.Gist.reset_starred()
• /gists/public
– GET: github.MainClass.Github.get_gists()
• /gists/starred
– GET: github.AuthenticatedUser.AuthenticatedUser.get_starred_gists()
• /gitignore/templates
– GET: github.MainClass.Github.get_gitignore_templates()
• /gitignore/templates/:name
– GET: github.MainClass.Github.get_gitignore_template()
• /hooks
– GET: github.MainClass.Github.get_hooks()
• /hooks/:name
– GET: github.MainClass.Github.get_hook()
• /hub
3.2. APIs 23
PyGithub Documentation, Release 1.43.4
24 Chapter 3. Reference
PyGithub Documentation, Release 1.43.4
– GET: github.Organization.Organization.get_members()
• /orgs/:org/members/:user
– GET: github.Organization.Organization.has_in_members()
– DELETE: github.Organization.Organization.remove_from_members()
• /orgs/:org/memberships/:user
– PUT: github.Organization.Organization.add_to_members()
– DELETE: github.Organization.Organization.remove_from_membership()
• /orgs/:org/migrations`_
– GET: github.Organization.Organization.get_migrations()
– POST: github.Organization.Organization.create_migration()
• /orgs/:org/outside_collaborators
– GET: github.Organization.Organization.get_outside_collaborators()
• /orgs/:org/outside_collaborators/:username
– PUT: github.Organization.Organization.convert_to_outside_collaborator()
– DELETE: github.Organization.Organization.remove_outside_collaborator()
• /orgs/:org/projects
– GET: github.Organization.Organization.get_projects()
• /orgs/:org/public_members
– GET: github.Organization.Organization.get_public_members()
• /orgs/:org/public_members/:user
– GET: github.Organization.Organization.has_in_public_members()
– PUT: github.Organization.Organization.add_to_public_members()
– DELETE: github.Organization.Organization.remove_from_public_members()
• /orgs/:org/repos
– GET: github.Organization.Organization.get_repos()
– POST: github.Organization.Organization.create_repo()
• /orgs/:org/teams
– GET: github.Organization.Organization.get_teams()
– POST: github.Organization.Organization.create_team()
• /orgs/:owner/hooks
– GET: github.Organization.Organization.get_hooks()
– POST: github.Organization.Organization.create_hook()
• /orgs/:owner/hooks/:id
– GET: github.Organization.Organization.get_hook()
– PATCH: github.Organization.Organization.edit_hook()
– DELETE: github.Organization.Organization.delete_hook()
3.2. APIs 25
PyGithub Documentation, Release 1.43.4
• /projects/:project_id
– GET: github.MainClass.Github.get_project()
• /projects/:project_id/columns
– GET: github.Project.Project.get_columns()
• /projects/columns/:column_id/cards
– GET: github.ProjectColumn.ProjectColumn.get_cards()
• /rate_limit
– GET: Not implemented, see Github.rate_limiting
• /reactions/:id
– DELETE: github.Reaction.Reaction.delete()
• /repos/:owner/:repo
– GET: github.AuthenticatedUser.AuthenticatedUser.get_repo() or github.
MainClass.Github.get_repo() or github.NamedUser.NamedUser.get_repo() or
github.Organization.Organization.get_repo()
– PATCH: github.Repository.Repository.edit()
– DELETE: github.Repository.Repository.delete()
• /repos/:owner/:repo/:archive_format/:ref
– GET: github.Repository.Repository.get_archive_link()
• /repos/:owner/:repo/assignees
– GET: github.Repository.Repository.get_assignees()
• /repos/:owner/:repo/assignees/:assignee
– GET: github.Repository.Repository.has_in_assignees()
• /repos/:owner/:repo/branches
– GET: github.Repository.Repository.get_branches()
• /repos/:owner/:repo/branches/:branch
– GET: github.Repository.Repository.get_branch()
• /repos/:owner/:repo/branches/:branch/protection
– GET: github.Branch.Branch.get_protection()
– PUT: github.Branch.Branch.edit_protection()
– DELETE: github.Branch.Branch.remove_protection()
• /repos/:owner/:repo/branches/:branch/protection/enforce_admins
– GET: github.Branch.Branch.get_admin_enforcement()
– POST: github.Branch.Branch.set_admin_enforcement()
– DELETE: github.Branch.Branch.remove_admin_enforcement()
• /repos/:owner/:repo/branches/:branch/protection/required_pull_request_reviews
– GET: github.Branch.Branch.get_required_pull_request_reviews()
– PATCH: github.Branch.Branch.edit_required_pull_request_reviews()
26 Chapter 3. Reference
PyGithub Documentation, Release 1.43.4
– DELETE: github.Branch.Branch.remove_required_pull_request_reviews()
• /repos/:owner/:repo/branches/:branch/protection/required_signatures
– GET: github.Branch.Branch.get_required_signatures()
– POST: github.Branch.Branch.add_required_signatures()
– DELETE: github.Branch.Branch.remove_required_signatures()
• /repos/:owner/:repo/branches/:branch/protection/required_status_checks
– GET: github.Branch.Branch.get_required_status_checks()
– PATCH: github.Branch.Branch.edit_required_status_checks()
– DELETE: github.Branch.Branch.remove_required_status_checks()
• /repos/:owner/:repo/branches/:branch/protection/restrictions
– POST: github.Branch.Branch.edit_team_push_restrictions() or github.
Branch.Branch.edit_user_push_restrictions()
– DELETE: github.Branch.Branch.remove_push_restrictions()
• /repos/:owner/:repo/branches/:branch/protection/restrictions/teams
– GET: github.Branch.Branch.get_team_push_restrictions()
• /repos/:owner/:repo/branches/:branch/protection/restrictions/users
– GET: github.Branch.Branch.get_user_push_restrictions()
• /repos/:owner/:repo/collaborators
– GET: github.Repository.Repository.get_collaborators()
• /repos/:owner/:repo/collaborators/:user
– GET: github.Repository.Repository.has_in_collaborators()
– PUT: github.Repository.Repository.add_to_collaborators()
– DELETE: github.Repository.Repository.remove_from_collaborators()
• /repos/:owner/:repo/collaborators/:username/permission
– GET: github.Repository.Repository.get_collaborator_permission()
• /repos/:owner/:repo/comments
– GET: github.Repository.Repository.get_comments()
• /repos/:owner/:repo/comments/:id
– GET: github.Repository.Repository.get_comment()
– PATCH: github.CommitComment.CommitComment.edit()
– DELETE: github.CommitComment.CommitComment.delete()
• /repos/:owner/:repo/comments/:id/reactions
– GET: github.CommitComment.CommitComment.get_reactions()
– POST: github.CommitComment.CommitComment.create_reaction()
• /repos/:owner/:repo/commits
– GET: github.Repository.Repository.get_commits()
3.2. APIs 27
PyGithub Documentation, Release 1.43.4
• /repos/:owner/:repo/commits/:ref/status/
– GET: github.Commit.Commit.get_combined_status()
• /repos/:owner/:repo/commits/:ref/status`
– GET: github.GitRef.GitRef.get_status()
• /repos/:owner/:repo/commits/:ref/statuses`
– GET: github.GitRef.GitRef.get_statuses()
• /repos/:owner/:repo/commits/:sha
– GET: github.Repository.Repository.get_commit()
• /repos/:owner/:repo/commits/:sha/comments
– GET: github.Commit.Commit.get_comments()
– POST: github.Commit.Commit.create_comment()
• /repos/:owner/:repo/compare/:base...:head
– GET: github.Repository.Repository.compare()
• /repos/:owner/:repo/contents/:path
– GET: github.Repository.Repository.get_contents() or github.Repository.
Repository.get_dir_contents() or github.Repository.Repository.
get_file_contents()
– PUT: github.Repository.Repository.create_file() or github.Repository.
Repository.update_file()
– DELETE: github.Repository.Repository.delete_file()
• /repos/:owner/:repo/contributors
– GET: github.Repository.Repository.get_contributors()
• /repos/:owner/:repo/downloads
– GET: github.Repository.Repository.get_downloads()
• /repos/:owner/:repo/downloads/:id
– GET: github.Repository.Repository.get_download()
– DELETE: github.Download.Download.delete()
• /repos/:owner/:repo/events
– GET: github.Repository.Repository.get_events()
• /repos/:owner/:repo/forks
– GET: github.Repository.Repository.get_forks()
– POST: github.AuthenticatedUser.AuthenticatedUser.create_fork() or github.
Organization.Organization.create_fork()
• /repos/:owner/:repo/git/blobs
– POST: github.Repository.Repository.create_git_blob()
• /repos/:owner/:repo/git/blobs/:sha
– GET: github.Repository.Repository.get_git_blob()
28 Chapter 3. Reference
PyGithub Documentation, Release 1.43.4
• /repos/:owner/:repo/git/commits
– POST: github.Repository.Repository.create_git_commit()
• /repos/:owner/:repo/git/commits/:sha
– GET: github.Repository.Repository.get_git_commit()
• /repos/:owner/:repo/git/refs
– GET: github.Repository.Repository.get_git_refs()
– POST: github.Repository.Repository.create_git_ref()
• /repos/:owner/:repo/git/refs/:ref
– GET: github.Repository.Repository.get_git_ref()
– PATCH: github.GitRef.GitRef.edit()
– DELETE: github.GitRef.GitRef.delete()
• /repos/:owner/:repo/git/tags
– POST: github.Repository.Repository.create_git_tag()
• /repos/:owner/:repo/git/tags/:sha
– GET: github.Repository.Repository.get_git_tag()
• /repos/:owner/:repo/git/trees
– POST: github.Repository.Repository.create_git_tree()
• /repos/:owner/:repo/git/trees/:sha
– GET: github.Repository.Repository.get_git_tree()
• /repos/:owner/:repo/hooks
– GET: github.Repository.Repository.get_hooks()
– POST: github.Repository.Repository.create_hook()
• /repos/:owner/:repo/hooks/:id
– GET: github.Repository.Repository.get_hook()
– PATCH: github.Hook.Hook.edit()
– DELETE: github.Hook.Hook.delete()
• /repos/:owner/:repo/hooks/:id/pings
– POST: github.Hook.Hook.ping()
• /repos/:owner/:repo/hooks/:id/tests
– POST: github.Hook.Hook.test()
• /repos/:owner/:repo/import
– GET: github.Repository.Repository.get_source_import()
– PUT: github.Repository.Repository.create_source_import()
• /repos/:owner/:repo/issues
– GET: github.Repository.Repository.get_issues()
– POST: github.Repository.Repository.create_issue()
3.2. APIs 29
PyGithub Documentation, Release 1.43.4
• /repos/:owner/:repo/issues/:issue_number/events
– GET: github.Issue.Issue.get_events()
• /repos/:owner/:repo/issues/:number
– GET: github.PullRequest.PullRequest.as_issue() or github.Repository.
Repository.get_issue()
– PATCH: github.Issue.Issue.edit()
• /repos/:owner/:repo/issues/:number/assignees
– POST: github.Issue.Issue.add_to_assignees()
– DELETE: github.Issue.Issue.remove_from_assignees()
• /repos/:owner/:repo/issues/:number/comments
– GET: github.Issue.Issue.get_comments() or github.PullRequest.PullRequest.
get_issue_comments()
– POST: github.Issue.Issue.create_comment() or github.PullRequest.
PullRequest.create_issue_comment()
• /repos/:owner/:repo/issues/:number/labels
– GET: github.Issue.Issue.get_labels() or github.PullRequest.PullRequest.
get_labels()
– POST: github.Issue.Issue.add_to_labels() or github.PullRequest.
PullRequest.add_to_labels()
– PUT: github.Issue.Issue.set_labels() or github.PullRequest.PullRequest.
set_labels()
– DELETE: github.Issue.Issue.delete_labels() or github.PullRequest.
PullRequest.delete_labels()
• /repos/:owner/:repo/issues/:number/labels/:name
– DELETE: github.Issue.Issue.remove_from_labels() or github.PullRequest.
PullRequest.remove_from_labels()
• /repos/:owner/:repo/issues/:number/reactions
– GET: github.Issue.Issue.get_reactions()
– POST: github.Issue.Issue.create_reaction()
• /repos/:owner/:repo/issues/comments
– GET: github.Repository.Repository.get_issues_comments()
• /repos/:owner/:repo/issues/comments/:id
– GET: github.Issue.Issue.get_comment() or github.PullRequest.PullRequest.
get_issue_comment()
– PATCH: github.IssueComment.IssueComment.edit()
– DELETE: github.IssueComment.IssueComment.delete()
• /repos/:owner/:repo/issues/comments/:id/reactions
– GET: github.IssueComment.IssueComment.get_reactions()
– POST: github.IssueComment.IssueComment.create_reaction()
30 Chapter 3. Reference
PyGithub Documentation, Release 1.43.4
• /repos/:owner/:repo/issues/events
– GET: github.Repository.Repository.get_issues_events()
• /repos/:owner/:repo/issues/events/:id
– GET: github.Repository.Repository.get_issues_event()
• /repos/:owner/:repo/keys
– GET: github.Repository.Repository.get_keys()
– POST: github.Repository.Repository.create_key()
• /repos/:owner/:repo/keys/:id
– GET: github.Repository.Repository.get_key()
– DELETE: github.RepositoryKey.RepositoryKey.delete()
• /repos/:owner/:repo/labels
– GET: github.Repository.Repository.get_labels()
– POST: github.Repository.Repository.create_label()
• /repos/:owner/:repo/labels/:name
– GET: github.Repository.Repository.get_label()
– PATCH: github.Label.Label.edit()
– DELETE: github.Label.Label.delete()
• /repos/:owner/:repo/languages
– GET: github.Repository.Repository.get_languages()
• /repos/:owner/:repo/license
– GET: github.Repository.Repository.get_license()
• /repos/:owner/:repo/merges
– POST: github.Repository.Repository.merge()
• /repos/:owner/:repo/milestones
– GET: github.Repository.Repository.get_milestones()
– POST: github.Repository.Repository.create_milestone()
• /repos/:owner/:repo/milestones/:number
– GET: github.Repository.Repository.get_milestone()
– PATCH: github.Milestone.Milestone.edit()
– DELETE: github.Milestone.Milestone.delete()
• /repos/:owner/:repo/milestones/:number/labels
– GET: github.Milestone.Milestone.get_labels()
• /repos/:owner/:repo/notifications
– PUT: github.Repository.Repository.mark_notifications_as_read()
• /repos/:owner/:repo/projects
– GET: github.Repository.Repository.get_projects()
3.2. APIs 31
PyGithub Documentation, Release 1.43.4
• /repos/:owner/:repo/pulls
– GET: github.Repository.Repository.get_pulls()
– POST: github.Repository.Repository.create_pull()
• /repos/:owner/:repo/pulls/:number
– GET: github.Issue.Issue.as_pull_request() or github.ProjectCard.
ProjectCard.get_content() or github.Repository.Repository.get_pull()
– PATCH: github.PullRequest.PullRequest.edit()
• /repos/:owner/:repo/pulls/:number/comments
– GET: github.PullRequest.PullRequest.get_comments() or github.PullRequest.
PullRequest.get_review_comments()
– POST: github.PullRequest.PullRequest.create_comment() or github.
PullRequest.PullRequest.create_review_comment()
• /repos/:owner/:repo/pulls/:number/commits
– GET: github.PullRequest.PullRequest.get_commits()
• /repos/:owner/:repo/pulls/:number/files
– GET: github.PullRequest.PullRequest.get_files()
• /repos/:owner/:repo/pulls/:number/merge
– GET: github.PullRequest.PullRequest.is_merged()
– PUT: github.PullRequest.PullRequest.merge()
• /repos/:owner/:repo/pulls/:number/requested_reviewers
– GET: github.PullRequest.PullRequest.get_review_requests()
– POST: github.PullRequest.PullRequest.create_review_request()
– DELETE: github.PullRequest.PullRequest.delete_review_request()
• /repos/:owner/:repo/pulls/:number/review/:id/comments
– GET: github.PullRequest.PullRequest.get_single_review_comments()
• /repos/:owner/:repo/pulls/:number/reviews
– GET: github.PullRequest.PullRequest.get_reviews()
– POST: github.PullRequest.PullRequest.create_review()
• /repos/:owner/:repo/pulls/:number/reviews/:id
– GET: github.PullRequest.PullRequest.get_review()
• /repos/:owner/:repo/pulls/comments
– GET: github.Repository.Repository.get_pulls_comments() or github.
Repository.Repository.get_pulls_review_comments()
• /repos/:owner/:repo/pulls/comments/:number
– GET: github.PullRequest.PullRequest.get_comment() or github.PullRequest.
PullRequest.get_review_comment()
– PATCH: github.PullRequestComment.PullRequestComment.edit()
– DELETE: github.PullRequestComment.PullRequestComment.delete()
32 Chapter 3. Reference
PyGithub Documentation, Release 1.43.4
• /repos/:owner/:repo/pulls/comments/:number/reactions
– GET: github.PullRequestComment.PullRequestComment.get_reactions()
– POST: github.PullRequestComment.PullRequestComment.create_reaction()
• /repos/:owner/:repo/readme
– GET: github.Repository.Repository.get_readme()
• /repos/:owner/:repo/releases
– GET: github.Repository.Repository.get_releases()
– POST: github.Repository.Repository.create_git_release()
• /repos/:owner/:repo/releases/:id
– GET: github.Repository.Repository.get_release()
• /repos/:owner/:repo/releases/:release_id
– PATCH: github.GitRelease.GitRelease.update_release()
– DELETE: github.GitRelease.GitRelease.delete_release()
• /repos/:owner/:repo/releases/:release_id/assets
– GET: github.GitRelease.GitRelease.get_assets()
• /repos/:owner/:repo/releases/latest
– GET: github.Repository.Repository.get_latest_release()
• /repos/:owner/:repo/stargazers
– GET: github.Repository.Repository.get_stargazers_with_dates() or github.
Repository.Repository.get_stargazers()
• /repos/:owner/:repo/stats/code_frequency
– GET: github.Repository.Repository.get_stats_code_frequency()
• /repos/:owner/:repo/stats/commit_activity
– GET: github.Repository.Repository.get_stats_commit_activity()
• /repos/:owner/:repo/stats/contributors
– GET: github.Repository.Repository.get_stats_contributors()
• /repos/:owner/:repo/stats/participation
– GET: github.Repository.Repository.get_stats_participation()
• /repos/:owner/:repo/stats/punch_card
– GET: github.Repository.Repository.get_stats_punch_card()
• /repos/:owner/:repo/statuses/:ref
– GET: github.Commit.Commit.get_statuses()
• /repos/:owner/:repo/statuses/:sha
– POST: github.Commit.Commit.create_status()
• /repos/:owner/:repo/subscribers
– GET: github.Repository.Repository.get_subscribers()
3.2. APIs 33
PyGithub Documentation, Release 1.43.4
• /repos/:owner/:repo/subscription
– GET: github.AuthenticatedUser.AuthenticatedUser.has_in_watched()
– PUT: github.AuthenticatedUser.AuthenticatedUser.add_to_watched()
– DELETE: github.AuthenticatedUser.AuthenticatedUser.
remove_from_watched()
• /repos/:owner/:repo/tags
– GET: github.Repository.Repository.get_tags()
• /repos/:owner/:repo/teams
– GET: github.Repository.Repository.get_teams()
• /repos/:owner/:repo/topics
– GET: github.Repository.Repository.get_topics()
– PUT: github.Repository.Repository.replace_topics()
• /repos/:owner/:repo/traffic/clones
– GET: github.Repository.Repository.get_clones_traffic()
• /repos/:owner/:repo/traffic/popular/paths
– GET: github.Repository.Repository.get_top_paths()
• /repos/:owner/:repo/traffic/popular/referrers
– GET: github.Repository.Repository.get_top_referrers()
• /repos/:owner/:repo/traffic/views
– GET: github.Repository.Repository.get_views_traffic()
• /repos/:owner/:repo/watchers
– GET: github.Repository.Repository.get_watchers()
• /repositories
– GET: github.MainClass.Github.get_repos()
• /repositories/:id
– GET: github.MainClass.Github.get_repo()
• /search/code
– GET: github.MainClass.Github.search_code()
• /search/commits
– GET: github.MainClass.Github.search_commits()
• /search/issues
– GET: github.MainClass.Github.search_issues()
• /search/repositories
– GET: github.MainClass.Github.search_repositories()
• /search/topics
– GET: github.MainClass.Github.search_topics()
34 Chapter 3. Reference
PyGithub Documentation, Release 1.43.4
• /search/users
– GET: github.MainClass.Github.search_users()
• /teams/:id
– GET: github.Organization.Organization.get_team()
– PATCH: github.Team.Team.edit()
– DELETE: github.Team.Team.delete()
• /teams/:id/members
– GET: github.Team.Team.get_members()
• /teams/:id/members/:user
– GET: github.Team.Team.has_in_members()
– PUT: github.Team.Team.add_to_members()
– DELETE: github.Team.Team.remove_from_members()
• /teams/:id/memberships/:user
– PUT: github.Team.Team.add_membership()
• /teams/:id/repos
– GET: github.Team.Team.get_repos()
• /teams/:id/repos/:org/:repo
– PUT: github.Team.Team.add_to_repos() or github.Team.Team.
set_repo_permission()
• /teams/:id/repos/:owner/:repo
– GET: github.Team.Team.has_in_repos()
– DELETE: github.Team.Team.remove_from_repos()
• /teams/:team_id/memberships/:username
– DELETE: github.Team.Team.remove_membership()
• /user
– GET: github.MainClass.Github.get_user()
– PATCH: github.AuthenticatedUser.AuthenticatedUser.edit()
• /user/emails
– GET: github.AuthenticatedUser.AuthenticatedUser.get_emails()
– POST: github.AuthenticatedUser.AuthenticatedUser.add_to_emails()
– DELETE: github.AuthenticatedUser.AuthenticatedUser.remove_from_emails()
• /user/followers
– GET: github.AuthenticatedUser.AuthenticatedUser.get_followers()
• /user/following
– GET: github.AuthenticatedUser.AuthenticatedUser.get_following()
• /user/following/:user
3.2. APIs 35
PyGithub Documentation, Release 1.43.4
– GET: github.AuthenticatedUser.AuthenticatedUser.has_in_following()
– PUT: github.AuthenticatedUser.AuthenticatedUser.add_to_following()
– DELETE: github.AuthenticatedUser.AuthenticatedUser.
remove_from_following()
• /user/issues
– GET: github.AuthenticatedUser.AuthenticatedUser.get_user_issues()
• /user/keys
– GET: github.AuthenticatedUser.AuthenticatedUser.get_keys()
– POST: github.AuthenticatedUser.AuthenticatedUser.create_key()
• /user/keys/:id
– GET: github.AuthenticatedUser.AuthenticatedUser.get_key()
– DELETE: github.UserKey.UserKey.delete()
• /user/migrations/:migration_id/archive`_
– GET: github.Migration.Migration.get_archive_url()
– DELETE: github.Migration.Migration.delete()
• /user/migrations/:migration_id/repos/:repo_name/lock`_
– DELETE: github.Migration.Migration.unlock_repo()
• /user/migrations/:migration_id`_
– GET: github.Migration.Migration.get_status()
• /user/migrations`_
– GET: github.AuthenticatedUser.AuthenticatedUser.get_migrations()
– POST: github.AuthenticatedUser.AuthenticatedUser.create_migration()
• /user/orgs
– GET: github.AuthenticatedUser.AuthenticatedUser.get_orgs()
• /user/repos
– GET: github.AuthenticatedUser.AuthenticatedUser.get_repos()
– POST: github.AuthenticatedUser.AuthenticatedUser.create_repo()
• /user/repository_invitations/:invitation_id
– PATCH: github.AuthenticatedUser.AuthenticatedUser.accept_invitation()
• /user/starred
– GET: github.AuthenticatedUser.AuthenticatedUser.get_starred()
• /user/starred/:owner/:repo
– GET: github.AuthenticatedUser.AuthenticatedUser.has_in_starred()
– PUT: github.AuthenticatedUser.AuthenticatedUser.add_to_starred()
– DELETE: github.AuthenticatedUser.AuthenticatedUser.
remove_from_starred()
• /user/subscriptions
36 Chapter 3. Reference
PyGithub Documentation, Release 1.43.4
– GET: github.AuthenticatedUser.AuthenticatedUser.get_subscriptions() or
github.AuthenticatedUser.AuthenticatedUser.get_watched()
• /user/subscriptions/:owner/:repo
– GET: github.AuthenticatedUser.AuthenticatedUser.has_in_subscriptions()
– PUT: github.AuthenticatedUser.AuthenticatedUser.add_to_subscriptions()
– DELETE: github.AuthenticatedUser.AuthenticatedUser.
remove_from_subscriptions()
• /user/teams
– GET: github.AuthenticatedUser.AuthenticatedUser.get_teams()
• /users
– GET: github.MainClass.Github.get_users()
• /users/:user
– GET: github.MainClass.Github.get_user()
• /users/:user/events
– GET: github.NamedUser.NamedUser.get_events()
• /users/:user/events/orgs/:org
– GET: github.AuthenticatedUser.AuthenticatedUser.get_organization_events()
• /users/:user/events/public
– GET: github.NamedUser.NamedUser.get_public_events()
• /users/:user/followers
– GET: github.NamedUser.NamedUser.get_followers()
• /users/:user/following
– GET: github.NamedUser.NamedUser.get_following()
• /users/:user/following/:target_user
– GET: github.NamedUser.NamedUser.has_in_following()
• /users/:user/gists
– GET: github.NamedUser.NamedUser.get_gists()
• /users/:user/keys
– GET: github.NamedUser.NamedUser.get_keys()
• /users/:user/orgs
– GET: github.NamedUser.NamedUser.get_orgs()
• /users/:user/received_events
– GET: github.NamedUser.NamedUser.get_received_events()
• /users/:user/received_events/public
– GET: github.NamedUser.NamedUser.get_public_received_events()
• /users/:user/repos
– GET: github.NamedUser.NamedUser.get_repos()
3.2. APIs 37
PyGithub Documentation, Release 1.43.4
• /users/:user/starred
– GET: github.NamedUser.NamedUser.get_starred()
• /users/:user/subscriptions
– GET: github.NamedUser.NamedUser.get_subscriptions()
• /users/:user/watched
– GET: github.NamedUser.NamedUser.get_watched()
• https://<upload_url>/repos/:owner/:repo/releases/:release_id/assets?
name=foo.zip
– POST: github.GitRelease.GitRelease.upload_asset()
3.3 Utilities
3.3.1 Logging
github.enable_console_debug_logging()
This function sets up a very simple logging configuration (log everything on standard output) that is useful for
troubleshooting.
38 Chapter 3. Reference
PyGithub Documentation, Release 1.43.4
expected_type
The type PyGithub expected
transformation_exception
The exception raised when PyGithub tried to parse the value
exception github.GithubException.TwoFactorException(status, data)
Exception raised when Github requires a onetime password for two-factor authentication
github.NotSet is a special value for arguments you don’t want to provide. You should not have to manipulate it
directly, because it’s the default value of all parameters accepting it. Just note that it is different from None, which is
an allowed value for some parameters.
3.3.4 Pagination
class github.PaginatedList.PaginatedList
This class abstracts the pagination of the API.
You can simply enumerate through instances of this class:
print(user.get_repos().totalCount)
print(len(user.get_repos()))
second_repo = user.get_repos()[1]
first_repos = user.get_repos()[:10]
And if you really need it, you can explicitly access a specific page:
some_repos = user.get_repos().get_page(0)
some_other_repos = user.get_repos().get_page(3)
3.3. Utilities 39
PyGithub Documentation, Release 1.43.4
class github.GithubObject.GithubObject
Base class for all classes representing objects returned by the API.
raw_data
Type dict
raw_headers
Type dict
etag
Type str
last_modified
Type str
get__repr__(params)
Converts the object to a nicely printable string.
3.4.1 AuthenticatedUser
class github.AuthenticatedUser.AuthenticatedUser
This class represents AuthenticatedUsers as returned by https://developer.github.com/v3/users/
#get-the-authenticated-user
An AuthenticatedUser object can be created by calling get_user() on a Github object.
avatar_url
Type string
bio
40 Chapter 3. Reference
PyGithub Documentation, Release 1.43.4
Type string
blog
Type string
collaborators
Type integer
company
Type string
created_at
Type datetime.datetime
disk_usage
Type integer
email
Type string
events_url
Type string
followers
Type integer
followers_url
Type string
following
Type integer
following_url
Type string
gists_url
Type string
gravatar_id
Type string
hireable
Type bool
html_url
Type string
id
Type integer
location
Type string
login
Type string
name
Type string
organizations_url
Type string
owned_private_repos
Type integer
plan
Type github.Plan.Plan
private_gists
Type integer
public_gists
Type integer
public_repos
Type integer
received_events_url
Type string
repos_url
Type string
site_admin
Type bool
starred_url
Type string
subscriptions_url
Type string
total_private_repos
Type integer
type
Type string
updated_at
Type datetime.datetime
url
Type string
add_to_emails(*emails)
Calls POST /user/emails
Parameters email – string
42 Chapter 3. Reference
PyGithub Documentation, Release 1.43.4
• description – string
Return type github.Gist.Gist
create_key(title, key)
Calls POST /user/keys
Parameters
• title – string
• key – string
Return type github.UserKey.UserKey
create_repo(name, description=NotSet, homepage=NotSet, private=NotSet, has_issues=NotSet,
has_wiki=NotSet, has_downloads=NotSet, has_projects=NotSet, auto_init=NotSet, li-
cense_template=NotSet, gitignore_template=NotSet, allow_squash_merge=NotSet, al-
low_merge_commit=NotSet, allow_rebase_merge=NotSet)
Calls POST /user/repos
Parameters
• name – string
• description – string
• homepage – string
• private – bool
• has_issues – bool
• has_wiki – bool
• has_downloads – bool
• has_projects – bool
• auto_init – bool
• license_template – string
• gitignore_template – string
• allow_squash_merge – bool
• allow_merge_commit – bool
• allow_rebase_merge – bool
Return type github.Repository.Repository
edit(name=NotSet, email=NotSet, blog=NotSet, company=NotSet, location=NotSet, hireable=NotSet,
bio=NotSet)
Calls PATCH /user
Parameters
• name – string
• email – string
• blog – string
• company – string
• location – string
44 Chapter 3. Reference
PyGithub Documentation, Release 1.43.4
• hireable – bool
• bio – string
Return type None
get_authorization(id)
Calls GET /authorizations/:id
Parameters id – integer
Return type github.Authorization.Authorization
get_authorizations()
Calls GET /authorizations
Return type github.PaginatedList.PaginatedList of github.
Authorization.Authorization
get_emails()
Calls GET /user/emails
Return type list of string
get_events()
Calls GET /events
Return type github.PaginatedList.PaginatedList of github.Event.Event
get_followers()
Calls GET /user/followers
Return type github.PaginatedList.PaginatedList of github.NamedUser.
NamedUser
get_following()
Calls GET /user/following
Return type github.PaginatedList.PaginatedList of github.NamedUser.
NamedUser
get_gists(since=NotSet)
Calls GET /gists
Parameters since – datetime.datetime format YYYY-MM-DDTHH:MM:SSZ
Return type github.PaginatedList.PaginatedList of github.Gist.Gist
get_issues(filter=NotSet, state=NotSet, labels=NotSet, sort=NotSet, direction=NotSet,
since=NotSet)
Calls GET /issues
Return type github.PaginatedList.PaginatedList of github.Issue.Issue
Parameters
• filter – string
• state – string
• labels – list of github.Label.Label
• sort – string
• direction – string
• since – datetime.datetime
Return type github.PaginatedList.PaginatedList of github.Issue.Issue
get_user_issues(filter=NotSet, state=NotSet, labels=NotSet, sort=NotSet, direction=NotSet,
since=NotSet)
Calls GET /user/issues
Return type github.PaginatedList.PaginatedList of github.Issue.Issue
Parameters
• filter – string
• state – string
• labels – list of github.Label.Label
• sort – string
• direction – string
• since – datetime.datetime
Return type github.PaginatedList.PaginatedList of github.Issue.Issue
get_key(id)
Calls GET /user/keys/:id
Parameters id – integer
Return type github.UserKey.UserKey
get_keys()
Calls GET /user/keys
Return type github.PaginatedList.PaginatedList of github.UserKey.
UserKey
get_notification(id)
Calls GET /notifications/threads/:id
Return type github.Notification.Notification
get_notifications(all=NotSet, participating=NotSet)
Calls GET /notifications
Parameters
• all – bool
• participating – bool
Return type github.PaginatedList.PaginatedList of github.
Notification.Notification
get_organization_events(org)
Calls GET /users/:user/events/orgs/:org
Parameters org – github.Organization.Organization
Return type github.PaginatedList.PaginatedList of github.Event.Event
46 Chapter 3. Reference
PyGithub Documentation, Release 1.43.4
get_orgs()
Calls GET /user/orgs
Return type github.PaginatedList.PaginatedList of github.
Organization.Organization
get_repo(name)
Calls GET /repos/:owner/:repo
Parameters name – string
Return type github.Repository.Repository
get_repos(visibility=NotSet, affiliation=NotSet, type=NotSet, sort=NotSet, direction=NotSet)
Calls GET /user/repos <http://developer.github.com/v3/repos>
Parameters
• visibility – string
• affiliation – string
• type – string
• sort – string
• direction – string
Return type github.PaginatedList.PaginatedList of github.Repository.
Repository
get_starred()
Calls GET /user/starred
Return type github.PaginatedList.PaginatedList of github.Repository.
Repository
get_starred_gists()
Calls GET /gists/starred
Return type github.PaginatedList.PaginatedList of github.Gist.Gist
get_subscriptions()
Calls GET /user/subscriptions
Return type github.PaginatedList.PaginatedList of github.Repository.
Repository
get_teams()
Calls GET /user/teams
Return type github.PaginatedList.PaginatedList of github.Team.Team
get_watched()
Calls GET /user/subscriptions
Return type github.PaginatedList.PaginatedList of github.Repository.
Repository
has_in_following(following)
Calls GET /user/following/:user
48 Chapter 3. Reference
PyGithub Documentation, Release 1.43.4
3.4.2 Authorization
class github.Authorization.Authorization
This class represents Authorizations. The reference can be found here https://developer.github.com/v3/oauth_
authorizations/
app
Type github.AuthorizationApplication.AuthorizationApplication
created_at
Type datetime.datetime
id
Type integer
note
Type string
note_url
Type string
scopes
Type list of string
token
Type string
updated_at
Type datetime.datetime
url
Type string
delete()
Calls DELETE /authorizations/:id
Return type None
edit(scopes=NotSet, add_scopes=NotSet, remove_scopes=NotSet, note=NotSet, note_url=NotSet)
Calls PATCH /authorizations/:id
Parameters
• scopes – list of string
• add_scopes – list of string
• remove_scopes – list of string
• note – string
• note_url – string
Return type None
3.4.3 AuthorizationApplication
class github.AuthorizationApplication.AuthorizationApplication
This class represents AuthorizationApplications
name
Type string
url
Type string
3.4.4 Branch
class github.Branch.Branch
This class represents Branches. The reference can be found here https://developer.github.com/v3/repos/branches
commit
Type github.Commit.Commit
name
Type string
protected
Type bool
protection_url
Type string
get_protection()
Calls GET /repos/:owner/:repo/branches/:branch/protection
50 Chapter 3. Reference
PyGithub Documentation, Release 1.43.4
52 Chapter 3. Reference
PyGithub Documentation, Release 1.43.4
3.4.5 BranchProtection
class github.BranchProtection.BranchProtection
This class represents Branch Protection. The reference can be found here https://developer.github.com/v3/repos/
branches/#get-branch-protection
url
Type string
required_status_checks
Type github.RequiredStatusChecks.RequiredStatusChecks
enforce_admins
Type bool
required_pull_request_reviews
Type github.RequiredPullRequestReviews.RequiredPullRequestReviews
get_user_push_restrictions()
Return type github.PaginatedList.PaginatedList of github.NamedUser.
NamedUser
get_team_push_restrictions()
Return type github.PaginatedList.PaginatedList of github.Team.Team
3.4.6 Clones
class github.Clones.Clones
This class represents a popular Path for a GitHub repository. The reference can be found here https://developer.
github.com/v3/repos/traffic/
timestamp
Type datetime.datetime
count
Type integer
uniques
Type integer
3.4.7 Commit
class github.Commit.Commit
This class represents Commits. The reference can be found here http://developer.github.com/v3/git/commits/
author
Type github.NamedUser.NamedUser
comments_url
Type string
commit
Type github.GitCommit.GitCommit
committer
Type github.NamedUser.NamedUser
files
Type list of github.File.File
html_url
Type string
parents
Type list of github.Commit.Commit
sha
Type string
stats
Type github.CommitStats.CommitStats
url
Type string
create_comment(body, line=NotSet, path=NotSet, position=NotSet)
Calls POST /repos/:owner/:repo/commits/:sha/comments
Parameters
• body – string
• line – integer
• path – string
• position – integer
Return type github.CommitComment.CommitComment
create_status(state, target_url=NotSet, description=NotSet, context=NotSet)
Calls POST /repos/:owner/:repo/statuses/:sha
Parameters
• state – string
• target_url – string
• description – string
• context – string
Return type github.CommitStatus.CommitStatus
get_comments()
Calls GET /repos/:owner/:repo/commits/:sha/comments
Return type github.PaginatedList.PaginatedList of github.
CommitComment.CommitComment
get_statuses()
54 Chapter 3. Reference
PyGithub Documentation, Release 1.43.4
3.4.8 CommitCombinedStatus
class github.CommitCombinedStatus.CommitCombinedStatus
This class represents CommitCombinedStatuses. The reference can be found here https://developer.github.com/
v3/repos/statuses/#get-the-combined-status-for-a-specific-ref
state
Type string
sha
Type string
total_count
Type integer
commit_url
Type string
url
Type string
repository
Type github.Repository.Repository
statuses
Type list of CommitStatus
3.4.9 CommitComment
class github.CommitComment.CommitComment
This class represents CommitComments. The reference can be found here https://developer.github.com/v3/
repos/comments/
body
Type string
commit_id
Type string
created_at
Type datetime.datetime
html_url
Type string
id
Type integer
line
Type integer
path
Type string
position
Type integer
updated_at
Type datetime.datetime
url
Type string
user
Type github.NamedUser.NamedUser
delete()
Calls DELETE /repos/:owner/:repo/comments/:id
Return type None
edit(body)
Calls PATCH /repos/:owner/:repo/comments/:id
Parameters body – string
Return type None
get_reactions()
Calls GET /repos/:owner/:repo/comments/:id/reactions
Returns
class github.PaginatedList.PaginatedList of github.Reaction.
Reaction
create_reaction(reaction_type)
Calls POST /repos/:owner/:repo/comments/:id/reactions
Parameters reaction_type – string
Return type github.Reaction.Reaction
3.4.10 CommitStats
class github.CommitStats.CommitStats
This class represents CommitStatses.
additions
Type integer
56 Chapter 3. Reference
PyGithub Documentation, Release 1.43.4
deletions
Type integer
total
Type integer
3.4.11 CommitStatus
class github.CommitStatus.CommitStatus
This class represents CommitStatuses.The reference can be found here https://developer.github.com/v3/repos/
statuses/
created_at
Type datetime.datetime
creator
Type github.NamedUser.NamedUser
description
Type string
id
Type integer
state
Type string
context
Type string
target_url
Type string
updated_at
Type datetime.datetime
url
Type string
3.4.12 Comparison
class github.Comparison.Comparison
This class represents Comparisons
ahead_by
Type integer
base_commit
Type github.Commit.Commit
behind_by
Type integer
commits
Type list of github.Commit.Commit
diff_url
Type string
files
Type list of github.File.File
html_url
Type string
merge_base_commit
Type github.Commit.Commit
patch_url
Type string
permalink_url
Type string
status
Type string
total_commits
Type integer
url
Type string
3.4.13 ContentFile
class github.ContentFile.ContentFile
This class represents ContentFiles. The reference can be found here https://developer.github.com/v3/repos/
contents/#get-contents
content
Type string
download_url
Type string
encoding
Type string
git_url
Type string
html_url
Type string
license
Type github.License.License
58 Chapter 3. Reference
PyGithub Documentation, Release 1.43.4
name
Type string
path
Type string
repository
Type github.Repository.Repository
sha
Type string
size
Type integer
type
Type string
url
Type string
text_matches
Type string
3.4.14 Download
class github.Download.Download
This class represents Downloads. The reference can be found here https://developer.github.com/v3/repos/
downloads/
accesskeyid
Type string
acl
Type string
bucket
Type string
content_type
Type string
created_at
Type datetime.datetime
description
Type string
download_count
Type integer
expirationdate
Type datetime.datetime
html_url
Type string
id
Type integer
mime_type
Type string
name
Type string
path
Type string
policy
Type string
prefix
Type string
redirect
Type bool
s3_url
Type string
signature
Type string
size
Type integer
url
Type string
delete()
Calls DELETE /repos/:owner/:repo/downloads/:id
Return type None
3.4.15 Event
class github.Event.Event
This class represents Events. The reference can be found here http://developer.github.com/v3/activity/events/
actor
Type github.NamedUser.NamedUser
created_at
Type datetime.datetime
id
60 Chapter 3. Reference
PyGithub Documentation, Release 1.43.4
Type string
org
Type github.Organization.Organization
payload
Type dict
public
Type bool
repo
Type github.Repository.Repository
type
Type string
3.4.16 File
class github.File.File
This class represents Files
additions
Type integer
blob_url
Type string
changes
Type integer
contents_url
Type string
deletions
Type integer
filename
Type string
patch
Type string
previous_filename
Type string
raw_url
Type string
sha
Type string
status
Type string
3.4.17 Gist
class github.Gist.Gist
This class represents Gists. The reference can be found here https://developer.github.com/v3/gists/
comments
Type integer
comments_url
Type string
commits_url
Type string
created_at
Type datetime.datetime
description
Type string
files
Type dict of string to github.GistFile.GistFile
fork_of
Type github.Gist.Gist
forks
Type list of github.Gist.Gist
forks_url
Type string
git_pull_url
Type string
git_push_url
Type string
history
Type list of github.GistHistoryState.GistHistoryState
html_url
Type string
id
Type string
owner
Type github.NamedUser.NamedUser
public
62 Chapter 3. Reference
PyGithub Documentation, Release 1.43.4
Type bool
updated_at
Type datetime.datetime
url
Type string
user
Type github.NamedUser.NamedUser
create_comment(body)
Calls POST /gists/:gist_id/comments
Parameters body – string
Return type github.GistComment.GistComment
create_fork()
Calls POST /gists/:id/forks
Return type github.Gist.Gist
delete()
Calls DELETE /gists/:id
Return type None
edit(description=NotSet, files=NotSet)
Calls PATCH /gists/:id
Parameters
• description – string
• files – dict of string to github.InputFileContent.InputFileContent
Return type None
get_comment(id)
Calls GET /gists/:gist_id/comments/:id
Parameters id – integer
Return type github.GistComment.GistComment
get_comments()
Calls GET /gists/:gist_id/comments
Return type github.PaginatedList.PaginatedList of github.
GistComment.GistComment
is_starred()
Calls GET /gists/:id/star
Return type bool
reset_starred()
Calls DELETE /gists/:id/star
3.4.18 GistComment
class github.GistComment.GistComment
This class represents GistComments. The reference can be found here https://developer.github.com/v3/gists/
comments/
body
Type string
created_at
Type datetime.datetime
id
Type integer
updated_at
Type datetime.datetime
url
Type string
user
Type github.NamedUser.NamedUser
delete()
Calls DELETE /gists/:gist_id/comments/:id
Return type None
edit(body)
Calls PATCH /gists/:gist_id/comments/:id
Parameters body – string
Return type None
3.4.19 GistFile
class github.GistFile.GistFile
This class represents GistFiles
content
Type string
filename
Type string
language
64 Chapter 3. Reference
PyGithub Documentation, Release 1.43.4
Type string
raw_url
Type string
size
Type integer
type
Type string
3.4.20 GistHistoryState
class github.GistHistoryState.GistHistoryState
This class represents GistHistoryStates
change_status
Type github.CommitStats.CommitStats
comments
Type integer
comments_url
Type string
commits_url
Type string
committed_at
Type datetime.datetime
created_at
Type datetime.datetime
description
Type string
files
Type dict of string to github.GistFile.GistFile
forks
Type list of github.Gist.Gist
forks_url
Type string
git_pull_url
Type string
git_push_url
Type string
history
3.4.21 GitAuthor
class github.GitAuthor.GitAuthor
This class represents GitAuthors
date
Type datetime.datetime
email
Type string
name
Type string
3.4.22 GitBlob
class github.GitBlob.GitBlob
This class represents GitBlobs. The reference can be found here https://developer.github.com/v3/git/blobs/
content
Type string
encoding
Type string
sha
66 Chapter 3. Reference
PyGithub Documentation, Release 1.43.4
Type string
size
Type integer
url
Type string
3.4.23 GitCommit
class github.GitCommit.GitCommit
This class represents GitCommits. The reference can be found here https://developer.github.com/v3/git/
commits/
author
Type github.GitAuthor.GitAuthor
committer
Type github.GitAuthor.GitAuthor
html_url
Type string
message
Type string
parents
Type list of github.GitCommit.GitCommit
sha
Type string
tree
Type github.GitTree.GitTree
url
Type string
3.4.24 GitObject
class github.GitObject.GitObject
This class represents GitObjects
sha
Type string
type
Type string
url
Type string
3.4.25 GitRef
class github.GitRef.GitRef
This class represents GitRefs. The reference can be found here https://developer.github.com/v3/git/refs/
object
Type github.GitObject.GitObject
ref
Type string
url
Type string
delete()
Calls DELETE /repos/:owner/:repo/git/refs/:ref
Return type None
edit(sha, force=NotSet)
Calls PATCH /repos/:owner/:repo/git/refs/:ref
Parameters
• sha – string
• force – bool
Return type None
get_statuses()
https://developer.github.com/v3/repos/statuses/#list-statuses-for-a-specific-ref :calls: GET /re-
pos/:owner/:repo/commits/:ref/statuses :return:
get_status()
https://developer.github.com/v3/repos/statuses/#get-the-combined-status-for-a-specific-ref :calls: GET
/repos/:owner/:repo/commits/:ref/status :return:
3.4.26 GitRelease
class github.GitRelease.GitRelease
This class represents GitReleases. The reference can be found here https://developer.github.com/v3/repos/
releases
id
Type integer
body
Type string
title
Type string
tag_name
Type string
target_commitish
68 Chapter 3. Reference
PyGithub Documentation, Release 1.43.4
Type string
draft
Type bool
prerelease
Type bool
author
Type github.NamedUser.NamedUser
created_at
Type datetime.datetime
published_at
Type datetime.datetime
url
Type string
upload_url
Type string
html_url
Type string
tarball_url
Type string
zipball_url
Type string
delete_release()
Calls DELETE /repos/:owner/:repo/releases/:release_id
Return type None
update_release(name, message, draft=False, prerelease=False, tag_name=NotSet, tar-
get_commitish=NotSet)
Calls PATCH /repos/:owner/:repo/releases/:release_id
Return type github.GitRelease.GitRelease
upload_asset(path, label=”, content_type=”)
Calls POST https://<upload_url>/repos/:owner/:repo/releases/:release_id/assets?name=foo.zip
Return type github.GitReleaseAsset.GitReleaseAsset
get_assets()
Calls GET /repos/:owner/:repo/releases/:release_id/assets
Return type github.PaginatedList.PaginatedList
3.4.27 GitReleaseAsset
class github.GitReleaseAsset.GitReleaseAsset
This class represents GitReleaseAssets. The reference can be found here https://developer.github.com/v3/repos/
releases/#get-a-single-release-asset
url
Type string
id
Type integer
name
Type string
label
Type string
content_type
Type string
state
Type string
size
Type integer
download_count
Type integer
created_at
Type datetime
updated_at
Type datetime
browser_download_url
Type string
uploader
Type github.NamedUser.NamedUser
delete_asset()
Delete asset from the release. :rtype: bool
update_asset(name, label=”)
Update asset metadata. :rtype: github.GitReleaseAsset.GitReleaseAsset
3.4.28 GitTag
class github.GitTag.GitTag
This class represents GitTags. The reference can be found here https://developer.github.com/v3/git/tags/
message
70 Chapter 3. Reference
PyGithub Documentation, Release 1.43.4
Type string
object
Type github.GitObject.GitObject
sha
Type string
tag
Type string
tagger
Type github.GitAuthor.GitAuthor
url
Type string
3.4.29 GitTree
class github.GitTree.GitTree
This class represents GitTrees. The reference can be found here https://developer.github.com/v3/git/trees/
sha
Type string
tree
Type list of github.GitTreeElement.GitTreeElement
url
Type string
3.4.30 GitTreeElement
class github.GitTreeElement.GitTreeElement
This class represents GitTreeElements
mode
Type string
path
Type string
sha
Type string
size
Type integer
type
Type string
url
Type string
3.4.31 GitignoreTemplate
class github.GitignoreTemplate.GitignoreTemplate
This class represents GitignoreTemplates. The reference can be found here https://developer.github.com/v3/
gitignore/
source
Type string
name
Type string
3.4.32 Hook
class github.Hook.Hook
This class represents Hooks. The reference can be found here http://developer.github.com/v3/repos/hooks
active
Type bool
config
Type dict
created_at
Type datetime.datetime
events
Type list of string
id
Type integer
last_response
Type github.HookResponse.HookResponse
name
Type string
test_url
Type string
updated_at
Type datetime.datetime
url
Type string
ping_url
Type string
delete()
72 Chapter 3. Reference
PyGithub Documentation, Release 1.43.4
3.4.33 HookDescription
class github.HookDescription.HookDescription
This class represents HookDescriptions
events
Type list of string
name
Type string
schema
Type list of list of string
supported_events
Type list of string
3.4.34 HookResponse
class github.HookResponse.HookResponse
This class represents HookResponses
code
Type integer
message
Type string
status
Type string
3.4.35 Installation
class github.Installation.Installation
This class represents Installations. The reference can be found here https://developer.github.com/v3/apps/
installations/
get_repos()
Calls GET /installation/repositories
Return type github.PaginatedList.PaginatedList of github.Repository.
Repository
3.4.36 InstallationAuthorization
class github.InstallationAuthorization.InstallationAuthorization
This class represents InstallationAuthorizations
token
Type string
expires_at
Type datetime
on_behalf_of
Type github.NamedUser.NamedUser
3.4.37 Invitation
class github.Invitation.Invitation
This class represents repository invitations. The reference can be found here https://developer.github.com/v3/
repos/invitations/
id
Type integer
permissions
Type string
created_at
Type string
url
Type string
html_url
74 Chapter 3. Reference
PyGithub Documentation, Release 1.43.4
Type string
repository
Type Repository
3.4.38 Issue
class github.Issue.Issue
This class represents Issues. The reference can be found here https://developer.github.com/v3/issues/
assignee
Type github.NamedUser.NamedUser
assignees
Type list of github.NamedUser.NamedUser
body
Type string
closed_at
Type datetime.datetime
closed_by
Type github.NamedUser.NamedUser
comments
Type integer
comments_url
Type string
created_at
Type datetime.datetime
events_url
Type string
html_url
Type string
id
Type integer
labels
Type list of github.Label.Label
labels_url
Type string
milestone
Type github.Milestone.Milestone
number
Type integer
pull_request
Type github.IssuePullRequest.IssuePullRequest
repository
Type github.Repository.Repository
state
Type string
title
Type string
updated_at
Type datetime.datetime
url
Type string
user
Type github.NamedUser.NamedUser
as_pull_request()
Calls GET /repos/:owner/:repo/pulls/:number
Return type github.PullRequest.PullRequest
add_to_assignees(*assignees)
Calls POST /repos/:owner/:repo/issues/:number/assignees
Parameters assignee – github.NamedUser.NamedUser or string
Return type None
add_to_labels(*labels)
Calls POST /repos/:owner/:repo/issues/:number/labels
Parameters label – github.Label.Label or string
Return type None
create_comment(body)
Calls POST /repos/:owner/:repo/issues/:number/comments
Parameters body – string
Return type github.IssueComment.IssueComment
delete_labels()
Calls DELETE /repos/:owner/:repo/issues/:number/labels
Return type None
edit(title=NotSet, body=NotSet, assignee=NotSet, state=NotSet, milestone=NotSet, labels=NotSet, as-
signees=NotSet)
Calls PATCH /repos/:owner/:repo/issues/:number
Parameters
76 Chapter 3. Reference
PyGithub Documentation, Release 1.43.4
• title – string
• body – string
• assignee – string or github.NamedUser.NamedUser or None
• assignees – list (of string or github.NamedUser.NamedUser)
• state – string
• milestone – github.Milestone.Milestone or None
• labels – list of string
Return type None
get_comment(id)
Calls GET /repos/:owner/:repo/issues/comments/:id
Parameters id – integer
Return type github.IssueComment.IssueComment
get_comments(since=NotSet)
Calls GET /repos/:owner/:repo/issues/:number/comments
Parameters since – datetime.datetime format YYYY-MM-DDTHH:MM:SSZ
Return type github.PaginatedList.PaginatedList of github.
IssueComment.IssueComment
get_events()
Calls GET /repos/:owner/:repo/issues/:issue_number/events
Return type github.PaginatedList.PaginatedList of github.IssueEvent.
IssueEvent
get_labels()
Calls GET /repos/:owner/:repo/issues/:number/labels
Return type github.PaginatedList.PaginatedList of github.Label.Label
remove_from_assignees(*assignees)
Calls DELETE /repos/:owner/:repo/issues/:number/assignees
Parameters assignee – github.NamedUser.NamedUser or string
Return type None
remove_from_labels(label)
Calls DELETE /repos/:owner/:repo/issues/:number/labels/:name
Parameters label – github.Label.Label or string
Return type None
set_labels(*labels)
Calls PUT /repos/:owner/:repo/issues/:number/labels
Parameters labels – list of github.Label.Label or strings
Return type None
get_reactions()
3.4.39 IssueComment
class github.IssueComment.IssueComment
This class represents IssueComments. The reference can be found here https://developer.github.com/v3/issues/
comments/
body
Type string
created_at
Type datetime.datetime
id
Type integer
issue_url
Type string
updated_at
Type datetime.datetime
url
Type string
html_url
Type string
user
Type github.NamedUser.NamedUser
delete()
Calls DELETE /repos/:owner/:repo/issues/comments/:id
Return type None
edit(body)
Calls PATCH /repos/:owner/:repo/issues/comments/:id
Parameters body – string
Return type None
get_reactions()
78 Chapter 3. Reference
PyGithub Documentation, Release 1.43.4
3.4.40 IssueEvent
class github.IssueEvent.IssueEvent
This class represents IssueEvents. The reference can be found here https://developer.github.com/v3/issues/
events/
actor
Type github.NamedUser.NamedUser
commit_id
Type string
created_at
Type datetime.datetime
event
Type string
id
Type integer
issue
Type github.Issue.Issue
url
Type string
node_id
Type string
commit_url
Type string
label
Type github.Label.Label
assignee
Type github.NamedUser.NamedUser
assigner
Type github.NamedUser.NamedUser
review_requester
Type github.NamedUser.NamedUser
requested_reviewer
Type github.NamedUser.NamedUser
milestone
Type github.Milestone.Milestone
rename
Type dict
dismissed_review
Type dict
lock_reason
Type string
3.4.41 IssuePullRequest
class github.IssuePullRequest.IssuePullRequest
This class represents IssuePullRequests
diff_url
Type string
html_url
Type string
patch_url
Type string
3.4.42 Label
class github.Label.Label
This class represents Labels. The reference can be found here http://developer.github.com/v3/issues/labels/
color
Type string
description
Type string
name
Type string
url
Type string
delete()
Calls DELETE /repos/:owner/:repo/labels/:name
80 Chapter 3. Reference
PyGithub Documentation, Release 1.43.4
3.4.43 License
class github.License.License
This class represents Licenses. The reference can be found here https://developer.github.com/v3/licenses/
key
Type string
name
Type string
spdx_id
Type string
url
Type string
html_url
Type string
description
Type string
implementation
Type string
body
Type string
permissions
Type list of string
conditions
Type list of string
limitations
Type list of string
3.4.44 Migration
class github.Migration.Migration
This class represents Migrations. The reference can be found here http://developer.github.com/v3/migrations/
id
Type int
owner
Type github.NamedUser.NamedUser
guid
Type str
state
Type str
lock_repositories
Type bool
exclude_attachments
Type bool
repositories
Type github.PaginatedList.PaginatedList of github.Repository.
Repository
url
Type str
created_at
Type datetime.datetime
Return type None
updated_at
Type datetime.datetime
Return type None
get_status()
Calls ‘GET /user/migrations/:migration_id‘_
Return type str
get_archive_url()
Calls ‘GET /user/migrations/:migration_id/archive‘_
Return type str
delete()
Calls ‘DELETE /user/migrations/:migration_id/archive‘_
unlock_repo(repo_name)
Calls ‘DELETE /user/migrations/:migration_id/repos/:repo_name/lock‘_
82 Chapter 3. Reference
PyGithub Documentation, Release 1.43.4
3.4.45 Milestone
class github.Milestone.Milestone
This class represents Milestones. The reference can be found here http://developer.github.com/v3/issues/
milestones/
closed_issues
Type integer
created_at
Type datetime.datetime
creator
Type github.NamedUser.NamedUser
description
Type string
due_on
Type datetime.datetime
id
Type integer
labels_url
Type string
number
Type integer
open_issues
Type integer
state
Type string
title
Type string
updated_at
Type datetime.datetime
url
Type string
delete()
Calls DELETE /repos/:owner/:repo/milestones/:number
Return type None
edit(title, state=NotSet, description=NotSet, due_on=NotSet)
3.4.46 NamedUser
class github.NamedUser.NamedUser
This class represents NamedUsers. The reference can be found here https://developer.github.com/v3/users/
#get-a-single-user
avatar_url
Type string
bio
Type string
blog
Type string
collaborators
Type integer
company
Type string
contributions
Type integer
created_at
Type datetime.datetime
disk_usage
Type integer
email
Type string
events_url
Type string
followers
Type integer
84 Chapter 3. Reference
PyGithub Documentation, Release 1.43.4
followers_url
Type string
following
Type integer
following_url
Type string
gists_url
Type string
gravatar_id
Type string
hireable
Type bool
html_url
Type string
id
Type integer
location
Type string
login
Type string
name
Type string
organizations_url
Type string
owned_private_repos
Type integer
permissions
Type github.Permissions.Permissions
plan
Type github.Plan.Plan
private_gists
Type integer
public_gists
Type integer
public_repos
Type integer
received_events_url
Type string
repos_url
Type string
site_admin
Type bool
starred_url
Type string
subscriptions_url
Type string
suspended_at
Type datetime.datetime
total_private_repos
Type integer
type
Type string
updated_at
Type datetime.datetime
url
Type string
get_events()
Calls GET /users/:user/events
Return type github.PaginatedList.PaginatedList of github.Event.Event
get_followers()
Calls GET /users/:user/followers
Return type github.PaginatedList.PaginatedList of github.NamedUser.
NamedUser
get_following()
Calls GET /users/:user/following
Return type github.PaginatedList.PaginatedList of github.NamedUser.
NamedUser
get_gists(since=NotSet)
Calls GET /users/:user/gists
Parameters since – datetime.datetime format YYYY-MM-DDTHH:MM:SSZ
Return type github.PaginatedList.PaginatedList of github.Gist.Gist
get_keys()
Calls GET /users/:user/keys
86 Chapter 3. Reference
PyGithub Documentation, Release 1.43.4
3.4.47 Notification
class github.Notification.Notification
This class represents Notifications. The reference can be found here http://developer.github.com/v3/activity/
notifications/
id
Type string
last_read_at
Type datetime.datetime
repository
Type github.Repository.Repository
subject
Type github.NotificationSubject.NotificationSubject
reason
Type string
subscription_url
Type string
unread
Type bool
updated_at
Type datetime.datetime
url
Type string
mark_as_read()
Calls PATCH /notifications/threads/:id
3.4.48 NotificationSubject
class github.NotificationSubject.NotificationSubject
This class represents Subjects of Notifications. The reference can be found here http://developer.github.com/v3/
activity/notifications/#list-your-notifications
title
88 Chapter 3. Reference
PyGithub Documentation, Release 1.43.4
Type string
url
Type string
latest_comment_url
Type string
type
Type string
3.4.49 Organization
class github.Organization.Organization
This class represents Organizations. The reference can be found here http://developer.github.com/v3/orgs/
avatar_url
Type string
billing_email
Type string
blog
Type string
collaborators
Type integer
company
Type string
created_at
Type datetime.datetime
description
Type string
disk_usage
Type integer
email
Type string
events_url
Type string
followers
Type integer
following
Type integer
gravatar_id
Type string
html_url
Type string
id
Type integer
location
Type string
login
Type string
members_url
Type string
name
Type string
owned_private_repos
Type integer
plan
Type github.Plan.Plan
private_gists
Type integer
public_gists
Type integer
public_members_url
Type string
public_repos
Type integer
repos_url
Type string
total_private_repos
Type integer
type
Type string
updated_at
Type datetime.datetime
url
Type string
add_to_members(member, role=NotSet)
90 Chapter 3. Reference
PyGithub Documentation, Release 1.43.4
• license_template – string
• gitignore_template – string
• allow_squash_merge – bool
• allow_merge_commit – bool
• allow_rebase_merge – bool
Return type github.Repository.Repository
create_team(name, repo_names=NotSet, permission=NotSet, privacy=NotSet)
Calls POST /orgs/:org/teams
Parameters
• name – string
• repo_names – list of github.Repository.Repository
• permission – string
• privacy – string
Return type github.Team.Team
delete_hook(id)
Calls DELETE /orgs/:owner/hooks/:id
Parameters id – integer
Return type None‘
edit(billing_email=NotSet, blog=NotSet, company=NotSet, description=NotSet, email=NotSet, loca-
tion=NotSet, name=NotSet)
Calls PATCH /orgs/:org
Parameters
• billing_email – string
• blog – string
• company – string
• description – string
• email – string
• location – string
• name – string
Return type None
edit_hook(id, name, config, events=NotSet, active=NotSet)
Calls PATCH /orgs/:owner/hooks/:id
Parameters
• id – integer
• name – string
• config – dict
• events – list of string
92 Chapter 3. Reference
PyGithub Documentation, Release 1.43.4
• active – bool
Return type github.Hook.Hook
get_events()
Calls GET /orgs/:org/events
Return type github.PaginatedList.PaginatedList of github.Event.Event
get_hook(id)
Calls GET /orgs/:owner/hooks/:id
Parameters id – integer
Return type github.Hook.Hook
get_hooks()
Calls GET /orgs/:owner/hooks
Return type github.PaginatedList.PaginatedList of github.Hook.Hook
get_issues(filter=NotSet, state=NotSet, labels=NotSet, sort=NotSet, direction=NotSet,
since=NotSet)
Calls GET /orgs/:org/issues
Return type github.PaginatedList.PaginatedList of github.Issue.Issue
Parameters
• filter – string
• state – string
• labels – list of github.Label.Label
• sort – string
• direction – string
• since – datetime.datetime
Return type github.PaginatedList.PaginatedList of github.Issue.Issue
get_members(filter_=NotSet, role=NotSet)
Calls GET /orgs/:org/members
Parameters
• filter – string
• role – string
Return type github.PaginatedList.PaginatedList of github.NamedUser.
NamedUser
get_projects(state=NotSet)
Calls GET /orgs/:org/projects
Return type github.PaginatedList.PaginatedList of github.Project.
Project
Parameters state – string
get_public_members()
94 Chapter 3. Reference
PyGithub Documentation, Release 1.43.4
• role – string
• teams – array of github.Team.Team
Return type None
has_in_members(member)
Calls GET /orgs/:org/members/:user
Parameters member – github.NamedUser.NamedUser
Return type bool
has_in_public_members(public_member)
Calls GET /orgs/:org/public_members/:user
Parameters public_member – github.NamedUser.NamedUser
Return type bool
remove_from_membership(member)
Calls DELETE /orgs/:org/memberships/:user
Parameters member – github.NamedUser.NamedUser
Return type None
remove_from_members(member)
Calls DELETE /orgs/:org/members/:user
Parameters member – github.NamedUser.NamedUser
Return type None
remove_from_public_members(public_member)
Calls DELETE /orgs/:org/public_members/:user
Parameters public_member – github.NamedUser.NamedUser
Return type None
create_migration(repos, lock_repositories=NotSet, exclude_attachments=NotSet)
Calls ‘POST /orgs/:org/migrations‘_
Parameters
• repos – list or tuple of str
• lock_repositories – bool
• exclude_attachments – bool
Return type github.Migration.Migration
get_migrations()
Calls ‘GET /orgs/:org/migrations‘_
Return type github.PaginatedList.PaginatedList of github.Migration.
Migration
3.4.50 Path
class github.Path.Path
This class represents a popular Path for a GitHub repository. The reference can be found here https://developer.
github.com/v3/repos/traffic/
path
Type string
title
Type string
count
Type integer
uniques
Type integer
3.4.51 Permissions
class github.Permissions.Permissions
This class represents Permissions
admin
Type bool
pull
Type bool
push
Type bool
3.4.52 Plan
class github.Plan.Plan
This class represents Plans
collaborators
Type integer
name
Type string
private_repos
Type integer
space
Type integer
96 Chapter 3. Reference
PyGithub Documentation, Release 1.43.4
3.4.53 Project
class github.Project.Project
This class represents Projects. The reference can be found here http://developer.github.com/v3/projects
body
Type string
columns_url
Type string
created_at
Type datetime.datetime
creator
Type github.NamedUser.NamedUser
html_url
Type string
id
Type integer
name
Type string
node_id
Type string
number
Type integer
owner_url
Type string
state
Type string
updated_at
Type datetime.datetime
url
Type string
get_columns()
Calls GET /projects/:project_id/columns
Return type github.PaginatedList.PaginatedList of github.
ProjectColumn.ProjectColumn
create_column(name)
calls: ‘POST https://developer.github.com/v3/projects/columns/#create-a-project-column>‘_ :param
name: string
3.4.54 ProjectCard
class github.ProjectCard.ProjectCard
This class represents Project Cards. The reference can be found here https://developer.github.com/v3/projects/
cards
archived
Type bool
column_url
Type string
content_url
Type string
created_at
Type datetime.datetime
creator
Type github.NamedUser.NamedUser
id
Type integer
node_id
Type string
note
Type string
updated_at
Type datetime.datetime
url
Type string
get_content(content_type=NotSet)
Calls GET /repos/:owner/:repo/pulls/:number
Return type github.PullRequest.PullRequest or github.Issue.Issue
3.4.55 ProjectColumn
class github.ProjectColumn.ProjectColumn
This class represents Project Columns. The reference can be found here http://developer.github.com/v3/projects/
columns
cards_url
Type string
created_at
Type datetime.datetime
id
98 Chapter 3. Reference
PyGithub Documentation, Release 1.43.4
Type integer
name
Type string
node_id
Type string
project_url
Type string
updated_at
Type datetime.datetime
url
Type string
get_cards(archived_state=NotSet)
Calls GET /projects/columns/:column_id/cards
Return type github.PaginatedList.PaginatedList of github.
ProjectCard.ProjectCard
Parameters archived_state – string
3.4.56 PullRequest
class github.PullRequest.PullRequest
This class represents PullRequests. The reference can be found here http://developer.github.com/v3/pulls/
additions
Type integer
assignee
Type github.NamedUser.NamedUser
assignees
Type list of github.NamedUser.NamedUser
base
Type github.PullRequestPart.PullRequestPart
body
Type string
changed_files
Type integer
closed_at
Type datetime.datetime
comments
Type integer
comments_url
Type string
commits
Type integer
commits_url
Type string
created_at
Type datetime.datetime
deletions
Type integer
diff_url
Type string
head
Type github.PullRequestPart.PullRequestPart
html_url
Type string
id
Type integer
issue_url
Type string
labels
Type list of github.Label.Label
merge_commit_sha
Type string
mergeable
Type bool
mergeable_state
Type string
merged
Type bool
merged_at
Type datetime.datetime
merged_by
Type github.NamedUser.NamedUser
milestone
Type github.Milestone.Milestone
number
Type integer
patch_url
Type string
review_comment_url
Type string
review_comments
Type integer
review_comments_url
Type string
state
Type string
title
Type string
updated_at
Type datetime.datetime
url
Type string
user
Type github.NamedUser.NamedUser
as_issue()
Calls GET /repos/:owner/:repo/issues/:number
Return type github.Issue.Issue
create_comment(body, commit_id, path, position)
Calls POST /repos/:owner/:repo/pulls/:number/comments
Parameters
• body – string
• commit_id – github.Commit.Commit
• path – string
• position – integer
Return type github.PullRequestComment.PullRequestComment
create_review_comment(body, commit_id, path, position)
Calls POST /repos/:owner/:repo/pulls/:number/comments
Parameters
• body – string
• commit_id – github.Commit.Commit
• path – string
• position – integer
Return type github.PullRequestComment.PullRequestComment
create_issue_comment(body)
Calls POST /repos/:owner/:repo/issues/:number/comments
Parameters body – string
Return type github.IssueComment.IssueComment
create_review(commit, body, event=NotSet, comments=NotSet)
Calls POST /repos/:owner/:repo/pulls/:number/reviews
Parameters
• commit – github.Commit.Commit
• body – string
• event – string
• comments – list
Return type github.PullRequestReview.PullRequestReview
create_review_request(reviewers=NotSet, team_reviewers=NotSet)
Calls POST /repos/:owner/:repo/pulls/:number/requested_reviewers
Parameters
• reviewers – list of strings
• team_reviewers – list of strings
Return type None
delete_review_request(reviewers=NotSet, team_reviewers=NotSet)
Calls DELETE /repos/:owner/:repo/pulls/:number/requested_reviewers
Parameters
• reviewers – list of strings
• team_reviewers – list of strings
Return type None
edit(title=NotSet, body=NotSet, state=NotSet, base=NotSet)
Calls PATCH /repos/:owner/:repo/pulls/:number
Parameters
• title – string
• body – string
• state – string
• base – string
Return type None
get_comment(id)
Calls GET /repos/:owner/:repo/pulls/comments/:number
Parameters id – integer
Return type github.PullRequestComment.PullRequestComment
get_review_comment(id)
Calls GET /repos/:owner/:repo/pulls/comments/:number
Parameters id – integer
Return type github.PullRequestComment.PullRequestComment
get_comments()
Warning: this only returns review comments. For normal conversation comments, use
get_issue_comments.
Calls GET /repos/:owner/:repo/pulls/:number/comments
Return type github.PaginatedList.PaginatedList of github.
PullRequestComment.PullRequestComment
get_review_comments(since=NotSet)
Calls GET /repos/:owner/:repo/pulls/:number/comments
Parameters since – datetime.datetime format YYYY-MM-DDTHH:MM:SSZ
Return type github.PaginatedList.PaginatedList of github.
PullRequestComment.PullRequestComment
get_single_review_comments(id)
Calls GET /repos/:owner/:repo/pulls/:number/review/:id/comments
Parameters id – integer
Return type github.PaginatedList.PaginatedList of github.
PullRequestComment.PullRequestComment
get_commits()
Calls GET /repos/:owner/:repo/pulls/:number/commits
Return type github.PaginatedList.PaginatedList of github.Commit.
Commit
get_files()
Calls GET /repos/:owner/:repo/pulls/:number/files
Return type github.PaginatedList.PaginatedList of github.File.File
get_issue_comment(id)
Calls GET /repos/:owner/:repo/issues/comments/:id
Parameters id – integer
Return type github.IssueComment.IssueComment
get_issue_comments()
Calls GET /repos/:owner/:repo/issues/:number/comments
Return type github.PaginatedList.PaginatedList of github.
IssueComment.IssueComment
get_review(id)
3.4.57 PullRequestComment
class github.PullRequestComment.PullRequestComment
This class represents PullRequestComments. The reference can be found here http://developer.github.com/v3/
pulls/comments/
body
Type string
commit_id
Type string
created_at
Type datetime.datetime
diff_hunk
Type string
id
Type integer
in_reply_to_id
Type integer
original_commit_id
Type string
original_position
Type integer
path
Type string
position
Type integer
pull_request_url
Type string
updated_at
Type datetime.datetime
url
Type string
html_url
Type string
user
Type github.NamedUser.NamedUser
delete()
Calls DELETE /repos/:owner/:repo/pulls/comments/:number
3.4.58 PullRequestMergeStatus
class github.PullRequestMergeStatus.PullRequestMergeStatus
This class represents PullRequestMergeStatuses. The reference can be found here http://developer.github.com/
v3/pulls/#get-if-a-pull-request-has-been-merged
merged
Type bool
message
Type string
sha
Type string
3.4.59 PullRequestPart
class github.PullRequestPart.PullRequestPart
This class represents PullRequestParts
label
Type string
ref
Type string
repo
Type github.Repository.Repository
sha
Type string
user
Type github.NamedUser.NamedUser
3.4.60 PullRequestReview
class github.PullRequestReview.PullRequestReview
This class represents PullRequestReviews. The reference can be found here https://developer.github.com/v3/
pulls/reviews/
id
Type integer
user
Type github.NamedUser.NamedUser
body
Type string
commit_id
Type string
state
Type string
url
Type string
html_url
Type string
pull_request_url
Type string
submitted_at
Type datetime.datetime
3.4.61 Rate
class github.Rate.Rate
This class represents Rates. The reference can be found here http://developer.github.com/v3/rate_limit
limit
Type integer
remaining
Type integer
reset
Type datetime.datetime
3.4.62 RateLimit
class github.RateLimit.RateLimit
This class represents RateLimits. The reference can be found here http://developer.github.com/v3/rate_limit
rate
(Deprecated) Rate limit for non-search-related API, use core instead
Type class:github.Rate.Rate
core
Rate limit for the non-search-related API
Type class:github.Rate.Rate
search
Rate limit for the Search API.
Type class:github.Rate.Rate
graphql
(Experimental) Rate limit for GraphQL API, use with caution.
Type class:github.Rate.Rate
3.4.63 Reaction
class github.Reaction.Reaction
This class represents Reactions. The reference can be found here https://developer.github.com/v3/reactions/
content
Type string
created_at
Type datetime.datetime
id
Type integer
user
Type github.NamedUser.NamedUser
delete()
Calls DELETE /reactions/:id
Return type None
3.4.64 Referrer
class github.Referrer.Referrer
This class represents a popylar Referrer for a GitHub repository. The reference can be found here https://
developer.github.com/v3/repos/traffic/
referrer
Type string
count
Type integer
uniques
Type integer
3.4.65 Repository
class github.Repository.Repository
This class represents Repositories. The reference can be found here http://developer.github.com/v3/repos/
allow_merge_commit
Type bool
allow_rebase_merge
Type bool
allow_squash_merge
Type bool
archived
Type bool
archive_url
Type string
assignees_url
Type string
blobs_url
Type string
branches_url
Type string
clone_url
Type string
collaborators_url
Type string
comments_url
Type string
commits_url
Type string
compare_url
Type string
contents_url
Type string
contributors_url
Type string
created_at
Type datetime.datetime
default_branch
Type string
description
Type string
downloads_url
Type string
events_url
Type string
fork
Type bool
forks
Type integer
forks_count
Type integer
forks_url
Type string
full_name
Type string
git_commits_url
Type string
git_refs_url
Type string
git_tags_url
Type string
git_url
Type string
has_downloads
Type bool
has_issues
Type bool
has_projects
Type bool
has_wiki
Type bool
homepage
Type string
hooks_url
Type string
html_url
Type string
id
Type integer
issue_comment_url
Type string
issue_events_url
Type string
issues_url
Type string
keys_url
Type string
labels_url
Type string
language
Type string
languages_url
Type string
master_branch
Type string
merges_url
Type string
milestones_url
Type string
mirror_url
Type string
name
Type string
network_count
Type integer
notifications_url
Type string
open_issues
Type integer
open_issues_count
Type integer
organization
Type github.Organization.Organization
owner
Type github.NamedUser.NamedUser
parent
Type github.Repository.Repository
permissions
Type github.Permissions.Permissions
private
Type bool
pulls_url
Type string
pushed_at
Type datetime.datetime
size
Type integer
source
Type github.Repository.Repository
ssh_url
Type string
stargazers_count
Type integer
stargazers_url
Type string
statuses_url
Type string
subscribers_url
Type string
subscribers_count
Type integer
subscription_url
Type string
svn_url
Type string
tags_url
Type string
teams_url
Type string
topics
Type list of strings
trees_url
Type string
updated_at
Type datetime.datetime
url
Type string
watchers
Type integer
watchers_count
Type integer
add_to_collaborators(collaborator, permission=NotSet)
Calls PUT /repos/:owner/:repo/collaborators/:user
Parameters
• collaborator – string or github.NamedUser.NamedUser
• permission – string ‘pull’, ‘push’ or ‘admin’
Return type None
get_collaborator_permission(collaborator)
Calls GET /repos/:owner/:repo/collaborators/:username/permission
Parameters collaborator – string or github.NamedUser.NamedUser
Return type string
compare(base, head)
Calls GET /repos/:owner/:repo/compare/:base. . . :head
Parameters
• base – string
• head – string
Return type github.Comparison.Comparison
create_git_blob(content, encoding)
• object – string
• type – string
• tagger – github.InputGitAuthor.InputGitAuthor
Return type github.GitTag.GitTag
create_git_tree(tree, base_tree=NotSet)
Calls POST /repos/:owner/:repo/git/trees
Parameters
• tree – list of github.InputGitTreeElement.InputGitTreeElement
• base_tree – github.GitTree.GitTree
Return type github.GitTree.GitTree
create_hook(name, config, events=NotSet, active=NotSet)
Calls POST /repos/:owner/:repo/hooks
Parameters
• name – string
• config – dict
• events – list of string
• active – bool
Return type github.Hook.Hook
create_issue(title, body=NotSet, assignee=NotSet, milestone=NotSet, labels=NotSet, as-
signees=NotSet)
Calls POST /repos/:owner/:repo/issues
Parameters
• title – string
• body – string
• assignee – string or github.NamedUser.NamedUser
• assignees – list (of string or github.NamedUser.NamedUser)
• milestone – github.Milestone.Milestone
• labels – list of github.Label.Label
Return type github.Issue.Issue
create_key(title, key, read_only=False)
Calls POST /repos/:owner/:repo/keys
Parameters
• title – string
• key – string
• read_only – bool
Return type github.RepositoryKey.RepositoryKey
create_label(name, color, description=NotSet)
Parameters
• path – string
• ref – string
Return type github.ContentFile.ContentFile
get_top_referrers()
Calls GET /repos/:owner/:repo/traffic/popular/referrers
Return type list of github.Referrer.Referrer
get_top_paths()
Calls GET /repos/:owner/:repo/traffic/popular/paths
Return type list of github.Path.Path
get_views_traffic(per=NotSet)
Calls GET /repos/:owner/:repo/traffic/views
Parameters per – string, must be one of day or week, day by default
Return type None or list of github.View.View
get_clones_traffic(per=NotSet)
Calls GET /repos/:owner/:repo/traffic/clones
Parameters per – string, must be one of day or week, day by default
Return type None or list of github.Clone.Clone
get_projects(state=NotSet)
Calls GET /repos/:owner/:repo/projects
Return type github.PaginatedList.PaginatedList of github.Project.
Project
Parameters state – string
create_file(path, message, content, branch=NotSet, committer=NotSet, author=NotSet)
Create a file in this repository.
Calls PUT /repos/:owner/:repo/contents/:path
Parameters
• path – string, (required), path of the file in the repository
• message – string, (required), commit message
• content – string, (required), the actual data in the file
• branch – string, (optional), branch to create the commit on. Defaults to the default
branch of the repository
• committer – InputGitAuthor, (optional), if no information is given the authenticated
user’s information will be used. You must specify both a name and email.
• author – InputGitAuthor, (optional), if omitted this will be filled in with committer
information. If passed, you must specify both a name and email.
Return type
{ ‘content’: ContentFile:, ‘commit’: Commit}
get_git_tree(sha, recursive=NotSet)
Calls GET /repos/:owner/:repo/git/trees/:sha
Parameters
• sha – string
• recursive – bool
Return type github.GitTree.GitTree
get_hook(id)
Calls GET /repos/:owner/:repo/hooks/:id
Parameters id – integer
Return type github.Hook.Hook
get_hooks()
Calls GET /repos/:owner/:repo/hooks
Return type github.PaginatedList.PaginatedList of github.Hook.Hook
get_issue(number)
Calls GET /repos/:owner/:repo/issues/:number
Parameters number – integer
Return type github.Issue.Issue
get_issues(milestone=NotSet, state=NotSet, assignee=NotSet, mentioned=NotSet, labels=NotSet,
sort=NotSet, direction=NotSet, since=NotSet, creator=NotSet)
Calls GET /repos/:owner/:repo/issues
Parameters
• milestone – github.Milestone.Milestone or “none” or “*”
• state – string. open, closed, or all. If this is not set the GitHub API default behavior
will be used. At the moment this is to return only open issues. This might change anytime
on GitHub API side and it could be clever to explicitly specify the state value.
• assignee – string or github.NamedUser.NamedUser or “none” or “*”
• mentioned – github.NamedUser.NamedUser
• labels – list of github.Label.Label
• sort – string
• direction – string
• since – datetime.datetime
• creator – string or github.NamedUser.NamedUser
Return type github.PaginatedList.PaginatedList of github.Issue.Issue
get_issues_comments(sort=NotSet, direction=NotSet, since=NotSet)
Calls GET /repos/:owner/:repo/issues/comments
Parameters
• sort – string
• direction – string
• since – datetime.datetime
Return type github.PaginatedList.PaginatedList of github.
IssueComment.IssueComment
get_issues_event(id)
Calls GET /repos/:owner/:repo/issues/events/:id
Parameters id – integer
Return type github.IssueEvent.IssueEvent
get_issues_events()
Calls GET /repos/:owner/:repo/issues/events
Return type github.PaginatedList.PaginatedList of github.IssueEvent.
IssueEvent
get_key(id)
Calls GET /repos/:owner/:repo/keys/:id
Parameters id – integer
Return type github.RepositoryKey.RepositoryKey
get_keys()
Calls GET /repos/:owner/:repo/keys
Return type github.PaginatedList.PaginatedList of github.
RepositoryKey.RepositoryKey
get_label(name)
Calls GET /repos/:owner/:repo/labels/:name
Parameters name – string
Return type github.Label.Label
get_labels()
Calls GET /repos/:owner/:repo/labels
Return type github.PaginatedList.PaginatedList of github.Label.Label
get_languages()
Calls GET /repos/:owner/:repo/languages
Return type dict of string to integer
get_license()
Calls GET /repos/:owner/:repo/license
Return type github.ContentFile.ContentFile
get_milestone(number)
Calls GET /repos/:owner/:repo/milestones/:number
Parameters number – integer
Return type github.Milestone.Milestone
• direction – string
• since – datetime.datetime
Return type github.PaginatedList.PaginatedList of github.
PullRequestComment.PullRequestComment
get_readme(ref=NotSet)
Calls GET /repos/:owner/:repo/readme
Parameters ref – string
Return type github.ContentFile.ContentFile
get_source_import()
Calls GET /repos/:owner/:repo/import
Return type github.SourceImport.SourceImport
get_stargazers()
Calls GET /repos/:owner/:repo/stargazers
Return type github.PaginatedList.PaginatedList of github.NamedUser.
NamedUser
get_stargazers_with_dates()
Calls GET /repos/:owner/:repo/stargazers
Return type github.PaginatedList.PaginatedList of github.Stargazer.
Stargazer
get_stats_contributors()
Calls GET /repos/:owner/:repo/stats/contributors
Return type None or list of github.StatsContributor.StatsContributor
get_stats_commit_activity()
Calls GET /repos/:owner/:repo/stats/commit_activity
Return type None or list of github.StatsCommitActivity.
StatsCommitActivity
get_stats_code_frequency()
Calls GET /repos/:owner/:repo/stats/code_frequency
Return type None or list of github.StatsCodeFrequency.StatsCodeFrequency
get_stats_participation()
Calls GET /repos/:owner/:repo/stats/participation
Return type None or github.StatsParticipation.StatsParticipation
get_stats_punch_card()
Calls GET /repos/:owner/:repo/stats/punch_card
Return type None or github.StatsPunchCard.StatsPunchCard
get_subscribers()
Calls GET /repos/:owner/:repo/subscribers
3.4.66 RepositoryKey
class github.RepositoryKey.RepositoryKey
This class represents RepositoryKeys. The reference can be found here http://developer.github.com/v3/repos/
keys/
created_at
Type datetime.datetime
id
Type integer
key
Type string
title
Type string
url
Type string
verified
Type bool
read_only
Type bool
delete()
Calls DELETE /repos/:owner/:repo/keys/:id
Return type None
3.4.67 RequiredPullRequestReviews
class github.RequiredPullRequestReviews.RequiredPullRequestReviews
This class represents Required Pull Request Reviews. The reference can be found here https://developer.github.
com/v3/repos/branches/#get-pull-request-review-enforcement-of-protected-branch
dismiss_stale_reviews
Type bool
require_code_owner_reviews
Type bool
required_approving_review_count
Type int
url
Type string
dismissal_users
Type list of github.NamedUser.NamedUser
dismissal_teams
3.4.68 RequiredStatusChecks
class github.RequiredStatusChecks.RequiredStatusChecks
This class represents Required Status Checks. The reference can be found here https://developer.github.com/v3/
repos/branches/#get-required-status-checks-of-protected-branch
strict
Type bool
contexts
Type list of string
url
Type string
3.4.69 SourceImport
class github.SourceImport.SourceImport
This class represents SourceImports. The reference can be found here https://developer.github.com/v3/
migration/source_imports/
authors_count
Type integer
authors_url
Type string
has_large_files
Type bool
html_url
Type string
large_files_count
Type integer
large_files_size
Type integer
repository_url
Type string
status
Type string
status_text
Type string
url
Type string
use_lfs
Type string
vcs
Type string
vcs_url
Type string
3.4.70 Stargazer
class github.Stargazer.Stargazer
This class represents Stargazers. The reference can be found here https://developer.github.com/v3/activity/
starring/#alternative-response-with-star-creation-timestamps
starred_at
Type datetime.datetime
user
Type github.NamedUser
3.4.71 StatsCodeFrequency
class github.StatsCodeFrequency.StatsCodeFrequency
This class represents statistics of StatsCodeFrequencies. The reference can be found here http://developer.
github.com/v3/repos/statistics/#get-the-number-of-additions-and-deletions-per-week
week
Type datetime.datetime
additions
Type int
deletions
Type int
3.4.72 StatsCommitActivity
class github.StatsCommitActivity.StatsCommitActivity
This class represents StatsCommitActivities. The reference can be found here http://developer.github.com/v3/
repos/statistics/#get-the-last-year-of-commit-activity-data
week
Type datetime.datetime
total
Type int
days
Type list of int
3.4.73 StatsContributor
class github.StatsContributor.StatsContributor
This class represents StatsContributors. The reference can be found here http://developer.github.com/v3/repos/
statistics/#get-contributors-list-with-additions-deletions-and-commit-counts
class Week(requester, headers, attributes, completed)
This class represents weekly statistics of a contibutor.
w
Type datetime.datetime
a
Type int
d
Type int
c
Type int
author
Type github.NamedUser.NamedUser
total
Type int
weeks
Type list of Week
3.4.74 StatsParticipation
class github.StatsParticipation.StatsParticipation
This class represents StatsParticipations. The reference can be found here http://developer.github.com/v3/repos/
statistics/#get-the-weekly-commit-count-for-the-repo-owner-and-everyone-else
all
Type list of int
owner
Type list of int
3.4.75 StatsPunchCard
class github.StatsPunchCard.StatsPunchCard
This class represents StatsPunchCards. The reference can be found here http://developer.github.com/v3/repos/
statistics/#get-the-number-of-commits-per-hour-in-each-day
get(day, hour)
Get a specific element :param day: int :param hour: int :rtype: int
3.4.76 Status
class github.Status.Status
This class represents Statuses. The reference can be found here https://status.github.com/api
status
Type string
last_updated
Type datetime.datetime
3.4.77 StatusMessage
class github.StatusMessage.StatusMessage
This class represents StatusMessages. The reference can be found here https://status.github.com/api
body
Type string
status
Type string
created_on
Type datetime.datetime
3.4.78 Tag
class github.Tag.Tag
This class represents Tags. The reference can be found here https://developer.github.com/v3/repos/#list-tags
commit
Type github.Commit.Commit
name
Type string
tarball_url
Type string
zipball_url
Type string
3.4.79 Team
class github.Team.Team
This class represents Teams. The reference can be found here http://developer.github.com/v3/orgs/teams/
id
Type integer
members_count
Type integer
members_url
Type string
name
Type string
description
Type string
permission
Type string
repos_count
Type integer
repositories_url
Type string
slug
Type string
url
Type string
organization
Type github.Organization.Organization
privacy
Type string
add_to_members(member)
This API call is deprecated. Use add_membership instead. https://developer.github.com/v3/teams/
members/#deprecation-notice-1
Calls PUT /teams/:id/members/:user
Parameters member – github.NamedUser.NamedUser
Return type None
add_membership(member, role=NotSet)
Calls PUT /teams/:id/memberships/:user
Parameters
• member – github.Nameduser.NamedUser
• role – string
Return type None
add_to_repos(repo)
Calls PUT /teams/:id/repos/:org/:repo
Parameters repo – github.Repository.Repository
Return type None
set_repo_permission(repo, permission)
Calls PUT /teams/:id/repos/:org/:repo
Parameters
• repo – github.Repository.Repository
• permission – string
Return type None
delete()
Calls DELETE /teams/:id
Return type None
edit(name, description=NotSet, permission=NotSet, privacy=NotSet)
Calls PATCH /teams/:id
Parameters
• name – string
• description – string
• permission – string
• privacy – string
Return type None
get_members(role=NotSet)
Calls GET /teams/:id/members
Parameters role – string
Return type github.PaginatedList.PaginatedList of github.NamedUser.
NamedUser
get_repos()
Calls GET /teams/:id/repos
Return type github.PaginatedList.PaginatedList of github.Repository.
Repository
has_in_members(member)
Calls GET /teams/:id/members/:user
Parameters member – github.NamedUser.NamedUser
Return type bool
has_in_repos(repo)
Calls GET /teams/:id/repos/:owner/:repo
Parameters repo – github.Repository.Repository
Return type bool
remove_membership(member)
Calls DELETE /teams/:team_id/memberships/:username <https://developer.github.com/v3/teams/members/#remove-
team-membership>
Parameters member –
Returns
remove_from_members(member)
This API call is deprecated. Use remove_membership instead: https://developer.github.com/v3/teams/
members/#deprecation-notice-2
Calls DELETE /teams/:id/members/:user
Parameters member – github.NamedUser.NamedUser
Return type None
remove_from_repos(repo)
Calls DELETE /teams/:id/repos/:owner/:repo
Parameters repo – github.Repository.Repository
Return type None
3.4.80 Topic
class github.Topic.Topic
This class represents topics as used by https://github.com/topics. The object refereence can be found here
https://developer.github.com/v3/search/#search-topics
name
Type string
display_name
Type string
short_description
Type string
description
Type string
3.4.81 UserKey
class github.UserKey.UserKey
This class represents UserKeys. The reference can be found here http://developer.github.com/v3/users/keys/
id
Type integer
key
Type string
title
Type string
url
Type string
verified
Type bool
delete()
Calls DELETE /user/keys/:id
Return type None
3.4.82 View
class github.View.View
This class represents a popular Path for a GitHub repository. The reference can be found here https://developer.
github.com/v3/repos/traffic/
timestamp
Type datetime.datetime
count
Type integer
uniques
Type integer
Change log
New features
• Add Migration API (#899) (b4d895ed)
• Add Traffic API (#977) (a433a2fe)
• New in Project API: create repository project, create project column (#995) (1c0fd97d)
Bug Fixes & Improvements
• Change type of GitRelease.author to NamedUser (#969) (aca50a75)
• Use total_count from data in PaginatedList (#963) (ec177610)
New features
• Add support for JWT authentication (#948) (8ccf9a94)
• Added support for required signatures on protected branches (#939) (8ee75a28)
• Ability to filter repository collaborators (#938) (5687226b)
• Mark notification as read (#932) (0a10d7cd)
• Add highlight search to search_code function (#925) (1fa25670)
• Adding suspended_at property to NamedUSer (#922) (c13b43ea)
• Add since parameter for Gists (#914) (e18b1078)
Bug Fixes & Improvements
137
PyGithub Documentation, Release 1.43.4
New feature:
• Add support for Projects (#854) (faca4ce1)
BUGFIX
• Repository.get_archive_link will now NOT follow HTTP redirect and return the url instead (#858)
(43d325a5)
• Fixed Gistfile.content (#486) (e1df09f7)
• Restored NamedUser.contributions attribute (#865) (b91dee8d)
New features
• Add support for repository topics (#832) (c6802b51)
• Add support for required approving review count (#888) (ef16702)
• Add Organization.invite_user (880)(eb80564)
• Add support for search/graphql rate limit (fd8a036)
– Deprecated RateLimit.rate
– Add RateLimit.core, RateLimit.search and RateLimit.graphql
• Add Support search by topics (#893) (3ce0418)
• Branch Protection API overhaul (#790) (171cc567)
– (breaking) Removed Repository.protect_branch
– Add BranchProtection
– Add RequiredPullRequestReviews
– Add RequiredStatusChecks
BUGFIX
• Repository.get_archive_link will now NOT follow HTTP redirect and return the url instead (#858)
(43d325a5)
• Fixed Gistfile.content (#486) (e1df09f7)
• Restored NamedUser.contributions attribute (#865) (b91dee8d)
New features
• Add support for repository topics (#832) (c6802b51)
• Branch Protection API overhaul (#790) (171cc567)
– (breaking) Removed Repository.protect_branch
– Add BranchProtection
– Add RequiredPullRequestReviews
– Add RequiredStatusChecks
– Add Branch.get_protection, Branch.get_required_pull_request_reviews,
Branch.get_required_status_checks, etc
Improvements
• Add missing arguments to Repository.edit (#844) (29d23151)
• Add missing properties to Repository (#842) (2b352fb3)
• Adding archival support for Repository.edit (#843) (1a90f5db)
• Add tag_name and target_commitish arguments to GitRelease.update_release (#834)
(790f7dae)
• Allow editing of Team descriptions (#839) (c0021747)
• Add description to Organizations (#838) (1d918809)
• Major enhancement: use requests for HTTP instead of httplib (#664) (9aed19dd)
• Test Framework improvement (#795) (faa8f205)
• Handle HTTP 202 HEAD & GET with a retry (#791) (3aead158)
• Fix github API requests after asset upload (#771) (8bdac23c)
• Add remove_membership() method to Teams class (#807) (817f2230)
• Add check-in to projects using PyGithub (#814) (05f49a59)
• Include target_commitish in GitRelease (#788) (ba5bf2d7)
• Fix asset upload timeout, increase default timeout from 10s to 15s (#793) (140c6480)
• Fix Team.description (#797) (0e8ae376)
• Fix Content-Length invalid headers exception (#787) (23395f5f)
• this version was never released to PyPi due to a problem with the deployment
• Work around the GitHub API v3 returning nulls in some paginated responses, erichaase for the bug report
• Fix two-factor authentication header, thanks to tradej for the pull request
• Implement getting repos by id, thanks to tylertreat for the pull request
• Add Gist.owner, thanks to dalejung for the pull request
• Fix all that is based on headers in Python 3 (pagination, conditional request, rate_limit. . . ), huge thanks to
cwarren-mw for finding the bug
• Accept strings for assignees and collaborators, thanks to farrd
• Ease two-factor authentication by adding ‘onetime_password’ to AuthenticatedUser.create_authorization,
thanks to cameronbwhite
• Implement conditional requests by the method GithubObject.update. Thank you very much akfish for
the pull request and your collaboration!
• Implement persistence of PyGithub objects: Github.save and Github.load. Don’t forget to update
your objects after loading them, it won’t decrease your rate limiting quota if nothing has changed. Again, thank
you akfish
• Implement Github.get_repos to get all public repositories
• Implement NamedUser.has_in_following
• Issues’ repository attribute will never be None. Thank you stuglaser for the pull request
• No more false assumption on rate_limiting, and creation of rate_limiting_resettime. Thank you
edjackson for the pull request
• New parameters since and until to Repository.get_commits. Thank you apetresc for the pull re-
quest
• Catch Json parsing exception for some internal server errors, and throw a better exception. Thank you
MarkRoddy for the pull request
• Allow reversed iteration of PaginatedList. Thank you davidbrai for the pull request
• Fix bug in Repository.get_comment when using custom per_page. Thank you davidbrai
• Handle Http redirects in Repository.get_dir_contents. Thank you MarkRoddy
• Implement API /user in Github.get_users. Thank you rakeshcusat for asking
• Improve the documentation. Thank you martinqt
• Implement listing of user issues with all parameters. Thank you Daehyok Shin for reporting
• Raise two new specific exceptions
• Fix paginated requests when using secret-key oauth. Thank you jseabold for analysing the bug
• Set the default User-Agent header to “PyGithub/Python”. (Github has enforced the User Agent header yester-
day.) Thank you jjh42 for the fix, thank you jasenmh and pconrad for reporting the issue.
• Fix login/password authentication for Python 3. Thank you sebastianstigler for reporting
• Fix for Python 3 on case-insensitive file-systems. Thank you ptwobrussell for reporting
• Expose raw data returned by Github for all objects. Thank you ptwobrussell for asking
• Add a property github.MainClass.Github.per_page (and a parameter to the constructor) to change
the number of items requested in paginated requests. Thank you again ptwobrussell for asking
• Implement the first part of the Notifications API. Thank you pgolm
• Fix automated tests on Python 3.3. Thank you bkabrda for reporting
• Fix major issue with Python 3: Json decoding was broken. Thank you bilderbuchi for reporting
• Fix bug in PaginatedList without url parameters. Thank you llimllib for the contribution
• Implement github.NamedUser.NamedUser.get_keys()
• Support PubSubHub: github.Repository.Repository.subscribe_to_hub() and github.
Repository.Repository.unsubscribe_from_hub()
• Publish the oauth scopes in github.MainClass.Github.oauth_scopes, thank you bilderbuchi for
asking
• Major improvement: support Python 3! PyGithub is automaticaly tested on Travis with versions 2.5, 2.6, 2.7,
3.1 and 3.2 of Python
• Add a shortcut function github.MainClass.Github.get_repo() to get a repo directly from its full
name. thank you lwc for the contribution
• github.MainClass.Github.get_gitignore_templates() and github.MainClass.
Github.get_gitignore_template() for APIs /gitignore/templates
• Add the optional ref parameter to github.Repository.Repository.get_contents() and
github.Repository.Repository.get_readme(). Thank you fixxxeruk for the contribution
• Get comments for all issues and all pull requests on a repository (GET /repos/:owner/:repo/
pulls/comments: github.Repository.Repository.get_pulls_comments() or github.
Repository.Repository.get_pulls_review_comments(); GET /repos/:owner/:repo/
issues/comments: github.Repository.Repository.get_issues_comments())
• Fix an assertion failure when integers returned by Github do not fit in a Python int
• You can now use your client_id and client_secret to increase rate limiting without authentication
• You can now send a custom User-Agent
• PullRequest now has its ‘assignee’ attribute, thank you mstead
• Repository.edit now has ‘default_branch’ parameter
• create_repo has ‘auto_init’ and ‘gitignore_template’ parameters
• GistComment URL is changed (see http://developer.github.com/changes/2012-10-31-gist-comment-uris)
• A typo in the readme was fixed by tymofij, thank you
• Internal stuff:
– Add encoding comment to Python files, thank you Zearin
– Restore support of Python 2.5
– Restore coverage measurement in setup.py test
– Small refactoring
• Repository.get_git_ref prepends “refs/” to the requested references. Thank you simon-weber for noting the
incoherence between documentation and behavior. If you feel like it’s a breaking change, please see this issue
• Enable Travis CI
• Fix error 500 when json payload contains percent character (%). Thank you again quixotique for pointing that
and reporting it to Github
• Enable debug logging. Logger name is “github”. Simple logging can be enabled by
github.enable_console_debug_logging(). Thank you quixotique for the merge request and the advice
• Publish tests in the PyPi source archive to ease QA tests of the FreeBSD port. Thank you koobs for maintaining
this port
• Switch to Semantic Versioning
• Respect pep8 Style Guide for Python Code
• Be able to clear the assignee and the milestone of an Issue. Thank you quixotique for the merge request
• Fix an AssertionFailure in Organization.get_xxx when using Github Enterprise. Thank you mnsanghvi for
pointing that
• Expose pagination to users needing it (PaginatedList.get_page). Thank you kukuts for asking
• Improve handling of legacy search APIs
• Small refactoring (documentation, removal of old code generation artifacts)
• Add a timeout option, thank you much xobb1t for the merge request. This drops Python 2.5 support. I may be
able to restore it in next version.
• Implement Repository.delete, thank you pmchen for asking
• Allow connection to a custom Github URL, for Github Enterprise, thank you very much engie for the merge
request
• Implement legacy search APIs, thank you kukuts for telling me Github had released them
• Fix a bug with issue labels containing spaces, thank you philipkimmey for detecting the bug and fixing it
• Clarify how collections of objects are returned by get_* methods, thank you bilderbuchi for asking
• 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/:owner/:repo/compare/:base. . . :head
– GET /repos/:owner/:repo/git/trees/:sha?recursive-1
– POST /repos/:owner/:repo/git/trees?base_tree-
• 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
g
github, 17
github.GithubException, 38
155
PyGithub Documentation, Release 1.43.4
157
PyGithub Documentation, Release 1.43.4
158 Index
PyGithub Documentation, Release 1.43.4
Index 159
PyGithub Documentation, Release 1.43.4
method), 56 tribute), 98
create_reaction() (github.Issue.Issue method), 78 created_at (github.PullRequest.PullRequest attribute),
create_reaction() (github.IssueComment.IssueComment 100
method), 79 created_at (github.PullRequestComment.PullRequestComment
create_reaction() (github.PullRequestComment.PullRequestComment attribute), 105
method), 106 created_at (github.Reaction.Reaction attribute), 108
create_repo() (github.AuthenticatedUser.AuthenticatedUser created_at (github.Repository.Repository attribute), 110
method), 44 created_at (github.RepositoryKey.RepositoryKey at-
create_repo() (github.Organization.Organization tribute), 128
method), 91 created_on (github.StatusMessage.StatusMessage at-
create_review() (github.PullRequest.PullRequest tribute), 132
method), 102 creator (github.CommitStatus.CommitStatus attribute),
create_review_comment() 57
(github.PullRequest.PullRequest method), creator (github.Milestone.Milestone attribute), 83
101 creator (github.Project.Project attribute), 97
create_review_request() (github.PullRequest.PullRequest creator (github.ProjectCard.ProjectCard attribute), 98
method), 102
create_source_import() (github.Repository.Repository D
method), 116 d (github.StatsContributor.StatsContributor.Week at-
create_status() (github.Commit.Commit method), 54 tribute), 131
create_team() (github.Organization.Organization data (github.GithubException.GithubException attribute),
method), 92 38
created_at (github.AuthenticatedUser.AuthenticatedUser date (github.GitAuthor.GitAuthor attribute), 66
attribute), 41 days (github.StatsCommitActivity.StatsCommitActivity
created_at (github.Authorization.Authorization attribute), attribute), 130
49 default_branch (github.Repository.Repository attribute),
created_at (github.CommitComment.CommitComment 110
attribute), 55 delete() (github.Authorization.Authorization method), 50
created_at (github.CommitStatus.CommitStatus at- delete() (github.CommitComment.CommitComment
tribute), 57 method), 56
created_at (github.Download.Download attribute), 59 delete() (github.Download.Download method), 60
created_at (github.Event.Event attribute), 60 delete() (github.Gist.Gist method), 63
created_at (github.Gist.Gist attribute), 62 delete() (github.GistComment.GistComment method), 64
created_at (github.GistComment.GistComment attribute), delete() (github.GitRef.GitRef method), 68
64 delete() (github.Hook.Hook method), 72
created_at (github.GistHistoryState.GistHistoryState at- delete() (github.IssueComment.IssueComment method),
tribute), 65 78
created_at (github.GitRelease.GitRelease attribute), 69 delete() (github.Label.Label method), 80
created_at (github.GitReleaseAsset.GitReleaseAsset at- delete() (github.Migration.Migration method), 82
tribute), 70 delete() (github.Milestone.Milestone method), 83
created_at (github.Hook.Hook attribute), 72 delete() (github.PullRequestComment.PullRequestComment
created_at (github.Invitation.Invitation attribute), 74 method), 105
created_at (github.Issue.Issue attribute), 75 delete() (github.Reaction.Reaction method), 108
created_at (github.IssueComment.IssueComment at- delete() (github.Repository.Repository method), 116
tribute), 78 delete() (github.RepositoryKey.RepositoryKey method),
created_at (github.IssueEvent.IssueEvent attribute), 79 128
created_at (github.Migration.Migration attribute), 82 delete() (github.Team.Team method), 134
created_at (github.Milestone.Milestone attribute), 83 delete() (github.UserKey.UserKey method), 136
created_at (github.NamedUser.NamedUser attribute), 84 delete_asset() (github.GitReleaseAsset.GitReleaseAsset
created_at (github.Organization.Organization attribute), method), 70
89 delete_file() (github.Repository.Repository method), 120
created_at (github.Project.Project attribute), 97 delete_hook() (github.Organization.Organization
created_at (github.ProjectCard.ProjectCard attribute), 98 method), 92
created_at (github.ProjectColumn.ProjectColumn at- delete_labels() (github.Issue.Issue method), 76
160 Index
PyGithub Documentation, Release 1.43.4
Index 161
PyGithub Documentation, Release 1.43.4
162 Index
PyGithub Documentation, Release 1.43.4
Index 163
PyGithub Documentation, Release 1.43.4
164 Index
PyGithub Documentation, Release 1.43.4
Index 165
PyGithub Documentation, Release 1.43.4
166 Index
PyGithub Documentation, Release 1.43.4
Index 167
PyGithub Documentation, Release 1.43.4
message (github.PullRequestMergeStatus.PullRequestMergeStatus
Notification (class in github.Notification), 88
attribute), 106 notifications_url (github.Repository.Repository attribute),
Migration (class in github.Migration), 82 111
Milestone (class in github.Milestone), 83 NotificationSubject (class in github.NotificationSubject),
milestone (github.Issue.Issue attribute), 75 88
milestone (github.IssueEvent.IssueEvent attribute), 80 number (github.Issue.Issue attribute), 75
milestone (github.PullRequest.PullRequest attribute), 100 number (github.Milestone.Milestone attribute), 83
milestones_url (github.Repository.Repository attribute), number (github.Project.Project attribute), 97
111 number (github.PullRequest.PullRequest attribute), 100
mime_type (github.Download.Download attribute), 60
mirror_url (github.Repository.Repository attribute), 111 O
mode (github.GitTreeElement.GitTreeElement attribute), oauth_scopes (github.MainClass.Github attribute), 18
71 object (github.GitRef.GitRef attribute), 68
object (github.GitTag.GitTag attribute), 71
N on_behalf_of (github.InstallationAuthorization.InstallationAuthorization
name (github.AuthenticatedUser.AuthenticatedUser at- attribute), 74
tribute), 42 open_issues (github.Milestone.Milestone attribute), 83
name (github.AuthorizationApplication.AuthorizationApplication
open_issues (github.Repository.Repository attribute), 112
attribute), 50 open_issues_count (github.Repository.Repository at-
name (github.Branch.Branch attribute), 50 tribute), 112
name (github.ContentFile.ContentFile attribute), 59 org (github.Event.Event attribute), 61
name (github.Download.Download attribute), 60 Organization (class in github.Organization), 89
name (github.GitAuthor.GitAuthor attribute), 66 organization (github.Repository.Repository attribute),
name (github.GitignoreTemplate.GitignoreTemplate at- 112
tribute), 72 organization (github.Team.Team attribute), 133
name (github.GitReleaseAsset.GitReleaseAsset at- organizations_url (github.AuthenticatedUser.AuthenticatedUser
tribute), 70 attribute), 42
name (github.Hook.Hook attribute), 72 organizations_url (github.NamedUser.NamedUser
name (github.HookDescription.HookDescription at- attribute), 85
tribute), 73 original_commit_id (github.PullRequestComment.PullRequestComment
name (github.Label.Label attribute), 80 attribute), 105
name (github.License.License attribute), 81 original_position (github.PullRequestComment.PullRequestComment
name (github.NamedUser.NamedUser attribute), 85 attribute), 105
name (github.Organization.Organization attribute), 90 owned_private_repos (github.AuthenticatedUser.AuthenticatedUser
name (github.Plan.Plan attribute), 96 attribute), 42
name (github.Project.Project attribute), 97 owned_private_repos (github.NamedUser.NamedUser at-
name (github.ProjectColumn.ProjectColumn attribute), tribute), 85
99 owned_private_repos (github.Organization.Organization
name (github.Repository.Repository attribute), 111 attribute), 90
name (github.Tag.Tag attribute), 132 owner (github.Gist.Gist attribute), 62
name (github.Team.Team attribute), 133 owner (github.GistHistoryState.GistHistoryState at-
name (github.Topic.Topic attribute), 135 tribute), 66
NamedUser (class in github.NamedUser), 84 owner (github.Migration.Migration attribute), 82
network_count (github.Repository.Repository attribute), owner (github.Repository.Repository attribute), 112
111 owner (github.StatsParticipation.StatsParticipation
node_id (github.IssueEvent.IssueEvent attribute), 79 attribute), 131
node_id (github.Project.Project attribute), 97 owner_url (github.Project.Project attribute), 97
node_id (github.ProjectCard.ProjectCard attribute), 98
node_id (github.ProjectColumn.ProjectColumn attribute), P
99 PaginatedList (class in github.PaginatedList), 39
note (github.Authorization.Authorization attribute), 49 parent (github.Repository.Repository attribute), 112
note (github.ProjectCard.ProjectCard attribute), 98 parents (github.Commit.Commit attribute), 54
note_url (github.Authorization.Authorization attribute), parents (github.GitCommit.GitCommit attribute), 67
49 patch (github.File.File attribute), 61
168 Index
PyGithub Documentation, Release 1.43.4
Index 169
PyGithub Documentation, Release 1.43.4
170 Index
PyGithub Documentation, Release 1.43.4
Index 171
PyGithub Documentation, Release 1.43.4
172 Index
PyGithub Documentation, Release 1.43.4
Index 173
PyGithub Documentation, Release 1.43.4
V
vcs (github.SourceImport.SourceImport attribute), 130
vcs_url (github.SourceImport.SourceImport attribute),
130
verified (github.RepositoryKey.RepositoryKey attribute),
128
verified (github.UserKey.UserKey attribute), 135
version (github.GistHistoryState.GistHistoryState at-
tribute), 66
View (class in github.View), 136
W
w (github.StatsContributor.StatsContributor.Week at-
tribute), 131
watchers (github.Repository.Repository attribute), 113
watchers_count (github.Repository.Repository attribute),
113
week (github.StatsCodeFrequency.StatsCodeFrequency
attribute), 130
week (github.StatsCommitActivity.StatsCommitActivity
attribute), 130
weeks (github.StatsContributor.StatsContributor at-
tribute), 131
Z
zipball_url (github.GitRelease.GitRelease attribute), 69
zipball_url (github.Tag.Tag attribute), 132
174 Index