Skip to content

GitHub

Loaders for GitHub.

GitHubIssueLoader

Loader for GitHub issues in a given repository.

Beware the GitHub API rate limit.

Attributes:

Name Type Description
repo str

The GitHub repository in the format 'owner/repo'.

n_issues int

The number of issues to load.

include_comments bool

Whether to include comments in the issues.

ignore_body_after str

The text to ignore in the issue body.

ignore_users List[str]

A list of users to ignore.

use_GH_token bool

Whether to use the GITHUB_TOKEN environment variable for authentication (recommended).

load async

Load all issues for the given repository.

Returns:

Type Description
list[Document]

A list of Document objects, each representing an issue.

GitHubRepoLoader

Loader for files on GitHub that match a glob pattern.

Attributes:

Name Type Description
repo str

The GitHub repository in the format 'owner/repo'.

include_globs list[str]

A list of glob patterns to include.

exclude_globs list[str]

A list of glob patterns to exclude.

Raises:

Type Description
ValueError

If the repository is not in the format 'owner/repo'.

Example

Load all files from the prefecthq/prefect

from raggy.loaders.github import GitHubRepoLoader

loader = GitHubRepoLoader(repo="prefecthq/prefect")

documents = await loader.load()
print(documents)

load async

Load files from GitHub that match the glob pattern.