Skip to main content

llama-index readers github integration

Project description

LlamaIndex Readers Integration: Github

pip install llama-index-readers-github

The github readers package consists of three separate readers:

  1. Repository Reader
  2. Issues Reader
  3. Collaborators Reader

All three readers will require a personal access token (which you can generate under your account settings).

Repository Reader

This reader will read through a repo, with options to specifically filter directories and file extensions.

from llama_index.readers.github import GithubRepositoryReader, GithubClient

client = github_client = GithubClient(github_token=github_token, verbose=False)

reader = GithubRepositoryReader(
    github_client=github_client,
    owner="run-llama",
    repo="llama_index",
    use_parser=False,
    verbose=True,
    filter_directories=(
        ["docs"],
        GithubRepositoryReader.FilterType.INCLUDE,
    ),
    filter_file_extensions=(
        [
            ".png",
            ".jpg",
            ".jpeg",
            ".gif",
            ".svg",
            ".ico",
            "json",
            ".ipynb",
        ],
        GithubRepositoryReader.FilterType.EXCLUDE,
    ),
)

documents = reader.load_data(branch="main")

Issues Reader

from llama_index.readers.github import (
    GitHubRepositoryIssuesReader,
    GitHubIssuesClient,
)

github_client = GitHubIssuesClient(github_token=github_token, verbose=True)

reader = GitHubRepositoryIssuesReader(
    github_client=github_client,
    owner="moncho",
    repo="dry",
    verbose=True,
)

documents = reader.load_data(
    state=GitHubRepositoryIssuesReader.IssueState.ALL,
    labelFilters=[("bug", GitHubRepositoryIssuesReader.FilterType.INCLUDE)],
)

Collaborators Reader

from llama_index.readers.github import (
    GitHubRepositoryCollaboratorsReader,
    GitHubCollaboratorsClient,
)

github_client = GitHubCollaboratorsClient(
    github_token=github_token, verbose=True
)

reader = GitHubRepositoryCollaboratorsReader(
    github_client=github_client,
    owner="moncho",
    repo="dry",
    verbose=True,
)

documents = reader.load_data()

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

llama_index_readers_github-0.2.0.tar.gz (15.5 kB view details)

Uploaded Source

Built Distribution

llama_index_readers_github-0.2.0-py3-none-any.whl (21.8 kB view details)

Uploaded Python 3

File details

Details for the file llama_index_readers_github-0.2.0.tar.gz.

File metadata

File hashes

Hashes for llama_index_readers_github-0.2.0.tar.gz
Algorithm Hash digest
SHA256 3a00b2fe83e8ad2ffd7c3472561037cc51259d6951bdafc109d00f219eaa7c9d
MD5 c50b012d76faa9c6f449a36b8cc29eb1
BLAKE2b-256 ba5b3158e98b6dbc76a5b9b39645bd3bf14879735f118561b707977f525f3fc3

See more details on using hashes here.

File details

Details for the file llama_index_readers_github-0.2.0-py3-none-any.whl.

File metadata

File hashes

Hashes for llama_index_readers_github-0.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 df3450d48acb5770baa987fa216be092e65ec597fc2a1fb87da6f26a8e103fa2
MD5 7155c5fb16e9a412b3aad16591bf78cb
BLAKE2b-256 1b3194bf5b1cd8cbcc131044bee346482b6975d5abbcd0335754f58c2c514904

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page