betty.ancestry package¶
Submodules¶
- betty.ancestry.event_type module
Adoption
Baptism
Birth
Burial
Conference
Confirmation
Correspondence
CreatableDerivableEventType
Cremation
Death
DerivableEventType
Divorce
DivorceAnnouncement
DuringLifeEventType
EVENT_TYPE_REPOSITORY
Emigration
EndOfLifeEventType
Engagement
EventType
FinalDispositionEventType
Funeral
Immigration
Marriage
MarriageAnnouncement
Missing
Occupation
PostDeathEventType
PreBirthEventType
Residence
Retirement
StartOfLifeEventType
UnknownEventType
Will
- betty.ancestry.presence_role module
Module contents¶
Provide Betty’s main data model.
- final class betty.ancestry.Ancestry[source]¶
Bases:
MultipleTypesEntityCollection
[Entity
]An ancestry contains all the entities of a single family tree/genealogical data set.
- add_unchecked_graph(*entities: Entity) None [source]¶
Add entities to the ancestry but do not automatically add associates as well.
It is the caller’s responsibility to ensure all associates are added to the ancestry. If this is done, calling this method is faster than the usual entity collection methods.
- final class betty.ancestry.Citation[source]¶
Bases:
HasDate
,HasFileReferences
,HasPrivacy
,HasLinks
,UserFacingEntity
A citation (a reference to a source).
- __init__(*, id: str | None = None, facts: Iterable[HasCitations & Entity] | None = None, source: Source | None = None, location: ShorthandStaticTranslations | None = None, date: Datey | None = None, file_references: Iterable[FileReference] | None = None, privacy: Privacy | None = None, public: bool | None = None, private: bool | None = None)[source]¶
- facts¶
A bidirectional many-to-many entity type association.
- property label: Localizable¶
The entity’s human-readable label.
- async classmethod linked_data_schema(project: Project) Object [source]¶
Define the JSON Schema for
betty.json.linked_data.LinkedDataDumpable.dump_linked_data()
.
- location¶
The human-readable citation location.
- classmethod plugin_id() str [source]¶
Get the plugin ID.
IDs are unique per plugin type:
A plugin repository MUST at most have a single plugin for any ID.
Different plugin repositories MAY each have a plugin with the same ID.
- classmethod plugin_label() Localizable [source]¶
Get the human-readable short plugin label.
- classmethod plugin_label_plural() Localizable [source]¶
The human-readable entity type label, plural.
- source¶
A bidirectional many-to-one entity type association.
- final class betty.ancestry.Enclosure[source]¶
Bases:
HasDate
,HasCitations
,Entity
The enclosure of one place by another.
Enclosures describe the outer (
`enclosed_by`) and inner(``encloses
) places, and their relationship.- enclosed_by¶
The outer place.
- encloses¶
The inner place.
- classmethod plugin_id() str [source]¶
Get the plugin ID.
IDs are unique per plugin type:
A plugin repository MUST at most have a single plugin for any ID.
Different plugin repositories MAY each have a plugin with the same ID.
- classmethod plugin_label() Localizable [source]¶
Get the human-readable short plugin label.
- classmethod plugin_label_plural() Localizable [source]¶
The human-readable entity type label, plural.
- final class betty.ancestry.Event[source]¶
Bases:
HasDate
,HasFileReferences
,HasCitations
,HasNotes
,HasDescription
,HasPrivacy
,HasLinks
,UserFacingEntity
An event that took place.
- __init__(*, id: str | None = None, event_type: EventType | None = None, date: Date | DateRange | None = None, file_references: Iterable[FileReference] | None = None, citations: Iterable[Citation] | None = None, notes: Iterable[Note] | None = None, privacy: Privacy | None = None, public: bool | None = None, private: bool | None = None, place: Place | None = None, description: Mapping[str, str] | str | None = None)[source]¶
- dated_linked_data_contexts() tuple[str | None, str | None, str | None] [source]¶
Get the JSON-LD context term definition IRIs for the possible dates.
- Returns:
A 3-tuple with the IRI for a single date, a start date, and an end date, respectively.
- property label: Localizable¶
The entity’s human-readable label.
- async classmethod linked_data_schema(project: Project) Object [source]¶
Define the JSON Schema for
betty.json.linked_data.LinkedDataDumpable.dump_linked_data()
.
- place¶
The place the event happened.
- classmethod plugin_id() str [source]¶
Get the plugin ID.
IDs are unique per plugin type:
A plugin repository MUST at most have a single plugin for any ID.
Different plugin repositories MAY each have a plugin with the same ID.
- classmethod plugin_label() Localizable [source]¶
Get the human-readable short plugin label.
- classmethod plugin_label_plural() Localizable [source]¶
The human-readable entity type label, plural.
- presences¶
A bidirectional one-to-many entity type association.
- final class betty.ancestry.File[source]¶
Bases:
HasDescription
,HasPrivacy
,HasLinks
,HasMediaType
,HasNotes
,HasCitations
,UserFacingEntity
,Entity
A file on disk.
This includes but is not limited to:
images
video
audio
PDF documents
- __init__(path: Path, *, id: str | None = None, name: str | None = None, media_type: MediaType | None = None, description: ShorthandStaticTranslations | None = None, notes: Iterable[Note] | None = None, citations: Iterable[Citation] | None = None, privacy: Privacy | None = None, public: bool | None = None, private: bool | None = None, links: MutableSequence[Link] | None = None)[source]¶
- property label: Localizable¶
The entity’s human-readable label.
- async classmethod linked_data_schema(project: Project) Object [source]¶
Define the JSON Schema for
betty.json.linked_data.LinkedDataDumpable.dump_linked_data()
.
- property path: Path¶
The file’s path on disk.
- classmethod plugin_id() str [source]¶
Get the plugin ID.
IDs are unique per plugin type:
A plugin repository MUST at most have a single plugin for any ID.
Different plugin repositories MAY each have a plugin with the same ID.
- classmethod plugin_label() Localizable [source]¶
Get the human-readable short plugin label.
- classmethod plugin_label_plural() Localizable [source]¶
The human-readable entity type label, plural.
- referees¶
A bidirectional one-to-many entity type association.
- class betty.ancestry.FileReference[source]¶
Bases:
Entity
A reference between
betty.ancestry.HasFileReferences
and betty.ancestry.File.This reference holds additional information specific to the relationship between the two entities.
- __init__(referee: HasFileReferences & Entity | None = None, file: File | None = None, focus: FocusArea | None = None)[source]¶
- file¶
The referenced file.
- property focus: FocusArea | None¶
The area within the 2-dimensional representation of the file to focus on.
This can be used to locate where faces are in a photo, or a specific article in a newspaper scan, for example.
- classmethod plugin_id() MachineName [source]¶
Get the plugin ID.
IDs are unique per plugin type:
A plugin repository MUST at most have a single plugin for any ID.
Different plugin repositories MAY each have a plugin with the same ID.
- classmethod plugin_label() Localizable [source]¶
Get the human-readable short plugin label.
- classmethod plugin_label_plural() Localizable [source]¶
The human-readable entity type label, plural.
- referee¶
The entity that references the file.
- class betty.ancestry.HasCitations[source]¶
Bases:
Entity
An entity with citations that support it.
- citations¶
A bidirectional many-to-many entity type association.
- async classmethod linked_data_schema(project: Project) Object [source]¶
Define the JSON Schema for
betty.json.linked_data.LinkedDataDumpable.dump_linked_data()
.
- class betty.ancestry.HasDate[source]¶
Bases:
LinkedDataDumpable
[Object
]A resource with date information.
- dated_linked_data_contexts() tuple[str | None, str | None, str | None] [source]¶
Get the JSON-LD context term definition IRIs for the possible dates.
- Returns:
A 3-tuple with the IRI for a single date, a start date, and an end date, respectively.
- async classmethod linked_data_schema(project: Project) Object [source]¶
Define the JSON Schema for
betty.json.linked_data.LinkedDataDumpable.dump_linked_data()
.
- class betty.ancestry.HasDescription[source]¶
Bases:
LinkedDataDumpable
[Object
]A resource with a description.
- description¶
The human-readable description.
- async classmethod linked_data_schema(project: Project) Object [source]¶
Define the JSON Schema for
betty.json.linked_data.LinkedDataDumpable.dump_linked_data()
.
- class betty.ancestry.HasFileReferences[source]¶
Bases:
Entity
An entity that has associated
betty.ancestry.File
entities.- __init__(*args: Any, file_references: Iterable[FileReference] | None = None, **kwargs: Any)[source]¶
- file_references¶
A bidirectional one-to-many entity type association.
- class betty.ancestry.HasLinks[source]¶
Bases:
Entity
A resource that has external links.
- async classmethod linked_data_schema(project: Project) Object [source]¶
Define the JSON Schema for
betty.json.linked_data.LinkedDataDumpable.dump_linked_data()
.
- class betty.ancestry.HasLocale[source]¶
Bases:
Localized
,LinkedDataDumpable
[Object
]A resource that is localized, e.g. contains information in a specific locale.
- async classmethod linked_data_schema(project: Project) Object [source]¶
Define the JSON Schema for
betty.json.linked_data.LinkedDataDumpable.dump_linked_data()
.
- class betty.ancestry.HasMediaType[source]¶
Bases:
LinkedDataDumpable
[Object
]A resource with an IANA media type.
- async classmethod linked_data_schema(project: Project) Object [source]¶
Define the JSON Schema for
betty.json.linked_data.LinkedDataDumpable.dump_linked_data()
.
- class betty.ancestry.HasNotes[source]¶
Bases:
Entity
An entity that has notes associated with it.
- async classmethod linked_data_schema(project: Project) Object [source]¶
Define the JSON Schema for
betty.json.linked_data.LinkedDataDumpable.dump_linked_data()
.
- notes¶
A bidirectional one-to-many entity type association.
- class betty.ancestry.HasPrivacy[source]¶
Bases:
LinkedDataDumpable
[Object
]A resource that has privacy.
- __init__(*args: Any, privacy: Privacy | None = None, public: bool | None = None, private: bool | None = None, **kwargs: Any)[source]¶
- async classmethod linked_data_schema(project: Project) Object [source]¶
Define the JSON Schema for
betty.json.linked_data.LinkedDataDumpable.dump_linked_data()
.
- property own_privacy: Privacy¶
The resource’s own privacy.
This returns the value that was set for
betty.ancestry.HasPrivacy.privacy
and ignores computed privacies.For access control and permissions checking, use
betty.ancestry.HasPrivacy.privacy
.
- final class betty.ancestry.Link[source]¶
Bases:
HasMediaType
,HasLocale
,HasDescription
,LinkedDataDumpable
[Object
]An external link.
- __init__(url: str, *, relationship: str | None = None, label: Mapping[str, str] | str | None = None, description: Mapping[str, str] | str | None = None, media_type: MediaType | None = None, locale: str = 'und')[source]¶
- label¶
The link’s human-readable label.
- async classmethod linked_data_schema(project: Project) LinkSchema [source]¶
Define the JSON Schema for
betty.json.linked_data.LinkedDataDumpable.dump_linked_data()
.
- relationship: str | None¶
The link’s IANA link relationship.
- class betty.ancestry.LinkCollectionSchema[source]¶
Bases:
Array
A JSON Schema for
betty.ancestry.Link
collections.
- class betty.ancestry.LinkSchema[source]¶
Bases:
JsonLdObject
A JSON Schema for
betty.ancestry.Link
.
- final class betty.ancestry.Name[source]¶
Bases:
StaticTranslationsLocalizable
,HasDate
A name.
A name can be translated, and have a date expressing the period the name was in use.
- final class betty.ancestry.Note[source]¶
Bases:
UserFacingEntity
,HasPrivacy
,HasLinks
,Entity
A note is a bit of textual information that can be associated with another entity.
- __init__(text: ShorthandStaticTranslations, *, id: str | None = None, entity: HasNotes & Entity | None = None, privacy: Privacy | None = None, public: bool | None = None, private: bool | None = None)[source]¶
- entity¶
The entity the note belongs to.
- property label: Localizable¶
The entity’s human-readable label.
- async classmethod linked_data_schema(project: Project) Object [source]¶
Define the JSON Schema for
betty.json.linked_data.LinkedDataDumpable.dump_linked_data()
.
- classmethod plugin_id() str [source]¶
Get the plugin ID.
IDs are unique per plugin type:
A plugin repository MUST at most have a single plugin for any ID.
Different plugin repositories MAY each have a plugin with the same ID.
- classmethod plugin_label() Localizable [source]¶
Get the human-readable short plugin label.
- classmethod plugin_label_plural() Localizable [source]¶
The human-readable entity type label, plural.
- text¶
The human-readable note text.
- final class betty.ancestry.Person[source]¶
Bases:
HasFileReferences
,HasCitations
,HasNotes
,HasLinks
,HasPrivacy
,UserFacingEntity
,Entity
A person.
- __init__(*, id: str | None = None, file_references: Iterable[FileReference] | None = None, citations: Iterable[Citation] | None = None, links: MutableSequence[Link] | None = None, notes: Iterable[Note] | None = None, privacy: Privacy | None = None, public: bool | None = None, private: bool | None = None, parents: Iterable[Person] | None = None, children: Iterable[Person] | None = None, presences: Iterable[Presence] | None = None, names: Iterable[PersonName] | None = None)[source]¶
- children¶
A bidirectional many-to-many entity type association.
- property label: Localizable¶
The entity’s human-readable label.
- async classmethod linked_data_schema(project: Project) Object [source]¶
Define the JSON Schema for
betty.json.linked_data.LinkedDataDumpable.dump_linked_data()
.
- names¶
A bidirectional one-to-many entity type association.
- parents¶
A bidirectional many-to-many entity type association.
- classmethod plugin_id() str [source]¶
Get the plugin ID.
IDs are unique per plugin type:
A plugin repository MUST at most have a single plugin for any ID.
Different plugin repositories MAY each have a plugin with the same ID.
- classmethod plugin_label() Localizable [source]¶
Get the human-readable short plugin label.
- classmethod plugin_label_plural() Localizable [source]¶
The human-readable entity type label, plural.
- presences¶
A bidirectional one-to-many entity type association.
- final class betty.ancestry.PersonName[source]¶
Bases:
HasLocale
,HasCitations
,HasPrivacy
,Entity
A name for a
betty.ancestry.Person
.- __init__(*, id: str | None = None, person: Person | None = None, individual: str | None = None, affiliation: str | None = None, privacy: Privacy | None = None, public: bool | None = None, private: bool | None = None, locale: str = 'und')[source]¶
- property affiliation: str | None¶
The name’s affiliation, or family component.
Also known as:
last name
surname
- property individual: str | None¶
The name’s individual component.
Also known as:
first name
given name
- property label: Localizable¶
The entity’s human-readable label.
- async classmethod linked_data_schema(project: Project) Object [source]¶
Define the JSON Schema for
betty.json.linked_data.LinkedDataDumpable.dump_linked_data()
.
- person¶
The person whose name this is.
- classmethod plugin_id() str [source]¶
Get the plugin ID.
IDs are unique per plugin type:
A plugin repository MUST at most have a single plugin for any ID.
Different plugin repositories MAY each have a plugin with the same ID.
- classmethod plugin_label() Localizable [source]¶
Get the human-readable short plugin label.
- classmethod plugin_label_plural() Localizable [source]¶
The human-readable entity type label, plural.
- final class betty.ancestry.Place[source]¶
Bases:
HasLinks
,HasFileReferences
,HasNotes
,HasPrivacy
,UserFacingEntity
,Entity
A place.
A place is a physical location on earth. It may be identifiable by GPS coordinates only, or be a well-known city, with names in many languages, imagery, and its own Wikipedia page, or any type of place in between.
- __init__(*, id: str | None = None, names: MutableSequence[Name] | None = None, events: Iterable[Event] | None = None, enclosed_by: Iterable[Enclosure] | None = None, encloses: Iterable[Enclosure] | None = None, notes: Iterable[Note] | None = None, coordinates: Point | None = None, links: MutableSequence[Link] | None = None, privacy: Privacy | None = None, public: bool | None = None, private: bool | None = None)[source]¶
- enclosed_by¶
A bidirectional one-to-many entity type association.
- encloses¶
A bidirectional one-to-many entity type association.
- events¶
A bidirectional one-to-many entity type association.
- property label: Localizable¶
The entity’s human-readable label.
- async classmethod linked_data_schema(project: Project) Object [source]¶
Define the JSON Schema for
betty.json.linked_data.LinkedDataDumpable.dump_linked_data()
.
- property names: MutableSequence[Name]¶
The place’s names.
The first name is considered the
place label
.
- classmethod plugin_id() str [source]¶
Get the plugin ID.
IDs are unique per plugin type:
A plugin repository MUST at most have a single plugin for any ID.
Different plugin repositories MAY each have a plugin with the same ID.
- classmethod plugin_label() Localizable [source]¶
Get the human-readable short plugin label.
- classmethod plugin_label_plural() Localizable [source]¶
The human-readable entity type label, plural.
- final class betty.ancestry.Presence[source]¶
Bases:
HasPrivacy
,Entity
The presence of a
betty.ancestry.Person
at anbetty.ancestry.Event
.- event¶
The event the person was present at.
- property label: Localizable¶
The entity’s human-readable label.
- person¶
The person whose presence is described.
- classmethod plugin_id() str [source]¶
Get the plugin ID.
IDs are unique per plugin type:
A plugin repository MUST at most have a single plugin for any ID.
Different plugin repositories MAY each have a plugin with the same ID.
- classmethod plugin_label() Localizable [source]¶
Get the human-readable short plugin label.
- classmethod plugin_label_plural() Localizable [source]¶
The human-readable entity type label, plural.
- role: PresenceRole¶
The role the person performed at the event.
- class betty.ancestry.Privacy[source]¶
Bases:
Enum
The available privacy modes.
- PRIVATE = 2¶
The resource is explicitly made private.
- PUBLIC = 1¶
The resource is explicitly made public.
- UNDETERMINED = 3¶
The resource has no explicit privacy. This means that:
it may be changed at will
when checking access, UNDETERMINED evaluates to PUBLIC.
- final class betty.ancestry.Source[source]¶
Bases:
HasDate
,HasFileReferences
,HasNotes
,HasLinks
,HasPrivacy
,UserFacingEntity
,Entity
A source of information.
- __init__(name: ShorthandStaticTranslations | None = None, *, id: str | None = None, author: ShorthandStaticTranslations | None = None, publisher: ShorthandStaticTranslations | None = None, contained_by: Source | None = None, contains: Iterable[Source] | None = None, notes: Iterable[Note] | None = None, date: Datey | None = None, file_references: Iterable[FileReference] | None = None, links: MutableSequence[Link] | None = None, privacy: Privacy | None = None, public: bool | None = None, private: bool | None = None)[source]¶
- author¶
The human-readable author.
- citations¶
A bidirectional one-to-many entity type association.
- contained_by¶
The source this one is directly contained by.
- contains¶
A bidirectional one-to-many entity type association.
- property label: Localizable¶
The entity’s human-readable label.
- async classmethod linked_data_schema(project: Project) Object [source]¶
Define the JSON Schema for
betty.json.linked_data.LinkedDataDumpable.dump_linked_data()
.
- name¶
The human-readable source name.
- classmethod plugin_id() str [source]¶
Get the plugin ID.
IDs are unique per plugin type:
A plugin repository MUST at most have a single plugin for any ID.
Different plugin repositories MAY each have a plugin with the same ID.
- classmethod plugin_label() Localizable [source]¶
Get the human-readable short plugin label.
- classmethod plugin_label_plural() Localizable [source]¶
The human-readable entity type label, plural.
- publisher¶
The human-readable publisher.