stilt.store.FsspecStore#

class stilt.store.FsspecStore(root: 'str', cache_dir: 'str | Path | None' = None) → 'None'[source]#

Store backed by an fsspec filesystem such as s3:// or gs://.

local_path downloads a file once into a local cache that mirrors the key layout. Writing or deleting a key drops its cached copy, so a rewritten file is downloaded again.

Parameters

rootstr

URI that keys are relative to.

cache_dirstr or Path, optional

Local directory for downloaded files. A temporary directory is created on first use when omitted.

Methods#

delete(key)

Remove key if it exists.

exists(key)

Return whether key exists.

local_path(key)

Return a local copy of key, downloading it on first use.

publish_file(local_path, key)

Upload a local file to key.

read_bytes(key)

Return the bytes stored under key.

write_bytes(key, data)

Write data under key.