The Woob class

class Woob(workdir=None, datadir=None, backends_filename=None, scheduler=None, storage=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 (default: None)

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

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

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

build_modules_loader()[source]

Build the module loader for the current application.

Return type:

ModulesLoader

update(progress=PrintProgress())[source]

Update modules from repositories.

Parameters:

progress (IProgress) – object notified when there is a progress (default: PrintProgress())

build_backend(module_name, params=None, storage=None, name=None, nofail=False, logger=None)[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 (default: None)

  • storage (woob.tools.storage.IStorage) – storage to use (default: None)

  • name (str) – name of backend (default: None)

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

Return type:

woob.tools.backend.Module

load_backends(caps=None, names=None, modules=None, exclude=None, storage=None, errors=None)[source]

Load backends listed in config file.

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

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

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

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

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

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

Returns:

loaded backends

Return type:

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

load_or_install_module(module_name)[source]

Load a backend, and install it if not done before

Return type:

Module