fava.ext

Fava’s extension system.

class fava.ext.FavaExtensionBase(ledger, config=None)

Base class for extensions for Fava.

Any extension should inherit from this class. find_extension() will discover all subclasses of this class in the specified modules.

run_hook(event, *args)

Run a hook.

Parameters

event – One of the possible events.

class fava.ext.FavaExtensionError(source, message, entry)
fava.ext.find_extensions(base_path, name)

Find extensions in a module.

Parameters
  • base_path – The module can be relative to this path.

  • name – The name of the module containing the extensions.

Returns

A tuple (classes, errors) where classes is a list of subclasses of FavaExtensionBase found in name.

fava.ext.auto_commit

Auto-commit hook for Fava.

This mainly serves as an example how Fava’s extension systems, which only really does hooks at the moment, works.

class fava.ext.auto_commit.AutoCommit(ledger, config=None)
after_insert_entry(entry)
after_insert_metadata(*_)
after_write_source(path, _)