notion-graph-view icon indicating copy to clipboard operation
notion-graph-view copied to clipboard

Generate a roam research like network graph view from your Notion pages.

Notion Graph View

github github github

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

  1. Create a notion internal integration and generate an Internal Integration Token.

    👉 Learn more about authorization

  2. Open one notion page on browser and share it to your integration.

  3. Find your base Page ID from browser url, for example:

if page url is: https://www.notion.so/yourName/PageTitle-8a4b5ff100d648fb8d39d4bfa756ff3f, 8a4b5ff100da48fb8d39d4bfa756ff3f is the Page ID

  1. Provide your credentials by either
    • Creating credentials.py and pasting Internal Integration Token and Page ID in it like so:
      NOTION_TOKEN = "secret_TBqfsxyH1slTpaignyZqQnDAAAn0MaeDEc2l96cdubD"
      PAGE_ID = "8a4b5ff100d648fb8d39d4bfa756ff3f"
      
    • Exporting Internal Integration Token and Page ID to environment variables:
      export NOTION_TOKEN="secret_TBqfsxyH1slTpaignyZqQnDAAAn0MaeDEc2l96cdubD"
      export PAGE_ID="8a4b5ff100d648fb8d39d4bfa756ff3f"
      

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