Python API client

Original README


Unofficial Python 3 client for API v3

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


from notion.client import NotionClient
# Obtain the `token_v2` value by inspecting your browser cookies on a logged-in session on
client = NotionClient(token_v2="<token_v2>")
# Replace this URL with the URL of the page you want to edit
page = client.get_block("")
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!"