trilium_alchemy.core

This module implements ORM access to Trilium and fundamental note capabilities.

See the User guide for a detailed walkthrough with examples.

Class index

Imported

Session

session

Interface to Trilium and context in which to store changes to entities.

Note

note

Encapsulates a note.

Attachment

note.attachments

Encapsulates an attachment, a named binary blob owned by a Note.

Branch

branch

Encapsulates a branch, a parent-child association between notes.

Label

attribute

Encapsulates a label.

Relation

attribute

Encapsulates a relation.

BaseDeclarativeNote

declarative

Note to use as subclass for declarative notes which deterministically create a note hierarchy with fixed ids.

BaseDeclarativeMixin

declarative

Reusable collection of attributes and children which can be inherited by a BaseDeclarativeNote.

State

entity

Entity state.

Function index

Imported

label

declarative

Adds a Label to a BaseDeclarativeNote or BaseDeclarativeMixin subclass.

relation

declarative

Adds a Relation to a BaseDeclarativeNote or BaseDeclarativeMixin subclass.

label_def

declarative

Adds a Label definition (promoted label) to a BaseDeclarativeNote or BaseDeclarativeMixin subclass.

relation_def

declarative

Adds a Relation definition (promoted relation) to a BaseDeclarativeNote or BaseDeclarativeMixin subclass.

children

declarative

Add BaseDeclarativeNote subclasses as children, implicitly creating a Branch. May use a tuple of (child_cls, prefix) to additionally set branch prefix.

child

declarative

Instantiate provided class and add as child, creating a Branch and setting provided kwargs.

Exception index

Imported

ReadOnlyError

exceptions

Raised when user attempts to write a field which is read-only.

ValidationError

exceptions

Raised upon flush when changes in unit of work are invalid or incompatible.