swh.storage package

Module contents

swh.storage.get_storage(cls: str, **kwargs) → StorageInterface[source]

Get a storage object of class storage_class with arguments storage_args.

Parameters
  • storage (dict) – dictionary with keys:

  • cls (-) – storage’s class, either local, remote, memory, filter, buffer

  • args (-) – dictionary with keys

Returns

an instance of swh.storage.Storage or compatible class

Raises

ValueError if passed an unknown storage class.

swh.storage.get_storage_pipeline(steps: List[Dict[str, Any]], check_config=None) → StorageInterface[source]

Recursively get a storage object that may use other storage objects as backends.

Parameters

steps (List[dict]) – List of dicts that may be used as kwargs for get_storage.

Returns

an instance of swh.storage.Storage or compatible class

Raises

ValueError if passed an unknown storage class.