Skip to content

storageinterface

storageinterface

Classes

StorageInterface

Bases: ABC

Interface for cloud storage access

Functions
download_as_str abstractmethod
download_as_str(bucket_path)

Dowloads the file and returns it as byte string

Source code in niceml/data/storages/storageinterface.py
@abstractmethod
def download_as_str(self, bucket_path: str) -> bytes:
    """Dowloads the file and returns it as byte string"""
download_data abstractmethod
download_data(bucket_path, local_path)

Downloads the file from the bucket and stores it locally

Source code in niceml/data/storages/storageinterface.py
@abstractmethod
def download_data(self, bucket_path: str, local_path: str):
    """Downloads the file from the bucket and stores it locally"""
join_paths abstractmethod
join_paths(*paths)

Joins the paths with the correct separator

Source code in niceml/data/storages/storageinterface.py
@abstractmethod
def join_paths(self, *paths) -> str:
    """Joins the paths with the correct separator"""
list_data abstractmethod
list_data(path=None)

Lists all files recursively from the given directory Returns absolute paths

Source code in niceml/data/storages/storageinterface.py
@abstractmethod
def list_data(self, path: Optional[str] = None) -> List[str]:
    """Lists all files recursively from the given directory
    Returns absolute paths"""
list_experiments abstractmethod
list_experiments(path=None)

Lists all experiment infos of the given path

Source code in niceml/data/storages/storageinterface.py
@abstractmethod
def list_experiments(self, path: Optional[str] = None) -> List[ExperimentInfo]:
    """Lists all experiment infos of the given path"""