Skip to content

Instantly share code, notes, and snippets.

@FirefoxMetzger
Created January 27, 2022 10:37
Embed
What would you like to do?
copy a single GH folder using fsspec
import fsspec
from pathlib import Path
# flat copy
destination = Path.home() / "test_folder_copy"
destination.mkdir(exist_ok=True, parents=True)
fs = fsspec.filesystem("github", org="githubtraining", repo="hellogitworld")
fs.get(fs.ls("src/"), destination.as_posix())
# recursive copy
destination = Path.home() / "test_recursive_folder_copy"
destination.mkdir(exist_ok=True, parents=True)
fs = fsspec.filesystem("github", org="githubtraining", repo="hellogitworld")
fs.get(fs.ls("src/"), destination.as_posix(), recursive=True)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment