betty.gramps.loader module¶
Provide an API to load Gramps family trees into Betty ancestries.
- class betty.gramps.loader.GrampsEntityReference[source]¶
Bases:
object
A 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[source]¶
Bases:
Enum
The supported Gramps entity types.
- CITATION = 'citation'¶
- EVENT = 'event'¶
- OBJECT = 'object'¶
- PERSON = 'person'¶
- SOURCE = 'source'¶
- exception betty.gramps.loader.GrampsFileNotFoundError[source]¶
Bases:
GrampsError
,FileNotFoundError
A Gramps family tree file could not be file.
- exception betty.gramps.loader.GrampsLoadFileError[source]¶
Bases:
GrampsError
,RuntimeError
An error occurred when loading a Gramps family tree file.
- class betty.gramps.loader.GrampsLoader[source]¶
Bases:
object
Load Gramps family history data into a project.
- add_association(*args: Any, **kwargs: Any) None [source]¶
Add an association between two entities to the ancestry.
- async load_file(file_path: Path) None [source]¶
Load family history data from any of the supported Gramps file types.
- async load_gramps(gramps_path: Path) None [source]¶
Load family history data from a Gramps *.gramps file.
- async load_tree(tree: ElementTree, gramps_tree_directory_path: Path) None [source]¶
Load family history data from a Gramps XML tree.
- exception betty.gramps.loader.XPathError[source]¶
Bases:
GrampsError
,RuntimeError
An error occurred when evaluating an XPath selector on Gramps XML.