betty.extension.gramps.config module

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

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

Bases: Configuration

Configure a single Gramps family tree.

__init__(file_path: Path, *, event_types: Iterable[FamilyTreeEventTypeConfiguration] | None = None)[source]
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]

Dump this instance to a portable format.

property event_types: FamilyTreeEventTypeConfigurationMapping

How to map event types.

property file_path: Path | None

The path to the Gramps family tree file.

load(dump: bool | int | float | str | None | MutableSequence[Dump] | MutableMapping[str, Dump]) None[source]

Load dumped configuration.

Raises:

betty.assertion.error.AssertionFailed – Raised if the dump contains invalid configuration.

update(other: Self) None[source]

Update this configuration with the values from other.

class betty.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.extension.gramps.config.FamilyTreeEventTypeConfiguration[source]

Bases: Configuration

Configure for loading Gramps events.

__init__(gramps_event_type: str, event_type_id: str)[source]
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]

Dump this instance to a portable format.

property event_type_id: str

The ID of the Betty event type to load Gramps events of type betty.extension.gramps.config.FamilyTreeEventTypeConfiguration.gramps_event_type as.

property gramps_event_type: str

The Gramps event type this configuration applies to.

load(dump: bool | int | float | str | None | MutableSequence[Dump] | MutableMapping[str, Dump]) None[source]

Load dumped configuration.

Raises:

betty.assertion.error.AssertionFailed – Raised if the dump contains invalid configuration.

update(other: Self) None[source]

Update this configuration with the values from other.

class betty.extension.gramps.config.FamilyTreeEventTypeConfigurationMapping[source]

Bases: ConfigurationMapping[str, FamilyTreeEventTypeConfiguration]

Configure how to map Gramps events to Betty events.

__init__(configurations: Iterable[FamilyTreeEventTypeConfiguration] | None = None)[source]
load_item(dump: bool | int | float | str | None | MutableSequence[Dump] | MutableMapping[str, Dump]) FamilyTreeEventTypeConfiguration[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.extension.gramps.config.GrampsConfiguration[source]

Bases: Configuration

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

__init__(*, family_trees: Iterable[FamilyTreeConfiguration] | None = None)[source]
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]

Dump this instance to a portable format.

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 dumped configuration.

Raises:

betty.assertion.error.AssertionFailed – Raised if the dump contains invalid configuration.

update(other: Self) None[source]

Update this configuration with the values from other.