API Reference

Proxy

fsspec_proxy.file_manager.FileSystemManager([...])

Holds configured fsspec instances

fsspec_proxy.bytes_server.delete_file(key, ...)

fsspec_proxy.bytes_server.get_bytes(key, ...)

fsspec_proxy.bytes_server.list_dir(key, path)

fsspec_proxy.bytes_server.list_root()

fsspec_proxy.bytes_server.put_bytes(key, ...)

fsspec_proxy.bytes_server.setup(request)

class fsspec_proxy.file_manager.FileSystemManager(config_path=None)[source]

Holds configured fsspec instances

get_filesystem(key)[source]

Get filesystem instance by configured name

initialize_filesystems()[source]

Create filesystem instances

load_config(config_path=None)[source]

Reset the config

async fsspec_proxy.bytes_server.delete_file(key, path, response: Response)[source]
async fsspec_proxy.bytes_server.get_bytes(key, path, request: Request)[source]
async fsspec_proxy.bytes_server.list_dir(key, path)[source]
async fsspec_proxy.bytes_server.list_root()[source]
async fsspec_proxy.bytes_server.put_bytes(key, path, request: Request, response: Response)[source]
async fsspec_proxy.bytes_server.setup(request: Request)[source]

Client

pyscript_fsspec_client.client.PyscriptFileSystem(...)

class pyscript_fsspec_client.client.PyscriptFileSystem(*args, **kwargs)[source]
cat_file(path, start=None, end=None, **kw)[source]

Get the content of a file

Parameters:
path: URL of file on this filesystems
start, end: int

Bytes limits of the read. If negative, backwards from end, like usual python slices. Either can be None for start or end of file, respectively

kwargs: passed to ``open()``.
ls(path, detail=True, **kwargs)[source]

List objects at path.

This should include subdirectories and files at that location. The difference between a file and a directory must be clear when details are requested.

The specific keys, or perhaps a FileInfo class, or similar, is TBD, but must be consistent across implementations. Must include:

  • full path to the entry (without protocol)

  • size of the entry, in bytes. If the value cannot be determined, will be None.

  • type of entry, “file”, “directory” or other

Additional information may be present, appropriate to the file-system, e.g., generation, checksum, etc.

May use refresh=True|False to allow use of self._ls_from_cache to check for a saved listing and avoid calling the backend. This would be common where listing may be expensive.

Parameters:
path: str
detail: bool

if True, gives a list of dictionaries, where each is the same as the result of info(path). If False, gives a list of paths (str).

kwargs: may have additional backend-specific options, such as version

information

Returns:
List of strings if detail is False, or list of directory information
dicts if detail is True.
pipe_file(path, value, mode='overwrite', **kwargs)[source]

Set the bytes of given file

rm_file(path)[source]

Delete a file