betty.gramps.loader module¶
Provide an API to load Gramps family trees into Betty ancestries.
- final class betty.gramps.loader.GrampsEntityReference¶
Bases:
objectA reference to an entity in a Gramps family tree.
- __init__(entity_type: GrampsEntityType, entity_id: str) None¶
- entity_type: GrampsEntityType¶
- class betty.gramps.loader.GrampsEntityType¶
Bases:
EnumThe supported Gramps entity types.
- CITATION = 'citation'¶
- EVENT = 'event'¶
- OBJECT = 'object'¶
- PERSON = 'person'¶
- SOURCE = 'source'¶
- exception betty.gramps.loader.GrampsFileNotFound¶
Bases:
UserFacingGrampsError,FileNotFoundRaised when a Gramps family tree file cannot be found.
- class betty.gramps.loader.GrampsLoader¶
Bases:
objectLoad Gramps family history data into a project.
- __init__(ancestry: EntityPool, *, user: User, services: ServiceLevel, attribute_prefix_key: str | None = None, event_type_mapping: Mapping[str, ResolvablePluginManufacturer[EventTypeDefinition, EventType]] | None = None, place_type_mapping: Mapping[str, ResolvablePluginManufacturer[PlaceTypeDefinition, PlaceType]] | None = None, role_mapping: Mapping[str, ResolvablePluginManufacturer[RoleDefinition, Role]] | None = None, executable: StrPath | None = None)¶
- async load_file(file: StrPath, /) None¶
Load family history data from any of the supported Gramps file types.
- Raises:
- async load_gramps(gramps: StrPath, /) None¶
Load family history data from a Gramps
*.grampsfile.- Raises:
- async load_name(name: str) None¶
Load family history data directly from Gramps using a family tree name.
- Raises:
- exception betty.gramps.loader.LoaderUsedAlready¶
Bases:
GrampsErrorRaised when a
betty.gramps.loader.GrampsLoaderis used more than once.
- exception betty.gramps.loader.XPathError¶
Bases:
GrampsErrorAn error occurred when evaluating an XPath selector on Gramps XML.