Objects
objects
¶
Functionality for general Notion objects like texts, files, options, etc.
T = TypeVar('T', bound=objs.RichTextObject)
module-attribute
¶
Emoji(emoji: str)
¶
Emoji object which behaves like str.
obj_ref = objs.EmojiObject.build(emoji)
instance-attribute
¶
__eq__(other: object) -> bool
¶
__hash__()
¶
__repr__() -> str
¶
__str__() -> str
¶
from_code(shortcode: str) -> Emoji
classmethod
¶
Create an Emoji object from a :shortcode:, e.g.
to_code() -> str
¶
Represent the emoji as :shortcode:, e.g.
Equation(*args: Any, **kwargs: Any)
¶
An Equation object.
File(*, url: str, name: str | None = None)
¶
A web resource e.g. for the files property.
Mention(*args: Any, **kwargs: Any)
¶
A Mention object.
type: str
property
¶
Type of the mention, e.g. user, page, etc.
Option(name: str, *, color: Color = Color.DEFAULT)
¶
OptionGroup(*args: Any, **kwargs: Any)
¶
Group of options for status property.
OptionNS
¶
Option namespace to simplify working with (Multi-)Select options.
to_list() -> list[Option]
classmethod
¶
Convert the enum to a list as needed by the (Multi)Select column types.
RichText(plain_text: str)
¶
User-facing class holding several RichTexts.
obj_ref: list[objs.RichTextObject]
property
¶
__eq__(other: object) -> bool
¶
__hash__()
¶
from_markdown(text: str) -> RichText
classmethod
¶
Create RichTextList by parsing the markdown.
from_plain_text(text: str) -> RichText
classmethod
¶
Create RichTextList from plain text.
This method is a more explicit alias for the default constructor.
to_markdown() -> str
¶
Convert the list of RichText objects to markdown.
to_plain_text() -> str
¶
Return rich text as plaintext
This method is a more explicit variant then just using the object.
wrap_obj_ref(obj_refs: list[objs.RichTextObject] | None) -> RichText
classmethod
¶
RichTextBase(*args: Any, **kwargs: Any)
¶
Text(*args: Any, **kwargs: Any)
¶
A Text object.
User(*args: Any, **kwargs: Any)
¶
wrap_icon(icon_obj: objs.FileObject | objs.EmojiObject | None) -> File | Emoji | None
¶
Wrap the icon object into the corresponding class.