betty.project.extension.gramps.config module

Provide configuration for the betty.project.extension.gramps.Gramps extension.

class betty.project.extension.gramps.config.FamilyTreeConfiguration[source]

Bases: Configuration

Configure a single Gramps family tree.

__init__(file_path: Path, *, event_types: Mapping[str, PluginInstanceConfiguration] | None = None, place_types: Mapping[str, PluginInstanceConfiguration] | None = None, presence_roles: Mapping[str, PluginInstanceConfiguration] | None = None, genders: Mapping[str, PluginInstanceConfiguration] | None = None)[source]
dump() DumpMapping[Dump][source]

Produce a serialized data dump of self.

property event_types: PluginMapping

How to map event types.

property file_path: Path | None

The path to the Gramps family tree file.

property genders: PluginMapping

How to map genders.

load(dump: Dump) None[source]

Load a serialized data dump into self.

Raises:

betty.assertion.error.AssertionFailed – Raised if the dump is invalid.

property place_types: PluginMapping

How to map place types.

property presence_roles: PluginMapping

How to map presence roles.

class betty.project.extension.gramps.config.FamilyTreeConfigurationSequence[source]

Bases: ConfigurationSequence[FamilyTreeConfiguration]

Configure zero or more Gramps family trees.

class betty.project.extension.gramps.config.GrampsConfiguration[source]

Bases: Configuration

Provide configuration for the betty.project.extension.gramps.Gramps extension.

__init__(*, family_trees: Iterable[FamilyTreeConfiguration] | None = None)[source]
dump() DumpMapping[Dump][source]

Produce a serialized data dump of self.

property family_trees: FamilyTreeConfigurationSequence

The Gramps family trees to load.

load(dump: Dump) None[source]

Load a serialized data dump into self.

Raises:

betty.assertion.error.AssertionFailed – Raised if the dump is invalid.

final class betty.project.extension.gramps.config.PluginMapping[source]

Bases: Configuration

Map Gramps types to Betty plugin instances.

This is internal. It MAY be used anywhere in Betty’s source code, but MUST NOT be used by third-party code.

__init__(default_mapping: Mapping[str, PluginInstanceConfiguration], mapping: Mapping[str, PluginInstanceConfiguration])[source]
dump() Dump[source]

Produce a serialized data dump of self.

load(dump: Dump) None[source]

Load a serialized data dump into self.

Raises:

betty.assertion.error.AssertionFailed – Raised if the dump is invalid.