trilium_alchemy.core.branch#

Class index#

Canonical

Branch

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

Symbols#

class trilium_alchemy.core.branch.Branch(parent: Note = None, child: Note = None, prefix: str = '', expanded: bool = False, session: Session = None, **kwargs)#
Parameters:
parent: Note = None

Parent note

child: Note = None

Child note

prefix: str = ''

Branch specific title prefix for child note

expanded: bool = False

True if child note (as a folder) appears expanded in UI

Bases:

trilium_alchemy.core.entity.Entity

Aliases:

trilium_alchemy.Branch
trilium_alchemy.core.Branch

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

Implicitly created by operations documented in Note and Branches. Can also be explicitly created and added to a note using its += operator:

# add child note with prefix
note += Branch(child=Note(title="Child note"), prefix="Child branch prefix")

# add parent note (cloning the note) with prefix
note += Branch(parent=session.root, prefix="Parent branch prefix")
branch_id: str#

EntityIdDescriptor()

Read-only access to branchId.

parent: Note#

WriteOnceDescriptor()

Parent note.

child: Note#

WriteOnceDescriptor()

Child note.

prefix: str#

FieldDescriptor()

Branch prefix.

expanded: bool#

FieldDescriptor()

Whether child note (as a folder) appears expanded in UI.

utc_date_modified: str#

ReadOnlyFieldDescriptor()

UTC modified datetime, e.g. 2021-12-31 19:18:11.939Z.

position: int#

ReadOnlyDescriptor()

Read-only access to position of this attribute.

Note

This is maintained automatically based on the order of this attribute in its note’s Note.branches.children list.

property state: State#

Inherited from: trilium_alchemy.core.entity.Entity

Current state.

property session: Session#

Inherited from: trilium_alchemy.core.entity.Entity

Session to which this entity belongs.

property str_short: str#

Inherited from: trilium_alchemy.core.entity.Entity

Get a short description of this entity.

property str_summary: str#

Inherited from: trilium_alchemy.core.entity.Entity

Get a summary of this entity, including its current state and model values.

flush() None#

Inherited from: trilium_alchemy.core.entity.Entity

Commit changes to Trilium for this entity and its dependencies.

invalidate() None#

Inherited from: trilium_alchemy.core.entity.Entity

Discard cached contents and user-provided data for this object. Upon next access, data will be fetched from Trilium.

delete() None#

Inherited from: trilium_alchemy.core.entity.Entity

Mark this entity for pending delete.