soil.storage.compound_storage

Module for the compound storage

CompoundStorage Objects#

@dataclass
class CompoundStorage(BaseStorage)

A meta storage composed of other storages as a dict.

Example:

compound = CompoundStorage(storages={

  • "db" - Elasticsearch(index="index1"),
  • "disk" - ObjectStorage() }) compound["second_db"] = ElasticSearch(index="index2") compound["db"].search(query=myquery)

__getitem__#

def __getitem__(storage_name: str) -> BaseStorage

Return the storage with that storage_name

__setitem__#

def __setitem__(storage_name: str, storage: BaseStorage) -> None

Set storage to that storage_name

__len__#

def __len__() -> int

Returns the number of storages

items#

def items() -> List[Tuple[str, BaseStorage]]

Returns an iterable of sotrage_name, storage tuples