# 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.
```python
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
```python
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
```python
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()
```
Raw data
{
"_id": null,
"home_page": null,
"name": "llama-index-readers-github",
"maintainer": "ahmetkca",
"docs_url": null,
"requires_python": "<4.0,>=3.9",
"maintainer_email": null,
"keywords": "code, collaborators, git, github, issues, placeholder, repository, source code",
"author": "Your Name",
"author_email": "you@example.com",
"download_url": "https://files.pythonhosted.org/packages/9e/8c/9a71362084b1cab15a0bdfc510f47bb784caf8bb1d9a9527063e1f7fa8a5/llama_index_readers_github-0.5.0.tar.gz",
"platform": null,
"description": "# LlamaIndex Readers Integration: Github\n\n`pip install llama-index-readers-github`\n\nThe github readers package consists of three separate readers:\n\n1. Repository Reader\n2. Issues Reader\n3. Collaborators Reader\n\nAll three readers will require a personal access token (which you can generate under your account settings).\n\n## Repository Reader\n\nThis reader will read through a repo, with options to specifically filter directories and file extensions.\n\n```python\nfrom llama_index.readers.github import GithubRepositoryReader, GithubClient\n\nclient = github_client = GithubClient(github_token=github_token, verbose=False)\n\nreader = GithubRepositoryReader(\n github_client=github_client,\n owner=\"run-llama\",\n repo=\"llama_index\",\n use_parser=False,\n verbose=True,\n filter_directories=(\n [\"docs\"],\n GithubRepositoryReader.FilterType.INCLUDE,\n ),\n filter_file_extensions=(\n [\n \".png\",\n \".jpg\",\n \".jpeg\",\n \".gif\",\n \".svg\",\n \".ico\",\n \"json\",\n \".ipynb\",\n ],\n GithubRepositoryReader.FilterType.EXCLUDE,\n ),\n)\n\ndocuments = reader.load_data(branch=\"main\")\n```\n\n## Issues Reader\n\n```python\nfrom llama_index.readers.github import (\n GitHubRepositoryIssuesReader,\n GitHubIssuesClient,\n)\n\ngithub_client = GitHubIssuesClient(github_token=github_token, verbose=True)\n\nreader = GitHubRepositoryIssuesReader(\n github_client=github_client,\n owner=\"moncho\",\n repo=\"dry\",\n verbose=True,\n)\n\ndocuments = reader.load_data(\n state=GitHubRepositoryIssuesReader.IssueState.ALL,\n labelFilters=[(\"bug\", GitHubRepositoryIssuesReader.FilterType.INCLUDE)],\n)\n```\n\n## Collaborators Reader\n\n```python\nfrom llama_index.readers.github import (\n GitHubRepositoryCollaboratorsReader,\n GitHubCollaboratorsClient,\n)\n\ngithub_client = GitHubCollaboratorsClient(\n github_token=github_token, verbose=True\n)\n\nreader = GitHubRepositoryCollaboratorsReader(\n github_client=github_client,\n owner=\"moncho\",\n repo=\"dry\",\n verbose=True,\n)\n\ndocuments = reader.load_data()\n```\n",
"bugtrack_url": null,
"license": "MIT",
"summary": "llama-index readers github integration",
"version": "0.5.0",
"project_urls": null,
"split_keywords": [
"code",
" collaborators",
" git",
" github",
" issues",
" placeholder",
" repository",
" source code"
],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "d54be0a138eee5fd9b4230fe2c9f369362d8895622d77ece8f4a59ded19c3ec3",
"md5": "dab72ef5e7d36dab3f33bd7ee977262e",
"sha256": "5b23a5665511d1aca5105d23bbbd3dba9427d59ac1ac28411637c8ac80f7d252"
},
"downloads": -1,
"filename": "llama_index_readers_github-0.5.0-py3-none-any.whl",
"has_sig": false,
"md5_digest": "dab72ef5e7d36dab3f33bd7ee977262e",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": "<4.0,>=3.9",
"size": 21864,
"upload_time": "2024-11-18T01:01:16",
"upload_time_iso_8601": "2024-11-18T01:01:16.224606Z",
"url": "https://files.pythonhosted.org/packages/d5/4b/e0a138eee5fd9b4230fe2c9f369362d8895622d77ece8f4a59ded19c3ec3/llama_index_readers_github-0.5.0-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "9e8c9a71362084b1cab15a0bdfc510f47bb784caf8bb1d9a9527063e1f7fa8a5",
"md5": "7e40aa71284831200e68763d9e6b408d",
"sha256": "4468e9b5eaa6938ac88cfcb7017902c7aeb3906f6661439d3fdf73e2c1ba2870"
},
"downloads": -1,
"filename": "llama_index_readers_github-0.5.0.tar.gz",
"has_sig": false,
"md5_digest": "7e40aa71284831200e68763d9e6b408d",
"packagetype": "sdist",
"python_version": "source",
"requires_python": "<4.0,>=3.9",
"size": 15515,
"upload_time": "2024-11-18T01:01:17",
"upload_time_iso_8601": "2024-11-18T01:01:17.868644Z",
"url": "https://files.pythonhosted.org/packages/9e/8c/9a71362084b1cab15a0bdfc510f47bb784caf8bb1d9a9527063e1f7fa8a5/llama_index_readers_github-0.5.0.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2024-11-18 01:01:17",
"github": false,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"lcname": "llama-index-readers-github"
}