betty.plugin package

Submodules

Module contents

The Plugin API.

Plugins allow third-party code (e.g. your own Python package) to add functionality to Betty.

class betty.plugin.PluginDefinition

Bases: object

A plugin definition.

__init__(plugin_id: ResolvableMachineName, *, auto: bool = False, requires: Requires = ())
property auto: bool

Whether to enable this plugin automatically when its plugin type is used for a plugi. service.

property id: MachineName

The plugin ID.

IDs are unique per plugin type:

  • A plugin repository MUST at most have a single plugin for any ID.

  • Different plugin repositories MAY each have a plugin with the same ID.

property requires: Iterable[Requirement]

The plugin’s requirements.

classmethod type() PluginTypeDefinition[Self]

The plugin type definition.

final class betty.plugin.PluginTypeDefinition

Bases: CountableHumanFacingDefinition, ClsDefinition, Generic

A plugin type definition.

__init__(plugin_type_id: ResolvableMachineName, *, label: ResolvableLocalizable, label_plural: ResolvableLocalizable, label_countable: CountableLocalizable, description: ResolvableLocalizable | None = None)
property id: MachineName

The plugin type ID.