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.5.0.tar.gz (15.5 kB view details)

Uploaded Source

Built Distribution

llama_index_readers_github-0.5.0-py3-none-any.whl (21.9 kB view details)

Uploaded Python 3

File details

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

File metadata

File hashes

Hashes for llama_index_readers_github-0.5.0.tar.gz
Algorithm Hash digest
SHA256 4468e9b5eaa6938ac88cfcb7017902c7aeb3906f6661439d3fdf73e2c1ba2870
MD5 7e40aa71284831200e68763d9e6b408d
BLAKE2b-256 9e8c9a71362084b1cab15a0bdfc510f47bb784caf8bb1d9a9527063e1f7fa8a5

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for llama_index_readers_github-0.5.0-py3-none-any.whl
Algorithm Hash digest
SHA256 5b23a5665511d1aca5105d23bbbd3dba9427d59ac1ac28411637c8ac80f7d252
MD5 dab72ef5e7d36dab3f33bd7ee977262e
BLAKE2b-256 d54be0a138eee5fd9b4230fe2c9f369362d8895622d77ece8f4a59ded19c3ec3

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