Module for the compound storage

CompoundStorage Objects#

class CompoundStorage(BaseStorage)

A meta storage composed of other storages as a dict.


compound = CompoundStorage(storages={

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


def __getitem__(storage_name: str) -> BaseStorage

Return the storage with that storage_name


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

Set storage to that storage_name


def __len__() -> int

Returns the number of storages


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

Returns an iterable of sotrage_name, storage tuples