notion-graph-view
notion-graph-view copied to clipboard
Generate a roam research like network graph view from your Notion pages.
Notion Graph View
Export Notion pages to a Roam-Research like graph view.
📜 Usage
Environment
- Python 3.7 or later ( 3.9 is recommended )
Install
pip install -r requirements.txt
Setup Notion API
-
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
Run
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)
🔗 Link support
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 |