MCPcopy
hub / github.com/PyGithub/PyGithub

github.com/PyGithub/PyGithub @v2.9.1 sqlite

repository ↗ · DeepWiki ↗ · release v2.9.1 ↗
5,146 symbols 13,570 edges 325 files 1,045 documented · 20%
README

PyGitHub

PyPI CI readthedocs License Slack Open Source Helpers codecov Code style: black

PyGitHub is a Python library to access the GitHub REST API. This library enables you to manage GitHub resources such as repositories, user profiles, and organizations in your Python applications.

Install

pip install PyGithub

Simple Demo

from github import Github

# Authentication is defined via github.Auth
from github import Auth

# using an access token
auth = Auth.Token("access_token")

# First create a Github instance:

# Public Web Github
g = Github(auth=auth)

# Github Enterprise with custom hostname
g = Github(base_url="https://{hostname}/api/v3", auth=auth)

# Then play with your Github objects:
for repo in g.get_user().get_repos():
    print(repo.name)

# To close connections after use
g.close()

Documentation

More information can be found on the PyGitHub documentation site.

Development

Contributing

Long-term discussion and bug reports are maintained via GitHub Issues. Code review is done via GitHub Pull Requests.

For more information read CONTRIBUTING.md.

Maintainership

We're actively seeking maintainers that will triage issues and pull requests and cut releases. If you work on a project that leverages PyGitHub and have a vested interest in keeping the code alive and well, send an email to someone in the MAINTAINERS file.

Core symbols most depended-on inside this repo

_completeIfNotSet
called by 1079
github/GithubObject.py
_makeStringAttribute
called by 918
github/GithubObject.py
is_optional
called by 372
github/GithubObject.py
requestJsonAndCheck
called by 310
github/Requester.py
assertListKeyEqual
called by 310
tests/Framework.py
get_repo
called by 270
github/MainClass.py
_makeIntAttribute
called by 253
github/GithubObject.py
get
called by 227
github/StatsPunchCard.py

Shape

Method 4,675
Class 420
Function 37
Route 14

Languages

Python100%

Modules by API surface

github/Repository.py288 symbols
tests/Repository.py170 symbols
github/Organization.py158 symbols
scripts/openapi.py127 symbols
github/AuthenticatedUser.py100 symbols
github/PullRequest.py92 symbols
github/NamedUser.py91 symbols
tests/Organization.py90 symbols
github/GithubObject.py90 symbols
github/Requester.py87 symbols
github/Issue.py78 symbols
tests/Framework.py73 symbols

Dependencies from manifests, versioned

pynacl1.4.0 · 1×
requests2.14.0 · 1×

For agents

$ claude mcp add PyGithub \
  -- python -m otcore.mcp_server <graph>

⬇ download graph artifact