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

# Tqdm Callback

> Tqdm Callback: A callback to display a progress bar using tqdm. A Python demo notebook from ganymede.

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

Description:
- A callback to display a progress bar using tqdm

Resources:
- [Fsspec Docs] https://filesystem-spec.readthedocs.io/en/stable/api.html?highlight=sftp#fsspec.callbacks.TqdmCallback
- [Tqdm Docs] https://tqdm.github.io/docs/tqdm/#__init__

## Example 1

Upload a folder with a progress bar

```python
from fsspec import filesystem
from fsspec.callbacks import TqdmCallback
from pathlib import Path

fs = filesystem("memory")
fp = "/tmp/ganymede_demo"
p = Path(fp).mkdir(exist_ok=True)

upload_fp = "/tmp/ganymede_demo/upload"
p = Path(upload_fp).mkdir(exist_ok=True)

with open(f"{fp}/file1.txt", "w") as f:
    f.write("hello1")

with open(f"{fp}/file2.txt", "w") as f:
    f.write("hello2")

fs.upload(
        upload_fp,
        fp,
        recursive=True,
        callback=TqdmCallback(tqdm_kwargs={"desc": "Example tqdm description"}),
    )
```
