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

# Box SDK

> Box SDK: Interact with data in box.com. A Python demo notebook from ganymede.

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

Description:
- Interact with data in box.com

Resources:
- https://developer.box.com/guides/authentication/jwt/jwt-setup/
- https://developer.box.com/reference/get-authorize/
- https://support.box.com/hc/en-us/articles/4636662134803-Creating-Your-Developer-Account
- https://app.box.com/developers/console
- https://developer.box.com/guides/tooling/sdks/
- https://box-python-sdk.readthedocs.io/en/latest/boxsdk.object.html

## Environment variables

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

- `BOX_CLIENT_ID`: client ID of your Box app
- `BOX_CLIENT_SECRET`: client secret of your Box app
- `BOX_ACCESS_TOKEN`: a Box developer or OAuth access token
- `BOX_FOLDER_ID`: optional, the folder to open; defaults to `0` (the root folder)

```python
import os

import fsspec
from boxsdk import Client, OAuth2

oauth = OAuth2(
    client_id=os.environ["BOX_CLIENT_ID"],
    client_secret=os.environ["BOX_CLIENT_SECRET"],
    access_token=os.environ["BOX_ACCESS_TOKEN"],
)

client = Client(oauth)
client.folder(os.environ.get("BOX_FOLDER_ID", "0"))
```
