mantik.remote_file_service.abstract_file_service¶
Attributes¶
Classes¶
Abstract class to define methods used for (remote) file handling. |
|
Module Contents¶
- class mantik.remote_file_service.abstract_file_service.AbstractFileService(local_base_path: str = '.')[source]¶
Bases:
abc.ABC
Abstract class to define methods used for (remote) file handling.
This interface must be easily implementable with common file transfer methods (FTP, boto/S3, GNU filesystem, pathlib + python IO …).
- abstract change_permissions(target: FilePath, new_permissions: FileMeta) None [source]¶
Change metadata (permissions) of a file.
Note: bash chmod
- abstract copy_directory(source: FilePath, target: FilePath) Directory [source]¶
Copy directory.
Note: bash cp
- abstract create_directory(target: FilePath) Directory [source]¶
Make a new directory.
Note: bash mkdir
- abstract create_file_if_not_exists(target: FilePath) File [source]¶
Create (empty) file if not exists.
Note: bash touch
- classmethod from_env(connection_id: uuid.UUID | None = None) AbstractFileService [source]¶
- Abstractmethod:
Instantiate with environment variables.
Credentials are either fetched from mantik api or passed in through end vars.
- classmethod is_remote(target: FilePath) bool [source]¶
- Abstractmethod:
Return if a path is remote or not
- abstract list_directory(target: FilePath) List[Directory | File] [source]¶
List content of directory.
Note: bash ls
- mantik.remote_file_service.abstract_file_service.LOCAL_FS_BASE_PATH_ENV_VAR = 'MANTIK_LOCAL_FS_BASE_PATH'[source]¶