betty.entity package¶
Subpackages¶
Submodules¶
Module contents¶
Provide Betty’s data model API.
- class betty.entity.Entity¶
Bases:
LinkedDataDumpableWithSchemaJsonLdObject,Plugin[EntityDefinition],HasPropsAn entity is a uniquely identifiable data container.
To test your own subclasses, use
betty.test_utils.entity.EntityTestBase.- property ancestry_id: tuple[builtins.type[Self], str]¶
The ancestry ID.
This MUST be unique per ancestry.
- property label: Localizable¶
The entity’s human-readable label.
- async classmethod linked_data_schema(project: Project, /) JsonLdObject¶
Define the JSON Schema for
betty.linked_data.LinkedDataDumpable.dump_linked_data().
- final class betty.entity.EntityDefinition¶
Bases:
CountableHumanFacingDefinition,PluginClsDefinition[Entity]The entity plugin type. Entities represent the information in your ancestry, such as people and places.
Plugin type ID
entityDefinition
Built-in entities:
- citation (
Citation) - Citation
- enclosure (
Enclosure) - Enclosure
- event (
Event) - Event
- file (
File) - File
- file-reference (
FileReference) - File reference
- link (
Link) - Link
- note (
Note) - Note
- person (
Person) - Person
- person-name (
PersonName) - Person name
- place (
Place) - Place
- place-name (
PlaceName) - Place name
- presence (
Presence) - Presence: A person's presence at an event.
- source (
Source) - Source
- __init__(plugin_id: ResolvableMachineName, *, label: ResolvableLocalizable, label_plural: ResolvableLocalizable, label_countable: CountableLocalizable, auto: bool = True, description: ResolvableLocalizable | None = None, public_facing: bool = True, requires: Requires = ())¶
- static type() PluginTypeDefinition[Self]¶
The plugin type definition.
- citation (
- class betty.entity.NonPersistentId¶
Bases:
strA randomly generated ID that is not persistent.
Entities must have IDs for identification. However, not all entities can be provided with an ID that exists in the original data set (such as a third-party family tree loaded into Betty).
Non-persistent IDs are helpful in case there is no external ID that can be used. However, as they do not persist when reloading an ancestry, they MUST NOT be in contexts where persistent identifiers are expected, such as in URLs.