NotionPageReader#

pydantic model llama_index.readers.NotionPageReader#

Notion Page reader.

Reads a set of Notion pages.

Parameters

integration_token (str) – Notion integration token.

Show JSON schema
{
   "title": "NotionPageReader",
   "description": "Notion Page reader.\n\nReads a set of Notion pages.\n\nArgs:\n    integration_token (str): Notion integration token.",
   "type": "object",
   "properties": {
      "is_remote": {
         "title": "Is Remote",
         "default": true,
         "type": "boolean"
      },
      "integration_token": {
         "title": "Integration Token",
         "type": "string"
      },
      "headers": {
         "title": "Headers",
         "type": "object",
         "additionalProperties": {
            "type": "string"
         }
      },
      "class_name": {
         "title": "Class Name",
         "type": "string",
         "default": "NotionPageReader"
      }
   },
   "required": [
      "integration_token",
      "headers"
   ]
}

Config
  • arbitrary_types_allowed: bool = True

Fields
  • headers (Dict[str, str])

  • integration_token (str)

  • is_remote (bool)

field headers: Dict[str, str] [Required]#
field integration_token: str [Required]#
field is_remote: bool = True#
classmethod class_name() str#

Get the class name, used as a unique ID in serialization.

This provides a key that makes serialization robust against actual class name changes.

load_data(page_ids: List[str] = [], database_id: Optional[str] = None) List[Document]#

Load data from the input directory.

Parameters

page_ids (List[str]) – List of page ids to load.

Returns

List of documents.

Return type

List[Document]

query_database(database_id: str, query_dict: Dict[str, Any] = {}) List[str]#

Get all the pages from a Notion database.

read_page(page_id: str) str#

Read a page.

search(query: str) List[str]#

Search Notion page given a text query.