-
Notifications
You must be signed in to change notification settings - Fork 384
Add gist FS #888
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
(yes, you could view this as unnecessary, since you can always get the URL for a file in a given gist from the web interface) |
This would be great and would allow downstream projects like Universal Pathlib to support it with minimal extra code. I've recently used I don't view this as unnecessary, it's a very reasonable extension from GitHub and would showcase the fsspec stable nicely. |
I implemented it! :-) import fsspec
gist_id = "c6ed259a32957069b4a39bf9e40becae"
print("Gist ID:", gist_id)
fs = fsspec.filesystem("gist", gist_id=gist_id)
file_list = fs.ls("")
print("Files in the Gist (via fsspec):", file_list) (filesystem_spec) louis 🌟 ~/dev/filesystem_spec $ python ~/lab/fsspec/gist.py
Gist ID: c6ed259a32957069b4a39bf9e40becae
Files in the Gist (via fsspec): ['1-cad.md', '2-cad.md', '3-cad.md', '4-cad.md', '5-cad.md'] |
We have a github implementation, which I find surprisingly convenient. We should also do one for gists, which also have a reasonable API https://docs.github.com/en/rest/reference/gists . We could mirror the github implementation and require user/gist_id, or only require user and auto list their gists (which have hex-like IDs, not sensible names). I tend towards the latter.
Within a gist you only have a single flat list of files.
"https://api.github.com/users/martindurant/gists"
lists my gists, AND the files within each of them, giving size and URL to the raw download. The call can be optionally paginated.The text was updated successfully, but these errors were encountered: