# 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.8.1",
"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/29/d8/f228f3f62ad1dd9387a2cecbb9efd1c191f5fb33e4f0d24ec6f222aa321f/llama_index_readers_github-0.1.8.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.1.8",
"project_urls": null,
"split_keywords": [
"code",
" collaborators",
" git",
" github",
" issues",
" placeholder",
" repository",
" source code"
],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "0be5183e29af3a26fa4b6e022d0f4c71c6ecd84730d2af2c2f777e7a085e98c4",
"md5": "8b0cc9ba8657e740f15805c347fe0ecd",
"sha256": "e3042a69412cde2e6ced45b8aa051e5fb849fd960fb4dfaad54e9e22853d6d5d"
},
"downloads": -1,
"filename": "llama_index_readers_github-0.1.8-py3-none-any.whl",
"has_sig": false,
"md5_digest": "8b0cc9ba8657e740f15805c347fe0ecd",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": "<4.0,>=3.8.1",
"size": 21653,
"upload_time": "2024-04-30T16:56:43",
"upload_time_iso_8601": "2024-04-30T16:56:43.373464Z",
"url": "https://files.pythonhosted.org/packages/0b/e5/183e29af3a26fa4b6e022d0f4c71c6ecd84730d2af2c2f777e7a085e98c4/llama_index_readers_github-0.1.8-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "29d8f228f3f62ad1dd9387a2cecbb9efd1c191f5fb33e4f0d24ec6f222aa321f",
"md5": "0017f060f6e57549ea4e93227e964950",
"sha256": "ed4bb655a071b5681fe61a6ea5562f6b8c5aec068057cb1dfb05a1d75fc959ac"
},
"downloads": -1,
"filename": "llama_index_readers_github-0.1.8.tar.gz",
"has_sig": false,
"md5_digest": "0017f060f6e57549ea4e93227e964950",
"packagetype": "sdist",
"python_version": "source",
"requires_python": "<4.0,>=3.8.1",
"size": 15185,
"upload_time": "2024-04-30T16:56:44",
"upload_time_iso_8601": "2024-04-30T16:56:44.493762Z",
"url": "https://files.pythonhosted.org/packages/29/d8/f228f3f62ad1dd9387a2cecbb9efd1c191f5fb33e4f0d24ec6f222aa321f/llama_index_readers_github-0.1.8.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2024-04-30 16:56:44",
"github": false,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"lcname": "llama-index-readers-github"
}