Tqdm Callback
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
Section titled “Example 1”Upload a folder with a progress bar
from fsspec import filesystemfrom fsspec.callbacks import TqdmCallbackfrom 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"}), )ganymede is made by Eugo