Skip to content

Page

page

Functionality around Notion pages.

Page(*args: Any, **kwargs: Any)

A Notion page.

Attributes:

Name Type Description
props PageProperties

accessor for all page properties

cover: FileInfo | None property writable

Cover of the page.

icon: FileInfo | Emoji | None property writable

Icon of the page, i.e. emojis, Notion's icons, or custom images.

in_db: bool property

Return True if this page is located in a database.

is_page: bool property

Return whether the object is a page.

parent_db: Database | None property

If this page is located in a database return the database or None otherwise.

This is a convenience method to avoid the need to check and cast the type of the parent.

props: PageProperties instance-attribute

subdbs: list[Database] property

Return all contained databases within this page

subpages: list[Page] property

Return all contained pages within this page

title: RichText property writable

Title of the page.

url: str property

Return the URL of this database.

__repr__() -> str

__str__() -> str

delete() -> Self

Delete this page.

Warning

Deleting a page will also delete all child pages and child databases recursively. If these objects are already cached in the session, they will not be updated. Use session.cache.clear() to clear the cache or call reload() on them.

reload() -> Self

Reload this page.

restore() -> Self

Restore this page.

show(*, simple: bool | None = None)

Show the content of the page, rendered in Jupyter Lab

to_html(*, raw: bool = False) -> str

Return the content of the page as HTML.

to_markdown() -> str

Return the content of the page as Markdown.

Note

This will not include nested blocks, i.e. children.

wrap_obj_ref(obj_ref: obj_blocks.Page) -> Self classmethod

PageProperties(page: Page)

Properties of a page as defined in the schema of the database.

This defines the .props namespace of a page page and updates the content on the Notion server side in case of an assignment. Access the properties with page.props.property_name or page.props["Property Name"].

__getitem__(prop_name: str) -> PropertyValue

__iter__()

Iterator of property names.

__setitem__(prop_name: str, value: Any)

to_dict() -> dict[str, PropertyValue]

All page properties as dictionary.

PageProperty(prop_name: str)

Property of a page implementing the descriptor protocol.

__get__(obj: PageProperties, type=None) -> PropertyValue

__set__(obj: PageProperties, value)