GithubRepositoryReader#

class llama_index.readers.GithubRepositoryReader(owner: str, repo: str, use_parser: bool = True, verbose: bool = False, github_token: Optional[str] = None, concurrent_requests: int = 5, ignore_file_extensions: Optional[List[str]] = None, ignore_directories: Optional[List[str]] = None)#

Bases: BaseReader

Github repository reader.

Retrieves the contents of a Github repository and returns a list of documents. The documents are either the contents of the files in the repository or the text extracted from the files using the parser.

Examples

>>> reader = GithubRepositoryReader("owner", "repo")
>>> branch_documents = reader.load_data(branch="branch")
>>> commit_documents = reader.load_data(commit_sha="commit_sha")

Methods Summary

load_data([commit_sha, branch])

Load data from a commit or a branch.

Methods Documentation

load_data(commit_sha: Optional[str] = None, branch: Optional[str] = None) List[Document]#

Load data from a commit or a branch.

Loads github repository data from a specific commit sha or a branch.

Parameters
  • commit – commit sha

  • branch – branch name

Returns

list of documents