betty.loaders.gramps package

Submodules

Module contents

Integrate Betty with Gramps.

final class betty.loaders.gramps.FamilyTree

Bases: Data, HasProps

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.

property source: Path | str

The family tree’s source.

This is either the name of a family tree in Gramps, or the path to a Gramps family tree file.

final class betty.loaders.gramps.Gramps

Bases: DataManufacturable[GrampsData], Manufacturable, Loader

The gramps loader plugin. Load Gramps family trees.

Plugin ID

gramps

Class

Gramps

Configuration

GrampsData

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) or betty-MyProject:.. (to load an attribute for the Betty project with machine name MyProject), where ... is the name that identifies the attribute’s meaning. For the ‘privacy` attribute, the Gramps attribute’s full name would be betty:privacy or betty-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:privacy attribute to any of these types, with a value of private to explicitly declare the data always private or public to 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, the privatizer extension 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:gender attribute, whose value is the ID of the gender plugin you want to use.

Event names

Event names can be set using betty:name. Values are static translations.

Static 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 attribute betty:my-text with any translation for a locale which Betty will consider undetermined. You may also add any number of betty:my-text:LOCALE attributes, where LOCALE is 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-31 will be parsed as “December 31”, and 1970-01-00 as “January, 1970”.

Event types

Betty supports the following Gramps event types without any additional configuration:

Event types

Gramps event type

Betty event type

Adopted

adoption

Adult Christening

baptism

Baptism

baptism

Bar Mitzvah

bar-mitzvah

Bat Mitzvah

bat-mitzvah

Birth

birth

Burial

burial

Christening

baptism

Confirmation

confirmation

Cremation

cremation

Death

death

Divorce

divorce

Divorce Filing

divorce-announcement

Emigration

emigration

Engagement

engagement

Immigration

immigration

Marriage

marriage

Marriage Banns

marriage-announcement

Occupation

occupation

Residence

residence

Retirement

retirement

Will

will

Genders

Betty maps Gramps genders as follows:

Genders

Gramps gender

Betty gender

F

woman

M

man

U

unknown

X

non-binary

Place types

Betty supports the following Gramps place types without any additional configuration:

Place types

Gramps place type

Betty place type

Borough

borough

Building

building

City

city

Country

country

County

county

Department

department

District

district

Farm

farm

Hamlet

hamlet

Locality

locality

Municipality

municipality

Neighborhood

neighborhood

Number

number

Parish

parish

Province

province

Region

region

State

state

Street

street

Town

town

Unknown

Unknown

Village

village

Roles

Betty supports the following Gramps roles without any additional configuration:

Roles

Gramps role

Betty role

Aide

attendee

Bride

subject

Celebrant

celebrant

Clergy

celebrant

Family

subject

Groom

subject

Informant

informant

Primary

subject

Unknown

unknown

Witness

witness

Order & 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] = ())
async load(scheduler: Scheduler, /) None

Load ancestry data.

new = <betty.requirement._RequirableDecorator object>
classmethod new_data_cls() type[GrampsData]

The object’s defined data class.

final class betty.loaders.gramps.GrampsData

Bases: Data, HasProps

Configuration for the betty.loaders.gramps.Gramps extension.

betty.loaders.gramps:GrampsData
__init__(*, family_trees: Iterable[FamilyTree] = (), executable: StrPath | None = None)
executable

The path to a specific Gramps executable.

Leave None to use Gramps from the PATH.

family_trees

The Gramps family trees to load.