Directory.mount

Directory.mount(path=os.cwd(), *, foreground=False) → Path

Mounts the virtual directory on disk, without initially download files. Files will then be loaded incrementally as accessed – similar to how cloud-synced files exist in Google Drive, Dropbox, etc.

This method requires libfuse to be installed. This comes standard in many Linux distributions, but may need to be installed through your package manager. If you are running in a Docker environment, or under certain security restrictions, you may need to take additional steps to enable libfuse.

For MacOS users, install FUSE-T (recommended) or macFUSE. Windows functionality is untested at this time.

Parameters:

path : str | pathlib.Path The mount path for the directory. Will automatically create any subdirectories as needed. If not specified, will be mounted as a subfolder within the current working directory.

foreground : bool, default False Whether to run in the foreground, pausing execution of the current thread until unmounted.

Returns:

pathlib.Path (the mount path)

Examples:

import redivis

dir = redivis.table("table_ref").to_directory()

# All files are now (instantaneously!) available on the local filesystem, though they
#     will need to be downloaded as they are accessed.
dir.mount("/scratch/files")

Last updated

Was this helpful?