- class matlantis_group_drive_client.drive.GroupDriveFileSystem(*args, **kwargs)#
-
Bases:
AbstractFileSystem
- DEFAULT_CHUNK_SIZE = 5242880#
- DELIMITER = ‘/’#
- FILTERED_KEYS = (‘created’, ‘drive_name’, ‘last_modified’, ‘name’, ‘type’, ‘size’)#
- cat_file(path: str, start: Optional[int] = None, end: Optional[int] = None, **kwargs: Kwargs) bytes #
-
Get the content of a file
- Parameters:
-
-
path (URL of file on this filesystems) –
-
start (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 -
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()
.) –
-
- download(drive_path: str, local_path: str) None #
-
Alias of AbstractFileSystem.get.
- drive_list() List[Dict[str, str]] #
- ls(path: str, detail: bool = True, **kwargs: Kwargs) List[Dict[str, str]] #
-
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
beNone
. -
type of entry, “file”, “directory” or other
Additional information
may be present, aproriate 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 ofinfo(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.
-
-
- mkdir(path: str, create_parents: bool = True, **kwargs: Kwargs) None #
-
Create directory entry at path
For systems that don’t have true directories, may create an for
this instance only and not touch the real filesystem- Parameters:
-
-
path (str) – location
-
create_parents (bool) – if True, this is equivalent to
makedirs
-
kwargs – may be permissions, etc.
-
- pipe_file(path: str, value: bytes, **_: Kwargs) None #
-
Set the bytes of given file
- upload(local_path: str, drive_path: str, chunk_size: int = 5242880) None #
-
Alias of AbstractFileSystem.put.
Resource Library
Drive