GitHub
GitHub is an online tool for software collaboration.
Note
- API Credentials
If you have a GitHub account you can use your normal username and password to authenticate with the API.
You can also use a personal access token.
Quickstart
Get repo data
from parsons import GitHub
github = GitHub()
# Get repo by its full name (account/name)
parsons_repo = github.get_repo("move-coop/parsons")
Get repo issues in a ``Table``
from parsons import GitHub
github = GitHub()
# Get the first page of a repo's issues as a Table
parsons_issues_table = github.list_repo_issues("move-coop/parsons")
Download the contents of a repo file
from parsons import GitHub
github = GitHub()
# Download Parsons README.md to local "/tmp/README.md"
parsons_readme_path = github.download_file("move-coop/parsons", "README.md", local_path="/tmp/README.md")
API
- class parsons.GitHub(username=None, password=None, access_token=None)[source]
Creates a GitHub class for accessing the GitHub API.
Uses
parsons.utilities.check_env
to load credentials from environment variables if not supplied. Supports either a username and password or an access token for authentication. The client also supports unauthenticated access.- Args:
- username: Optional[str]
Username of account to use for credentials. Can be set with
GITHUB_USERNAME
environment variable.- password: Optional[str]
Password of account to use for credentials. Can be set with
GITHUB_PASSWORD
environment variable.- access_token: Optional[str]
Access token to use for credentials. Can be set with
GITHUB_ACCESS_TOKEN
environment variable.