Skip to content

File

file

File and emoji objects for the Notion API.

NOTION_HOSTED_DOMAIN = 'secure.notion-static.com' 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. 😄

FileInfo(*, url: str, name: str | None = None, caption: str | None = None)

Information about a web resource e.g. for the files property.

caption: Text property writable

name: str | None property writable

obj_ref: objs.FileObject instance-attribute

url: str property writable

__eq__(other: object) -> bool

__hash__()

__repr__() -> str

__str__() -> str

wrap_obj_ref(obj_ref: objs.FileObject) -> FileInfo classmethod

is_notion_hosted(url: str) -> bool

Check if the URL is hosted on Notion.

wrap_icon(icon_obj: objs.FileObject | objs.EmojiObject) -> FileInfo | Emoji

Wrap the icon object into the corresponding class.