Links

Add paragraph with link in page

Tags: #notion #productivity #naas_drivers #block #paragraph #link #snippet #operations
Author: Maxime Jublou
Last update: 2023-04-12 (Created: 2022-03-17)
Description: This notebook allows you to add a paragraph with a link to a page in Notion.

Input

Import libraries

from naas_drivers import notion
from naas_drivers.tools.notion import Link

Setup Notion

# Enter Token API
token = "*****"
# Enter Database URL
page_url = (
"https://www.notion.so/naas-official/Daily-med-03952fcb93c045bba519a7564a64045e"
)
# Link
link = "https://app.naas.ai/"

Model

Get page

page = notion.connect(token).page.get(page_url)
res = page.paragraph("Go to Naas")
res.paragraph.text[0].href = link
res.paragraph.text[0].text.link = Link(link)

Output

Update page in Notion

page.update()