trilium_alchemy.core.note.attributes
¶
Class index¶
Canonical
Interface to a note’s owned and inherited attributes. |
|
Interface to a note’s owned attributes. |
|
Interface to a note’s inherited attributes. |
|
Accessor for labels, filtered by owned vs inherited. |
|
Accessor for owned labels. |
|
Accessor for inherited labels. |
|
Accessor for relations, filtered by owned vs inherited. |
|
Accessor for owned relations. |
|
Accessor for inherited relations. |
Symbols¶
- class trilium_alchemy.core.note.attributes.Attributes(note)¶
Bases:
trilium_alchemy.core.note.extension.NoteExtension
trilium_alchemy.core.note.attributes._filters.BaseFilteredAttributes
collections.abc.Sequence
Interface to a note’s owned and inherited attributes.
This object is stateless;
Note.attributes.owned
andNote.attributes.inherited
are the sources of truth for owned and inherited attributes respectively.For type-safe accesses, use
Note.labels
orNote.relations
.- Raises:
ReadOnlyError – Upon attempt to modify
- property owned: OwnedAttributes¶
Getter/setter for owned attributes. Same interface as
Note.attributes
but filtered by owned attributes.
- property inherited: InheritedAttributes¶
Getter for inherited attributes. Same interface as
Note.attributes
but filtered by inherited attributes.
- get(name: str) AttributeT | None ¶
Inherited from:
trilium_alchemy.core.note.attributes._filters.AttributeListMixin
Get first attribute with provided name, or
None
if none exist.
- get_all(name: str) list[AttributeT] ¶
Inherited from:
trilium_alchemy.core.note.attributes._filters.AttributeListMixin
Get all attributes with provided name.
- index(value, start=0, stop=None)¶
Inherited from:
collections.abc.Sequence
S.index(value, [start, [stop]]) -> integer – return first index of value. Raises ValueError if the value is not present.
Supporting start and stop arguments is optional, but recommended.
- count(value)¶
Inherited from:
collections.abc.Sequence
S.count(value) -> integer – return number of occurrences of value
- class trilium_alchemy.core.note.attributes.OwnedAttributes(entity: BaseEntity)¶
Bases:
trilium_alchemy.core.note.attributes._filters.BaseFilteredAttributes
trilium_alchemy.core.note.extension.BaseEntityList
Interface to a note’s owned attributes.
- get(name: str) AttributeT | None ¶
Inherited from:
trilium_alchemy.core.note.attributes._filters.AttributeListMixin
Get first attribute with provided name, or
None
if none exist.
- get_all(name: str) list[AttributeT] ¶
Inherited from:
trilium_alchemy.core.note.attributes._filters.AttributeListMixin
Get all attributes with provided name.
- insert(i: int, value: EntityT)¶
Inherited from:
trilium_alchemy.core.note.extension.BaseEntityList
S.insert(index, value) – insert value before index
- append(value)¶
Inherited from:
collections.abc.MutableSequence
S.append(value) – append value to the end of the sequence
- clear()¶
Inherited from:
collections.abc.MutableSequence
S.clear() -> None – remove all items from S
- reverse()¶
Inherited from:
collections.abc.MutableSequence
S.reverse() – reverse IN PLACE
- extend(values)¶
Inherited from:
collections.abc.MutableSequence
S.extend(iterable) – extend sequence by appending elements from the iterable
- pop(index=-1)¶
Inherited from:
collections.abc.MutableSequence
S.pop([index]) -> item – remove and return item at index (default last). Raise IndexError if list is empty or index is out of range.
- remove(value)¶
Inherited from:
collections.abc.MutableSequence
S.remove(value) – remove first occurrence of value. Raise ValueError if the value is not present.
- index(value, start=0, stop=None)¶
Inherited from:
collections.abc.Sequence
S.index(value, [start, [stop]]) -> integer – return first index of value. Raises ValueError if the value is not present.
Supporting start and stop arguments is optional, but recommended.
- count(value)¶
Inherited from:
collections.abc.Sequence
S.count(value) -> integer – return number of occurrences of value
- class trilium_alchemy.core.note.attributes.InheritedAttributes(entity: BaseEntity)¶
Bases:
trilium_alchemy.core.note.extension.NoteStatefulExtension
trilium_alchemy.core.note.attributes._filters.BaseFilteredAttributes
collections.abc.Sequence
Interface to a note’s inherited attributes.
- Raises:
ReadOnlyError – Upon attempt to modify
- get(name: str) AttributeT | None ¶
Inherited from:
trilium_alchemy.core.note.attributes._filters.AttributeListMixin
Get first attribute with provided name, or
None
if none exist.
- get_all(name: str) list[AttributeT] ¶
Inherited from:
trilium_alchemy.core.note.attributes._filters.AttributeListMixin
Get all attributes with provided name.
- index(value, start=0, stop=None)¶
Inherited from:
collections.abc.Sequence
S.index(value, [start, [stop]]) -> integer – return first index of value. Raises ValueError if the value is not present.
Supporting start and stop arguments is optional, but recommended.
- count(value)¶
Inherited from:
collections.abc.Sequence
S.count(value) -> integer – return number of occurrences of value
- class trilium_alchemy.core.note.attributes.Labels(note: Note)¶
Bases:
trilium_alchemy.core.note.attributes._filters.BaseCombinedFilteredAttributes
trilium_alchemy.core.note.attributes.labels.BaseWriteableLabelMixin
Accessor for labels, filtered by owned vs inherited.
- property owned: OwnedLabels¶
- property inherited: InheritedLabels¶
- get(name: str) AttributeT | None ¶
Inherited from:
trilium_alchemy.core.note.attributes._filters.AttributeListMixin
Get first attribute with provided name, or
None
if none exist.
- get_all(name: str) list[AttributeT] ¶
Inherited from:
trilium_alchemy.core.note.attributes._filters.AttributeListMixin
Get all attributes with provided name.
- index(value, start=0, stop=None)¶
Inherited from:
collections.abc.Sequence
S.index(value, [start, [stop]]) -> integer – return first index of value. Raises ValueError if the value is not present.
Supporting start and stop arguments is optional, but recommended.
- count(value)¶
Inherited from:
collections.abc.Sequence
S.count(value) -> integer – return number of occurrences of value
- set_value(name: str, val: str, inheritable: bool = False)¶
Inherited from:
trilium_alchemy.core.note.attributes.labels.BaseWriteableLabelMixin
Set value of first label with provided name.
- set_values(name: str, vals: list[str], inheritable: bool = False)¶
Inherited from:
trilium_alchemy.core.note.attributes.labels.BaseWriteableLabelMixin
Set values of all labels with provided name, creating or deleting labels as necessary.
- append_value(name: str, val: str, inheritable: bool = False)¶
Inherited from:
trilium_alchemy.core.note.attributes.labels.BaseWriteableLabelMixin
Create and append new label.
- class trilium_alchemy.core.note.attributes.OwnedLabels(note: Note)¶
Bases:
trilium_alchemy.core.note.attributes._filters.BaseOwnedFilteredAttributes
trilium_alchemy.core.note.attributes.labels.BaseWriteableLabelMixin
Accessor for owned labels.
- insert(i: int, val: AttributeT)¶
Inherited from:
trilium_alchemy.core.note.attributes._filters.BaseOwnedFilteredAttributes
S.insert(index, value) – insert value before index
- get(name: str) AttributeT | None ¶
Inherited from:
trilium_alchemy.core.note.attributes._filters.AttributeListMixin
Get first attribute with provided name, or
None
if none exist.
- get_all(name: str) list[AttributeT] ¶
Inherited from:
trilium_alchemy.core.note.attributes._filters.AttributeListMixin
Get all attributes with provided name.
- append(value)¶
Inherited from:
collections.abc.MutableSequence
S.append(value) – append value to the end of the sequence
- clear()¶
Inherited from:
collections.abc.MutableSequence
S.clear() -> None – remove all items from S
- reverse()¶
Inherited from:
collections.abc.MutableSequence
S.reverse() – reverse IN PLACE
- extend(values)¶
Inherited from:
collections.abc.MutableSequence
S.extend(iterable) – extend sequence by appending elements from the iterable
- pop(index=-1)¶
Inherited from:
collections.abc.MutableSequence
S.pop([index]) -> item – remove and return item at index (default last). Raise IndexError if list is empty or index is out of range.
- remove(value)¶
Inherited from:
collections.abc.MutableSequence
S.remove(value) – remove first occurrence of value. Raise ValueError if the value is not present.
- index(value, start=0, stop=None)¶
Inherited from:
collections.abc.Sequence
S.index(value, [start, [stop]]) -> integer – return first index of value. Raises ValueError if the value is not present.
Supporting start and stop arguments is optional, but recommended.
- count(value)¶
Inherited from:
collections.abc.Sequence
S.count(value) -> integer – return number of occurrences of value
- set_value(name: str, val: str, inheritable: bool = False)¶
Inherited from:
trilium_alchemy.core.note.attributes.labels.BaseWriteableLabelMixin
Set value of first label with provided name.
- set_values(name: str, vals: list[str], inheritable: bool = False)¶
Inherited from:
trilium_alchemy.core.note.attributes.labels.BaseWriteableLabelMixin
Set values of all labels with provided name, creating or deleting labels as necessary.
- append_value(name: str, val: str, inheritable: bool = False)¶
Inherited from:
trilium_alchemy.core.note.attributes.labels.BaseWriteableLabelMixin
Create and append new label.
- class trilium_alchemy.core.note.attributes.InheritedLabels(note: Note)¶
Bases:
trilium_alchemy.core.note.attributes._filters.BaseInheritedFilteredAttributes
trilium_alchemy.core.note.attributes.labels.BaseReadableLabelMixin
Accessor for inherited labels.
- get(name: str) AttributeT | None ¶
Inherited from:
trilium_alchemy.core.note.attributes._filters.AttributeListMixin
Get first attribute with provided name, or
None
if none exist.
- get_all(name: str) list[AttributeT] ¶
Inherited from:
trilium_alchemy.core.note.attributes._filters.AttributeListMixin
Get all attributes with provided name.
- index(value, start=0, stop=None)¶
Inherited from:
collections.abc.Sequence
S.index(value, [start, [stop]]) -> integer – return first index of value. Raises ValueError if the value is not present.
Supporting start and stop arguments is optional, but recommended.
- count(value)¶
Inherited from:
collections.abc.Sequence
S.count(value) -> integer – return number of occurrences of value
- class trilium_alchemy.core.note.attributes.Relations(note: Note)¶
Bases:
trilium_alchemy.core.note.attributes._filters.BaseCombinedFilteredAttributes
trilium_alchemy.core.note.attributes.relations.BaseWriteableRelationMixin
Accessor for relations, filtered by owned vs inherited.
- property owned: OwnedRelations¶
- property inherited: InheritedRelations¶
- get(name: str) AttributeT | None ¶
Inherited from:
trilium_alchemy.core.note.attributes._filters.AttributeListMixin
Get first attribute with provided name, or
None
if none exist.
- get_all(name: str) list[AttributeT] ¶
Inherited from:
trilium_alchemy.core.note.attributes._filters.AttributeListMixin
Get all attributes with provided name.
- index(value, start=0, stop=None)¶
Inherited from:
collections.abc.Sequence
S.index(value, [start, [stop]]) -> integer – return first index of value. Raises ValueError if the value is not present.
Supporting start and stop arguments is optional, but recommended.
- count(value)¶
Inherited from:
collections.abc.Sequence
S.count(value) -> integer – return number of occurrences of value
- set_target(name: str, val: Note, inheritable: bool = False)¶
Inherited from:
trilium_alchemy.core.note.attributes.relations.BaseWriteableRelationMixin
Set target of first relation with provided name.
- set_targets(name: str, vals: list[Note], inheritable: bool = False)¶
Inherited from:
trilium_alchemy.core.note.attributes.relations.BaseWriteableRelationMixin
Set targets of all relations with provided name, creating or deleting relations as necessary.
- append_target(name: str, val: Note, inheritable: bool = False)¶
Inherited from:
trilium_alchemy.core.note.attributes.relations.BaseWriteableRelationMixin
Create and append new relation with provided target.
- class trilium_alchemy.core.note.attributes.OwnedRelations(note: Note)¶
Bases:
trilium_alchemy.core.note.attributes._filters.BaseOwnedFilteredAttributes
trilium_alchemy.core.note.attributes.relations.BaseWriteableRelationMixin
Accessor for owned relations.
- insert(i: int, val: AttributeT)¶
Inherited from:
trilium_alchemy.core.note.attributes._filters.BaseOwnedFilteredAttributes
S.insert(index, value) – insert value before index
- get(name: str) AttributeT | None ¶
Inherited from:
trilium_alchemy.core.note.attributes._filters.AttributeListMixin
Get first attribute with provided name, or
None
if none exist.
- get_all(name: str) list[AttributeT] ¶
Inherited from:
trilium_alchemy.core.note.attributes._filters.AttributeListMixin
Get all attributes with provided name.
- append(value)¶
Inherited from:
collections.abc.MutableSequence
S.append(value) – append value to the end of the sequence
- clear()¶
Inherited from:
collections.abc.MutableSequence
S.clear() -> None – remove all items from S
- reverse()¶
Inherited from:
collections.abc.MutableSequence
S.reverse() – reverse IN PLACE
- extend(values)¶
Inherited from:
collections.abc.MutableSequence
S.extend(iterable) – extend sequence by appending elements from the iterable
- pop(index=-1)¶
Inherited from:
collections.abc.MutableSequence
S.pop([index]) -> item – remove and return item at index (default last). Raise IndexError if list is empty or index is out of range.
- remove(value)¶
Inherited from:
collections.abc.MutableSequence
S.remove(value) – remove first occurrence of value. Raise ValueError if the value is not present.
- index(value, start=0, stop=None)¶
Inherited from:
collections.abc.Sequence
S.index(value, [start, [stop]]) -> integer – return first index of value. Raises ValueError if the value is not present.
Supporting start and stop arguments is optional, but recommended.
- count(value)¶
Inherited from:
collections.abc.Sequence
S.count(value) -> integer – return number of occurrences of value
- set_target(name: str, val: Note, inheritable: bool = False)¶
Inherited from:
trilium_alchemy.core.note.attributes.relations.BaseWriteableRelationMixin
Set target of first relation with provided name.
- set_targets(name: str, vals: list[Note], inheritable: bool = False)¶
Inherited from:
trilium_alchemy.core.note.attributes.relations.BaseWriteableRelationMixin
Set targets of all relations with provided name, creating or deleting relations as necessary.
- append_target(name: str, val: Note, inheritable: bool = False)¶
Inherited from:
trilium_alchemy.core.note.attributes.relations.BaseWriteableRelationMixin
Create and append new relation with provided target.
- class trilium_alchemy.core.note.attributes.InheritedRelations(note: Note)¶
Bases:
trilium_alchemy.core.note.attributes._filters.BaseInheritedFilteredAttributes
trilium_alchemy.core.note.attributes.relations.BaseReadableRelationMixin
Accessor for inherited relations.
- get(name: str) AttributeT | None ¶
Inherited from:
trilium_alchemy.core.note.attributes._filters.AttributeListMixin
Get first attribute with provided name, or
None
if none exist.
- get_all(name: str) list[AttributeT] ¶
Inherited from:
trilium_alchemy.core.note.attributes._filters.AttributeListMixin
Get all attributes with provided name.
- index(value, start=0, stop=None)¶
Inherited from:
collections.abc.Sequence
S.index(value, [start, [stop]]) -> integer – return first index of value. Raises ValueError if the value is not present.
Supporting start and stop arguments is optional, but recommended.
- count(value)¶
Inherited from:
collections.abc.Sequence
S.count(value) -> integer – return number of occurrences of value