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, MachineName] | None = None, place_types: Mapping[str, MachineName] | None = None, presence_roles: Mapping[str, MachineName] | None = None, genders: Mapping[str, MachineName] | None = None)[source]¶
- dump() MutableMapping[str, bool | int | float | str | None | MutableSequence[bool | int | float | str | None | MutableSequence[Dump] | MutableMapping[str, Dump]] | MutableMapping[str, bool | int | float | str | None | MutableSequence[Dump] | MutableMapping[str, Dump]]] [source]¶
Produce a serialized data dump of
self
.
- property event_types: PluginMapping¶
How to map event types.
- property genders: PluginMapping¶
How to map genders.
- load(dump: bool | int | float | str | None | MutableSequence[Dump] | MutableMapping[str, 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.
- load_item(dump: bool | int | float | str | None | MutableSequence[Dump] | MutableMapping[str, Dump]) FamilyTreeConfiguration [source]¶
Create and load a new item from the given dump, or raise an assertion error.
- Raises:
betty.assertion.error.AssertionFailed – Raised when the dump is invalid and cannot be loaded.
- 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() MutableMapping[str, bool | int | float | str | None | MutableSequence[bool | int | float | str | None | MutableSequence[Dump] | MutableMapping[str, Dump]] | MutableMapping[str, bool | int | float | str | None | MutableSequence[Dump] | MutableMapping[str, Dump]]] | type[Void] [source]¶
Produce a serialized data dump of
self
.
- property family_trees: FamilyTreeConfigurationSequence¶
The Gramps family trees to load.
- load(dump: bool | int | float | str | None | MutableSequence[Dump] | MutableMapping[str, 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 IDs.
This is internal. It MAY be used anywhere in Betty’s source code, but MUST NOT be used by third-party code.
- dump() bool | int | float | str | None | MutableSequence[bool | int | float | str | None | MutableSequence[Dump] | MutableMapping[str, Dump]] | MutableMapping[str, bool | int | float | str | None | MutableSequence[Dump] | MutableMapping[str, Dump]] | type[Void] [source]¶
Produce a serialized data dump of
self
.
- load(dump: bool | int | float | str | None | MutableSequence[Dump] | MutableMapping[str, Dump]) None [source]¶
Load a serialized data dump into
self
.- Raises:
betty.assertion.error.AssertionFailed – Raised if the dump is invalid.
- async to_plugins(plugins: PluginRepository[_PluginT]) Mapping[str, type[_PluginT]] [source]¶
Hydrate the mapping into plugins.