Models¶
All models are importable directly from pyclann:
from pyclann import (
FamilyTree, Person, LifeEvent,
RelationshipsResponse, SpouseInfo, FamilyTreeNode,
ResearchNote, ResearchFolder,
ChatSession, ChatMessage,
UserAiSettings, LoginInfo,
Sex, RelationshipType, SiblingType, EventType,
)
Enumerations¶
pyclann.models.Sex
¶
Bases: str, Enum
Biological sex recorded on a person.
pyclann.models.RelationshipType
¶
Bases: str, Enum
Type of relationship edge between two persons.
The :attr:url_slug property returns the SurrealDB edge-table name used in
DELETE relationship URLs (e.g. has_father). The enum value itself
("Father") is the form expected in POST request bodies.
pyclann.models.SiblingType
¶
Bases: str, Enum
Sibling sub-type; required when adding a Sibling relationship.
pyclann.models.EventType
¶
Bases: str, Enum
Common life-event categories. The server also accepts arbitrary strings.
Auth¶
pyclann.models.LoginInfo
dataclass
¶
LoginInfo(token: str, user_id: str, email: str, username: str, roles: list[str], permissions: list[str])
Session information returned by a successful :meth:ClannClient.login call.
Family Trees¶
pyclann.models.FamilyTree
dataclass
¶
Persons¶
pyclann.models.Person
dataclass
¶
Person(id: str, family_name: str, first_name: str, sex: str, middle_name: str | None = None, date_of_birth: str | None = None, place_of_birth: str | None = None, date_of_death: str | None = None, place_of_death: str | None = None, image_path: str | None = None, life_image_path: str | None = None, image_bytes: int | None = None, life_image_bytes: int | None = None, nickname: str | None = None, username: str | None = None, email: str | None = None, verified: bool = False, biography: str | None = None, created_by: str | None = None, trees: list[str] = list())
A person in a family tree.
pyclann.models.SpouseInfo
dataclass
¶
SpouseInfo(id: str, family_name: str, first_name: str, sex: str, middle_name: str | None = None, date_of_birth: str | None = None, place_of_birth: str | None = None, date_of_death: str | None = None, place_of_death: str | None = None, image_path: str | None = None, life_image_path: str | None = None, image_bytes: int | None = None, life_image_bytes: int | None = None, nickname: str | None = None, username: str | None = None, email: str | None = None, verified: bool = False, biography: str | None = None, created_by: str | None = None, trees: list[str] = list(), spouse_from: str | None = None, spouse_to: str | None = None)
Relationships¶
pyclann.models.RelationshipsResponse
dataclass
¶
RelationshipsResponse(father: list[Person] = list(), mother: list[Person] = list(), siblings: list[Person] = list(), spouse: list[SpouseInfo] = list())
All relationships for a person, grouped by type.
pyclann.models.FamilyTreeNode
dataclass
¶
FamilyTreeNode(id: str, family_name: str, first_name: str, sex: str | None = None, date_of_birth: str | None = None, place_of_birth: str | None = None, biography: str | None = None, image_path: str | None = None, father: list[FamilyTreeNode] = list(), mother: list[FamilyTreeNode] = list(), children: list[FamilyTreeNode] = list(), spouse: list[FamilyTreeNode] = list(), siblings: list[FamilyTreeNode] = list())
A node in the recursive family-tree view (up to 2 generations deep).
father
class-attribute
instance-attribute
¶
Father's node, with their own ancestors.
mother
class-attribute
instance-attribute
¶
Mother's node, with their own ancestors.
children
class-attribute
instance-attribute
¶
Direct children. Populated only for the root node.
spouse
class-attribute
instance-attribute
¶
Spouses. Populated only for the root node.
siblings
class-attribute
instance-attribute
¶
Siblings. Populated only for the root node.
Life Events¶
pyclann.models.LifeEvent
dataclass
¶
LifeEvent(id: str, person_id: str, name: str, event_type: str, date: str | None = None, description: str | None = None, story: str | None = None, verified: bool = False, source_link: str | None = None, source_image: str | None = None, source_doc: str | None = None, created_by: str | None = None)
A significant event in a person's life.
event_type
instance-attribute
¶
Common values: "Birth", "Death", "Marriage" — see :class:EventType.
Research¶
pyclann.models.ResearchNote
dataclass
¶
ResearchNote(id: str, title: str, trees: list[str] = list(), description: str | None = None, body: str | None = None, folder_id: str | None = None, created_by: str | None = None, created_at: datetime | None = None, updated_at: datetime | None = None, is_shared: bool = False, parent_id: str | None = None)
pyclann.models.ResearchFolder
dataclass
¶
A folder for organising research notes.
Chat¶
pyclann.models.ChatSession
dataclass
¶
pyclann.models.ChatMessage
dataclass
¶
AI Settings¶
pyclann.models.UserAiSettings
dataclass
¶
UserAiSettings(id: str, username: str, provider: str, model: str, ollama_url: str | None = None, encrypted_key: str | None = None, iv: str | None = None, auth_tag: str | None = None)
Stored AI provider settings for the authenticated user.
API keys are stored as encrypted blobs — the webapp encrypts with AES-256-GCM before sending; clann-server never sees the plaintext key.