notion_python_client.models package#

Subpackages#

Submodules#

notion_python_client.models.annotations module#

class notion_python_client.models.annotations.Annotation(*, bold: bool | None, italic: bool | None, strikethrough: bool | None, underline: bool | None, code: bool | None, color: Literal['blue', 'blue_background', 'brown', 'brown_background', 'default', 'gray', 'gray_background', 'green', 'green_background', 'orange', 'orange_background', 'pink', 'pink_background', 'purple', 'purple_background', 'red', 'red_background', 'yellow', 'yellow_background'] | None)#

Bases: BaseModel

bold: bool | None#
code: bool | None#
color: Literal['blue', 'blue_background', 'brown', 'brown_background', 'default', 'gray', 'gray_background', 'green', 'green_background', 'orange', 'orange_background', 'pink', 'pink_background', 'purple', 'purple_background', 'red', 'red_background', 'yellow', 'yellow_background'] | None#
italic: bool | None#
model_config: ClassVar[ConfigDict] = {}#

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

strikethrough: bool | None#
underline: bool | None#

notion_python_client.models.database_reference module#

class notion_python_client.models.database_reference.DatabaseReference(*, id: UUID)#

Bases: BaseModel

id: UUID#
model_config: ClassVar[ConfigDict] = {}#

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

notion_python_client.models.date module#

class notion_python_client.models.date.Date(*, start: datetime | date, end: datetime | None = None)#

Bases: BaseModel

end: datetime | None#
model_config: ClassVar[ConfigDict] = {}#

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

start: datetime | date#

notion_python_client.models.emoji module#

class notion_python_client.models.emoji.Emoji(*, type: str = 'emoji', emoji: str)#

Bases: BaseModel

emoji: str#
model_config: ClassVar[ConfigDict] = {}#

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

type: str#

notion_python_client.models.equation module#

class notion_python_client.models.equation.Equation(*, expression: str)#

Bases: BaseModel

expression: str#
model_config: ClassVar[ConfigDict] = {}#

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

notion_python_client.models.file module#

class notion_python_client.models.file.File(*, name: str | None = None, type: Literal['external', 'file'], file: Dict[str, str | datetime] | None = None, external: Dict | None = None)#

Bases: BaseModel

create_object(property_name: str = 'file') Dict#

Create a file object that can be used in the properties of a page.

Parameters:

property_name (str) – The name of the property that should be created (default: “file”)

Returns:

The created file object

Return type:

Dict

external: Dict | None#
file: Dict[str, str | datetime] | None#
model_config: ClassVar[ConfigDict] = {}#

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

name: str | None#
type: Literal['external', 'file']#

notion_python_client.models.mention module#

class notion_python_client.models.mention.Mention(*, type: Literal['database', 'date', 'link_preview', 'page', 'template_mention', 'user'], database: DatabaseReference | None = None, date: Date | None = None, link_preview: Link | None = None, page: PageReference | None = None, template_mention: TemplateReference | None = None, user: User | None = None)#

Bases: BaseModel

database: DatabaseReference | None#
date: Date | None#
model_config: ClassVar[ConfigDict] = {}#

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

page: PageReference | None#
template_mention: TemplateReference | None#
type: Literal['database', 'date', 'link_preview', 'page', 'template_mention', 'user']#
user: User | None#

notion_python_client.models.page module#

class notion_python_client.models.page.Page(*, object: str = 'page', id: str, archived: bool | None = False, parent: Parent, created_time: datetime, last_edited_time: datetime, created_by: User, last_edited_by: User, icon: File | Emoji | None = None, cover: File | None = None, properties: Dict[str, DateDict | StatusDict | Number | SelectDict | MultiSelect | People | Files | Checkbox | Email | PhoneNumber | FormulaDict | Relation | CreatedTime | CreatedBy | LastEditedTime | LastEditedBy | RichTextProp | Title | URL | UniqueIdDict | RollupDict], url: str, public_url: str | None = None)#

Bases: BaseModel

archived: bool | None#
cover: File | None#
created_by: User#
created_time: datetime#
icon: File | Emoji | None#
id: str#
last_edited_by: User#
last_edited_time: datetime#
model_config: ClassVar[ConfigDict] = {}#

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

object: str#
parent: Parent#
properties: Dict[str, DateDict | StatusDict | Number | SelectDict | MultiSelect | People | Files | Checkbox | Email | PhoneNumber | FormulaDict | Relation | CreatedTime | CreatedBy | LastEditedTime | LastEditedBy | RichTextProp | Title | URL | UniqueIdDict | RollupDict]#
public_url: str | None#
url: str#

notion_python_client.models.page_reference module#

class notion_python_client.models.page_reference.PageReference(*, id: UUID)#

Bases: BaseModel

id: UUID#
model_config: ClassVar[ConfigDict] = {}#

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

notion_python_client.models.parent module#

class notion_python_client.models.parent.Parent(*, type: str = 'database_id', database_id: UUID)#

Bases: BaseModel

Note: Currntly only the datbase parent is supported. The page parent is not supported yet.

create_object(property_name: str = 'parent') Dict#

Create a file object that can be used in the properties of a page.

Parameters:

property_name (str) – The name of the property that should be created (default: “parent”)

Returns:

The created file object

Return type:

Dict

database_id: UUID#
model_config: ClassVar[ConfigDict] = {}#

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

type: str#

notion_python_client.models.rich_text module#

class notion_python_client.models.rich_text.RichText(*, id: str | None = None, type: Literal['text', 'mention', 'equation'], text: Text | None = None, mention: Mention | None = None, equation: Equation | None = None, annotations: Annotation = None, plain_text: str | None = None, href: str | None = None)#

Bases: PropertiesBase, BaseModel

annotations: Annotation#
create_object(property_name: str) Dict#
equation: Equation | None#
href: str | None#
mention: Mention | None#
model_config: ClassVar[ConfigDict] = {}#

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

plain_text: str | None#
text: Text | None#
type: Literal['text', 'mention', 'equation']#

notion_python_client.models.template_reference module#

class notion_python_client.models.template_reference.TemplateReference(*, type: Literal['template_mention_date', 'template_mention_uesr'], template_mention_date: Literal['today', 'now'] | None = None, template_mention_user: Literal['me'] | None = None)#

Bases: BaseModel

model_config: ClassVar[ConfigDict] = {}#

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

template_mention_date: Literal['today', 'now'] | None#
template_mention_user: Literal['me'] | None#
type: Literal['template_mention_date', 'template_mention_uesr']#

notion_python_client.models.text module#

class notion_python_client.models.text.Text(*, content: str, link: Link | None = None)#

Bases: BaseModel

content: str#
model_config: ClassVar[ConfigDict] = {}#

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

notion_python_client.models.user module#

class notion_python_client.models.user.User(*, object: str = 'user', id: UUID)#

Bases: BaseModel

id: UUID#
model_config: ClassVar[ConfigDict] = {}#

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

object: str#

Module contents#