betty.project.extension.gramps.config module - Betty documentation

Hide navigation sidebar
Hide table of contents sidebar
Skip to content
Back to top
View this page
Toggle table of contents sidebar

# betty.project.extension.gramps.config module

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

class betty.project.extension.gramps.config.FamilyTreeConfiguration

  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)
  dump() → DumpMapping[Dump]

    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

    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

  Bases: `ConfigurationSequence`[`FamilyTreeConfiguration`]

  Configure zero or more Gramps family trees.

class betty.project.extension.gramps.config.GrampsConfiguration

  Bases: `Configuration`

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

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

    Produce a serialized data dump of `self`.

  property family_trees: FamilyTreeConfigurationSequence

    The Gramps family trees to load.

  load(dump: Dump) → None

    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

  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])
  dump() → Dump

    Produce a serialized data dump of `self`.

  load(dump: Dump) → None

    Load a serialized data dump into `self`.

    Raises:

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