betty.loaders.gramps package¶
Submodules¶
Module contents¶
Integrate Betty with Gramps.
- final class betty.loaders.gramps.FamilyTree¶
-
A Gramps family tree.
- betty.loaders.gramps:FamilyTree
- __init__(file: StrPath | None = None, name: str | None = None, event_types: Mapping[str, ResolvablePluginManufacturer[EventTypeDefinition, EventType]] | None = None, place_types: Mapping[str, ResolvablePluginManufacturer[PlaceTypeDefinition, PlaceType]] | None = None, roles: Mapping[str, ResolvablePluginManufacturer[RoleDefinition, Role]] | None = None)¶
- event_types¶
How to map event types.
- file¶
The path to a Gramps family tree file.
- name¶
The family tree’s name in Gramps.
- place_types¶
How to map place types.
- roles¶
How to map presence roles.
- final class betty.loaders.gramps.Gramps¶
Bases:
DataManufacturable[GrampsData],Manufacturable,LoaderThe
grampsloaderplugin. Load Gramps family trees.Plugin ID
grampsClass
Configuration
Attributes¶
Gramps allows arbitrary attributes to be added to some of its data types. Betty can parse these to load additional information. Each of Betty’s Gramps attributes follows the same structure:
betty:...(to load the attribute for any Betty project) orbetty-MyProject:..(to load an attribute for the Betty project with machine nameMyProject), where...is the name that identifies the attribute’s meaning. For the ‘privacy` attribute, the Gramps attribute’s full name would bebetty:privacyorbetty-MyProject:privacy.Privacy¶
Gramps has limited built-in support for people’s privacy. To fully control privacy for people, as well as events, files, sources, and citations, add a
betty:privacyattribute to any of these types, with a value ofprivateto explicitly declare the data always private orpublicto declare the data always public. Any other value will leave the privacy undecided, as well as person records marked public using Gramps’ built-in privacy selector. In such cases, theprivatizerextension may decide if the data is public or private.Gender¶
To set a person’s gender to a gender that is available in Betty, but not in Gramps, add a
betty:genderattribute, whose value is the ID of thegender pluginyou want to use.Event names¶
Event names can be set using
betty:name. Values are static translations.Links¶
Gramps has limited built-in support to add links to entities. For those Gramps entities that support attributes, you may add links using those:
Link attributes¶ Name
Required/optional
Description
betty:link-LINKNAME:urlrequired
The URL the link targets. This may contain static translations.
betty:link-LINKNAME:descriptionoptional
A human-friendly longer link description. This may contain static translations.
betty:link-LINKNAME:labeloptional
A human-friendly short link label. This may contain static translations.
betty:link-LINKNAME:media_typeoptional
An IANA media type.
betty:link-LINKNAME:relationshipoptional
Where
LINKNAMEmay be any value of your choosing, but must be unique per link. For example, whereLINKNAMEischeese:betty:link-cheese:urlhttps://en.wikipedia.org/wiki/Cheesebetty:link-cheese:labelLearn about cheesebetty:link-cheese:descriptionRead the Wikipedia article about cheeseStatic translations¶
Static translations are not attributes on their own per se, but they are used by other attributes, such as links.
If another attribute defines itself as containing static translations, that means you may add multiple variants of the attribute, each with a translation for a different locale.
For example, given a translatable attribute called
betty:my-text, you may add an actual attributebetty:my-textwith any translation for a locale which Betty will consider undetermined. You may also add any number ofbetty:my-text:LOCALEattributes, whereLOCALEis an IETF BCP 47 language tag, and the value is the translation for that specific locale/language.Dates¶
For unknown date parts, set those to all zeroes and Betty will ignore them. For instance,
0000-12-31will be parsed as “December 31”, and1970-01-00as “January, 1970”.Event types¶
Betty supports the following Gramps event types without any additional configuration:
Event types¶ Gramps event type
Betty event type
AdoptedadoptionAdult ChristeningbaptismBaptismbaptismBar Mitzvahbar-mitzvahBat Mitzvahbat-mitzvahBirthbirthBurialburialChristeningbaptismConfirmationconfirmationCremationcremationDeathdeathDivorcedivorceDivorce Filingdivorce-announcementEmigrationemigrationEngagementengagementImmigrationimmigrationMarriagemarriageMarriage Bannsmarriage-announcementOccupationoccupationResidenceresidenceRetirementretirementWillwillGenders¶
Betty maps Gramps genders as follows:
Genders¶ Gramps gender
Betty gender
FwomanMmanUunknownXnon-binaryPlace types¶
Betty supports the following Gramps place types without any additional configuration:
Place types¶ Gramps place type
Betty place type
BoroughboroughBuildingbuildingCitycityCountrycountryCountycountyDepartmentdepartmentDistrictdistrictFarmfarmHamlethamletLocalitylocalityMunicipalitymunicipalityNeighborhoodneighborhoodNumbernumberParishparishProvinceprovinceRegionregionStatestateStreetstreetTowntownUnknownUnknownVillagevillageRoles¶
Betty supports the following Gramps roles without any additional configuration:
Roles¶ Gramps role
Betty role
AideattendeeBridesubjectCelebrantcelebrantClergycelebrantFamilysubjectGroomsubjectInformantinformantPrimarysubjectUnknownunknownWitnesswitnessOrder & priority¶
The order of lists of data, or the priority of individual bits of data, can be automatically determined by Betty in multiple different ways, such as by matching dates, or locales. When not enough details are available, or in case of ambiguity, the original order is preserved. If only a single item must be retrieved from the list, this will be the first item, optionally after sorting.
For example, if a place has multiple names (which may be historical or translations), Betty may try to filter names by the given locale and date, and then indiscriminately pick the first one of the remaining names to display as the canonical name.
Tips:
If you want one item to have priority over another, it should come before the other in a list (e.g. be higher up).
Items with more specific or complete data, such as locales or dates, should come before items with less specific or complete data. However, items without dates at all are considered current and not historical.
Unofficial names or nicknames, should generally be put at the end of lists.
- __init__(*, ancestry: EntityPool, services: ServiceLevel, user: User, attribute_prefix_key: str | None = None, executable: StrPath | None = None, family_trees: Iterable[FamilyTree] = ())¶
- new = <betty.requirement._RequirableDecorator object>¶
- classmethod new_data_cls() type[GrampsData]¶
The object’s defined data class.
- final class betty.loaders.gramps.GrampsData¶
-
Configuration for the
betty.loaders.gramps.Grampsextension.- betty.loaders.gramps:GrampsData
- __init__(*, family_trees: Iterable[FamilyTree] = (), executable: StrPath | None = None)¶
- executable¶
The path to a specific Gramps executable.
Leave
Noneto use Gramps from the PATH.
- family_trees¶
The Gramps family trees to load.