> Every page of the ganymede website is listed in https://eugo.io/docs/ganymede/llms.txt.

# GitHubFS

> GitHubFS: Work with data in github. A Python demo notebook from ganymede.

Web page: https://eugo.io/docs/ganymede/demo_notebooks/data_storage/filesystems/fsspec/githubfs/
Notebook: https://eugo.io/docs/ganymede/demo_notebooks/data_storage/filesystems/fsspec/githubfs/githubfs.ipynb (source: https://github.com/eugo-inc/ganymede/blob/main/demo_notebooks/data_storage/filesystems/fsspec/githubfs.ipynb)

Description:
- Work with data in github

Resources:
- [Source Code] https://filesystem-spec.readthedocs.io/en/latest/_modules/fsspec/implementations/github.html?highlight=github#
- [Docs] https://filesystem-spec.readthedocs.io/en/latest/api.html?highlight=github#fsspec.implementations.github.GithubFileSystem

## Environment variables

This notebook reads its settings from environment variables. Set them before starting Jupyter:

- `GITHUB_ORG`: GitHub organization or user that owns the repository
- `GITHUB_REPO`: repository name
- `GITHUB_USERNAME`: your GitHub user name
- `GITHUB_TOKEN`: a GitHub personal access token that can read the repository

Only Example 2 needs these; Example 1 reads a public repository anonymously.

## Example 1

Unauthorized Access. Listing objects in a repo.

```python
from fsspec import filesystem

# Example: https://github.com/fsspec/filesystem_spec
fs = filesystem("github", org="fsspec", repo="filesystem_spec")
fs.ls("")
```

## Example 2

Authorized access. Listing objects in a repo.

For authorised access, you must provide username and token, which can be made at https://github.com/settings/tokens

```python
import os

from fsspec import filesystem

# Example: https://github.com/<org>/<repo>
fs = filesystem(
    "github",
    org=os.environ["GITHUB_ORG"],
    repo=os.environ["GITHUB_REPO"],
    username=os.environ["GITHUB_USERNAME"],
    token=os.environ["GITHUB_TOKEN"],
)
fs.ls("")
```
