API Reference
Proxy
Holds configured fsspec instances |
|
|
|
|
|
|
|
|
|
|
Client
- 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.