betty.model.ancestry module¶
Provide Betty’s main data model.
- final class betty.model.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.model.ancestry.Citation[source]¶
Bases:
Dated
,HasFileReferences
,HasPrivacy
,HasLinksEntity
,UserFacingEntity
,Entity
A citation (a reference to a source).
- __init__(*, id: str | None = None, facts: Iterable[HasCitations] | None = None, source: Source | None = None, location: Localizable | None = None, date: Date | DateRange | None = None, file_references: Iterable[FileReference] | None = None, privacy: Privacy | None = None, public: bool | None = None, private: bool | None = None)[source]¶
- property facts: EntityCollection[_AssociateT & Entity]¶
Get the associates from the given owner.
- property label: Localizable¶
The entity’s human-readable label.
- async classmethod linked_data_schema(project: Project) DumpMapping[Dump] [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.
- property source: _AssociateT & Entity | None¶
Get the associate from the given owner.
- class betty.model.ancestry.Dated[source]¶
Bases:
LinkedDataDumpable
A resource with date information.
- async classmethod linked_data_schema(project: Project) DumpMapping[Dump] [source]¶
Define the JSON Schema for
betty.json.linked_data.LinkedDataDumpable.dump_linked_data()
.
- class betty.model.ancestry.Described[source]¶
Bases:
LinkedDataDumpable
A resource with a description.
- async classmethod linked_data_schema(project: Project) DumpMapping[Dump] [source]¶
Define the JSON Schema for
betty.json.linked_data.LinkedDataDumpable.dump_linked_data()
.
- final class betty.model.ancestry.Enclosure[source]¶
Bases:
Dated
,HasCitations
,Entity
The enclosure of one place by another.
Enclosures describe the outer (
`enclosed_by`) and inner(``encloses
) places, and their relationship.- property enclosed_by: _AssociateT & Entity | None¶
The outer place.
- property encloses: _AssociateT & Entity | None¶
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.model.ancestry.Event[source]¶
Bases:
Dated
,HasFileReferences
,HasCitations
,HasNotes
,Described
,HasPrivacy
,HasLinksEntity
,UserFacingEntity
,Entity
An event that took place.
- __init__(*, id: str | None = None, event_type: type[~betty.model.event_type.EventType] = <class 'betty.model.event_type.UnknownEventType'>, date: ~betty.locale.date.Date | ~betty.locale.date.DateRange | None = None, file_references: ~typing.Iterable[~betty.model.ancestry.FileReference] | None = None, citations: ~typing.Iterable[~betty.model.ancestry.Citation] | None = None, notes: ~typing.Iterable[~betty.model.ancestry.Note] | None = None, privacy: ~betty.model.ancestry.Privacy | None = None, public: bool | None = None, private: bool | None = None, place: ~betty.model.ancestry.Place | None = None, description: str | None = None)[source]¶
- property label: Localizable¶
The entity’s human-readable label.
- async classmethod linked_data_schema(project: Project) DumpMapping[Dump] [source]¶
Define the JSON Schema for
betty.json.linked_data.LinkedDataDumpable.dump_linked_data()
.
- property place: _AssociateT & Entity | None¶
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.
- property presences: EntityCollection[_AssociateT & Entity]¶
Get the associates from the given owner.
- final class betty.model.ancestry.File[source]¶
Bases:
Described
,HasPrivacy
,HasLinksEntity
,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: str | 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) DumpMapping[Dump] [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.
- property referees: EntityCollection[_AssociateT & Entity]¶
Get the associates from the given owner.
- class betty.model.ancestry.FileReference[source]¶
Bases:
Entity
A reference between
betty.model.ancestry.HasFileReferences
and betty.model.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]¶
- property file: _AssociateT & Entity | None¶
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() PluginId [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.
- property referee: _AssociateT & Entity | None¶
The entity that references the file.
- class betty.model.ancestry.HasCitations[source]¶
Bases:
LinkedDataDumpable
An entity with citations that support it.
- property citations: EntityCollection[_AssociateT & Entity]¶
Get the associates from the given owner.
- async classmethod linked_data_schema(project: Project) DumpMapping[Dump] [source]¶
Define the JSON Schema for
betty.json.linked_data.LinkedDataDumpable.dump_linked_data()
.
- class betty.model.ancestry.HasFileReferences[source]¶
Bases:
object
An entity that has associated
betty.model.ancestry.File
entities.- __init__(*args: Any, file_references: Iterable[FileReference] | None = None, **kwargs: Any)[source]¶
- property file_references: EntityCollection[_AssociateT & Entity]¶
Get the associates from the given owner.
- class betty.model.ancestry.HasLinks[source]¶
Bases:
LinkedDataDumpable
A resource that has external links.
- async classmethod linked_data_schema(project: Project) DumpMapping[Dump] [source]¶
Define the JSON Schema for
betty.json.linked_data.LinkedDataDumpable.dump_linked_data()
.
- class betty.model.ancestry.HasLinksEntity[source]¶
Bases:
HasLinks
An entity that has external links.
- class betty.model.ancestry.HasMediaType[source]¶
Bases:
LinkedDataDumpable
A resource with an IANA media type.
- async classmethod linked_data_schema(project: Project) DumpMapping[Dump] [source]¶
Define the JSON Schema for
betty.json.linked_data.LinkedDataDumpable.dump_linked_data()
.
- class betty.model.ancestry.HasNotes[source]¶
Bases:
LinkedDataDumpable
An entity that has notes associated with it.
- async classmethod linked_data_schema(project: Project) DumpMapping[Dump] [source]¶
Define the JSON Schema for
betty.json.linked_data.LinkedDataDumpable.dump_linked_data()
.
- property notes: EntityCollection[_AssociateT & Entity]¶
Get the associates from the given owner.
- class betty.model.ancestry.HasPrivacy[source]¶
Bases:
LinkedDataDumpable
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) DumpMapping[Dump] [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.model.ancestry.HasPrivacy.privacy
and ignores computed privacies.For access control and permissions checking, use
betty.model.ancestry.HasPrivacy.privacy
.
- final class betty.model.ancestry.Link[source]¶
Bases:
HasMediaType
,Localized
,Described
,LinkedDataDumpable
An external link.
- __init__(url: str, *, relationship: str | None = None, label: str | None = None, description: str | None = None, media_type: MediaType | None = None, locale: str | None = None)[source]¶
- async classmethod linked_data_schema(project: Project) DumpMapping[Dump] [source]¶
Define the JSON Schema for
betty.json.linked_data.LinkedDataDumpable.dump_linked_data()
.
- relationship: str | None¶
The link’s IANA link relationship.
- final class betty.model.ancestry.Note[source]¶
Bases:
UserFacingEntity
,HasPrivacy
,HasLinksEntity
,Entity
A note is a bit of textual information that can be associated with another entity.
- __init__(text: str, *, id: str | None = None, entity: HasNotes | None = None, privacy: Privacy | None = None, public: bool | None = None, private: bool | None = None)[source]¶
- property entity: _AssociateT & Entity | None¶
The entity the note belongs to.
- property label: Localizable¶
The entity’s human-readable label.
- async classmethod linked_data_schema(project: Project) DumpMapping[Dump] [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.
- final class betty.model.ancestry.Person[source]¶
Bases:
HasFileReferences
,HasCitations
,HasNotes
,HasLinksEntity
,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]¶
- property children: EntityCollection[_AssociateT & Entity]¶
Get the associates from the given owner.
- property label: Localizable¶
The entity’s human-readable label.
- async classmethod linked_data_schema(project: Project) DumpMapping[Dump] [source]¶
Define the JSON Schema for
betty.json.linked_data.LinkedDataDumpable.dump_linked_data()
.
- property names: EntityCollection[_AssociateT & Entity]¶
Get the associates from the given owner.
- property parents: EntityCollection[_AssociateT & Entity]¶
Get the associates from the given owner.
- 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.
- property presences: EntityCollection[_AssociateT & Entity]¶
Get the associates from the given owner.
- final class betty.model.ancestry.PersonName[source]¶
Bases:
Localized
,HasCitations
,HasPrivacy
,Entity
A name for a
betty.model.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 | None = None)[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) DumpMapping[Dump] [source]¶
Define the JSON Schema for
betty.json.linked_data.LinkedDataDumpable.dump_linked_data()
.
- property person: _AssociateT & Entity | None¶
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.model.ancestry.Place[source]¶
Bases:
HasLinksEntity
,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: list[PlaceName] | 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]¶
- property enclosed_by: EntityCollection[_AssociateT & Entity]¶
Get the associates from the given owner.
- property encloses: EntityCollection[_AssociateT & Entity]¶
Get the associates from the given owner.
- property events: EntityCollection[_AssociateT & Entity]¶
Get the associates from the given owner.
- property label: Localizable¶
The entity’s human-readable label.
- async classmethod linked_data_schema(project: Project) DumpMapping[Dump] [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.
- final class betty.model.ancestry.PlaceName[source]¶
Bases:
Localized
,Dated
,LinkedDataDumpable
A place name.
A name has a locale and a date during which the name was in use.
- async classmethod linked_data_schema(project: Project) DumpMapping[Dump] [source]¶
Define the JSON Schema for
betty.json.linked_data.LinkedDataDumpable.dump_linked_data()
.
- final class betty.model.ancestry.Presence[source]¶
Bases:
HasPrivacy
,Entity
The presence of a
betty.model.ancestry.Person
at anbetty.model.ancestry.Event
.- property event: _AssociateT & Entity | None¶
The event the person was present at.
- property label: Localizable¶
The entity’s human-readable label.
- property person: _AssociateT & Entity | None¶
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.model.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.model.ancestry.Source[source]¶
Bases:
Dated
,HasFileReferences
,HasNotes
,HasLinksEntity
,HasPrivacy
,UserFacingEntity
,Entity
A source of information.
- __init__(name: str | None = None, *, id: str | None = None, author: str | None = None, publisher: str | 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]¶
- property citations: EntityCollection[_AssociateT & Entity]¶
Get the associates from the given owner.
- property contained_by: _AssociateT & Entity | None¶
The source this one is directly contained by.
- property contains: EntityCollection[_AssociateT & Entity]¶
Get the associates from the given owner.
- property label: Localizable¶
The entity’s human-readable label.
- async classmethod linked_data_schema(project: Project) DumpMapping[Dump] [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.
- betty.model.ancestry.merge_privacies(*privacies: Privacy | HasPrivacy | None) Privacy [source]¶
Merge multiple privacies into one.
- async betty.model.ancestry.ref_link(root_schema: DumpMapping[Dump], project: Project) DumpMapping[Dump] [source]¶
Reference the Link schema.
- async betty.model.ancestry.ref_link_collection(root_schema: DumpMapping[Dump], project: Project) DumpMapping[Dump] [source]¶
Reference the schema for a collection of Link instances.
- betty.model.ancestry.ref_media_type(root_schema: MutableMapping[str, bool | int | float | str | None | MutableSequence[bool | int | float | str | None | MutableSequence[Dump] | MutableMapping[str, Dump]] | MutableMapping[str, bool | int | float | str | None | MutableSequence[Dump] | MutableMapping[str, Dump]]]) MutableMapping[str, bool | int | float | str | None | MutableSequence[bool | int | float | str | None | MutableSequence[Dump] | MutableMapping[str, Dump]] | MutableMapping[str, bool | int | float | str | None | MutableSequence[Dump] | MutableMapping[str, Dump]]] [source]¶
Reference the MediaType schema.