Native python integration for fsspec backends
This library wraps an fsspec filesystem so that files and folders inside it can be imported in Python.
from fsspec import open
open(f"python::s3://my-python-bucket")
import my_bucket_lib # s3://my-python-bucket/my_bucket_lib.py
In addition to the python::
chained protocol url, this library exposes a handful of functions and monkey patches for connecting Python internal mechanisms to an fsspec
-based filesystem.
- install_importer: install an
install_importer(fsspec: str, **fsspec_args: str)
: install an fsspec url/args as an importeruninstall_importer(fsspec: str = "")
: uninstall an fsspec url, or if nothing provided remove the last-installed oneinstall_open_hook(fsspec: str, **fsspec_args)
: monkeypatch Python'sopen
builtin to run off anfsspec
filesystemuninstall_open_hook()
: remove the monkeypatchedopen
Coming soon:
- Monkey patching for
os
/os.path
/pathlib
Note
This library was generated using copier from the Base Python Project Template repository.