Export Notion pages to a Roam-Research like graph view.
- Python 3.7 or later ( 3.9 is recommended )
pip install -r requirements.txt
-
Create a notion internal integration and generate an
Internal Integration Token
. -
Open one notion page on browser and share it to your integration.
-
Find your base
Page ID
from browser url, for example:
if page url is: https://www.notion.so/yourName/PageTitle-8a4b5ff100d648fb8d39d4bfa756ff3f,
8a4b5ff100da48fb8d39d4bfa756ff3f
is thePage ID
- Provide your credentials by either
- Creating
credentials.py
and pastingInternal Integration Token
andPage ID
in it like so:NOTION_TOKEN = "secret_TBqfsxyH1slTpaignyZqQnDAAAn0MaeDEc2l96cdubD" PAGE_ID = "8a4b5ff100d648fb8d39d4bfa756ff3f"
- Exporting
Internal Integration Token
andPage ID
to environment variables:export NOTION_TOKEN="secret_TBqfsxyH1slTpaignyZqQnDAAAn0MaeDEc2l96cdubD" export PAGE_ID="8a4b5ff100d648fb8d39d4bfa756ff3f"
- Creating
python main.py
graph_view.html
would be generated at the project path, open it with any browser. (/lib
and graph_view.html
should be in the same folder)
database | page | |
---|---|---|
paragraph | โ๏ธ | โ๏ธ |
bulleted_list_item | โ๏ธ | โ๏ธ |
numbered_list_item | โ๏ธ | โ๏ธ |
to_do | โ๏ธ | โ๏ธ |
toggle | โ๏ธ | โ๏ธ |
child_page | โ๏ธ | โ๏ธ |
child_database | โ๏ธ | โ๏ธ |
embed | ||
callout | โ๏ธ | โ๏ธ |
quote | โ๏ธ | โ๏ธ |
column | ||
column_list | ||
synced_block | ||
link_to_page | ||
table | โ๏ธ | โ๏ธ |
table_row |