Python API client

Author
Created
Dec 8, 2019 3:31 PM
Tags
api

Original README

notion-py

Unofficial Python 3 client for Notion.so API v3

Warning: This is still somewhat experimental, and doesn't have 100% API coverage. Issues and pull requests welcome!

Quickstart

from notion.client import NotionClient
# Obtain the `token_v2` value by inspecting your browser cookies on a logged-in session on Notion.so
client = NotionClient(token_v2="<token_v2>")
# Replace this URL with the URL of the page you want to edit
page = client.get_block("https://www.notion.so/myorg/Test-c0d20a71c0944985ae96e661ccc99821")
print("The old title is:", page.title)
# Note: You can use Markdown! We convert on-the-fly to Notion's internal formatted text data structure.
page.title = "The title has now changed, and has *live-updated* in the browser!"