The Woob class

class Woob(workdir: Optional[str] = None, datadir: Optional[str] = None, backends_filename: Optional[str] = None, scheduler: Optional[IScheduler] = None, storage: Optional[IStorage] = None)[source]

Bases: WoobBase

The main class of Woob, used to manage backends, modules repositories and call methods on all loaded backends.

Parameters
  • workdir (str) – optional parameter to set path of the working directory

  • datadir (str) – optional parameter to set path of the data directory

  • backends_filename (str) – name of the backends file, where configuration of backends is stored

  • storage (woob.tools.storage.IStorage) – provide a storage where backends can save data

build_modules_loader() RepositoryModulesLoader[source]

Build the module loader for the current application.

Return type

ModulesLoader

update(progress: ~woob.core.repositories.IProgress = <PrintProgress>)[source]

Update modules from repositories.

Parameters

progress (IProgress) – object notified when there is a progress

build_backend(module_name: str, params: Optional[Dict[str, str]] = None, storage: Optional[IStorage] = None, name: Optional[str] = None, nofail: Optional[bool] = False) Module[source]

Create a single backend which is not listed in configuration.

Parameters
  • module_name (str) – name of module

  • params (dict) – parameters to give to backend

  • storage (woob.tools.storage.IStorage) – storage to use

  • name (str) – name of backend

  • nofail (bool) – if true, this call can’t fail

Return type

woob.tools.backend.Module

load_backends(caps: Optional[List[Union[Capability, str]]] = None, names: Optional[List[str]] = None, modules: Optional[List[str]] = None, exclude: Optional[List[str]] = None, storage: Optional[IStorage] = None, errors: Optional[List[LoadError]] = None) Dict[str, Module][source]

Load backends listed in config file.

Parameters
  • caps (tuple[woob.capabilities.base.Capability]) – load backends which implement all of specified caps

  • names (tuple[str]) – load backends in list

  • modules (tuple[str]) – load backends which module is in list

  • exclude (tuple[str]) – do not load backends in list

  • storage (woob.tools.storage.IStorage) – use this storage if specified

  • errors (list[LoadError]) – if specified, store every errors in this list

Returns

loaded backends

Return type

dict[str, woob.tools.backend.Module]

load_or_install_module(module_name: str) Module[source]

Load a backend, and install it if not done before