{"id":13737895,"url":"https://github.com/stevedsun/notion-graph-view","last_synced_at":"2025-05-15T20:03:31.585Z","repository":{"id":41526648,"uuid":"336700696","full_name":"stevedsun/notion-graph-view","owner":"stevedsun","description":"Generate a roam research like network graph view from your Notion pages.","archived":false,"fork":false,"pushed_at":"2025-03-18T03:34:01.000Z","size":414,"stargazers_count":460,"open_issues_count":4,"forks_count":40,"subscribers_count":10,"default_branch":"main","last_synced_at":"2025-04-08T04:11:19.895Z","etag":null,"topics":["notion","notion-api","notion-sdk-py","pyvis","roam-research"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/stevedsun.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2021-02-07T04:32:14.000Z","updated_at":"2025-04-02T07:55:31.000Z","dependencies_parsed_at":"2023-01-31T05:25:10.987Z","dependency_job_id":"bdc33479-ab15-4bdb-8575-54881ab6143d","html_url":"https://github.com/stevedsun/notion-graph-view","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/stevedsun%2Fnotion-graph-view","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/stevedsun%2Fnotion-graph-view/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/stevedsun%2Fnotion-graph-view/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/stevedsun%2Fnotion-graph-view/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/stevedsun","download_url":"https://codeload.github.com/stevedsun/notion-graph-view/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":254414493,"owners_count":22067271,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["notion","notion-api","notion-sdk-py","pyvis","roam-research"],"created_at":"2024-08-03T03:02:04.900Z","updated_at":"2025-05-15T20:03:29.597Z","avatar_url":"https://github.com/stevedsun.png","language":"Python","funding_links":["https://www.buymeacoffee.com/stevedsun"],"categories":["Python","others"],"sub_categories":[],"readme":"![](images/snap.png)\n\n# Notion Graph View\n\n![github](https://img.shields.io/badge/python-3.9-blue.svg) ![github](https://img.shields.io/badge/license-MIT-green.svg) ![github](https://img.shields.io/badge/notion_version-2022.06.28-lightgrey.svg)\n\nExport [Notion](https://notion.so) pages to a Roam-Research like graph view.\n\n\u003ca href=\"https://www.buymeacoffee.com/stevedsun\" target=\"_blank\"\u003e\u003cimg src=\"https://cdn.buymeacoffee.com/buttons/v2/default-yellow.png\" alt=\"Buy Me A Coffee\" style=\"height: 60px !important;width: 217px !important;\" \u003e\u003c/a\u003e\n\n## 📜 Usage\n\n### Environment\n\n- Python \u003e= 3.9\n\n### Installing\n\n```shell\npip install notion-graph\n```\n\n### Notion API Setup\n\n1. Create a [notion internal integration](https://www.notion.so/my-integrations) and generate an `Internal Integration Token`.\n\n   👉 [Learn more about authorization](https://developers.notion.com/docs/authorization)\n\n2. Open one notion page on the browser, select \"Add connections\" and add your integration account.\n3. Find your base `Page ID` from the browser URL, for example:\n\n\u003e if page url is: https://www.notion.so/yourName/PageTitle-8a4b5ff100d648fb8d39d4bfa756ff3f, `8a4b5ff100da48fb8d39d4bfa756ff3f` is the `Page ID`\n\n### Quickly Running\n\n```shell\npython -m notion_graph -p \u003cPage ID\u003e -t \u003cIntegration Token\u003e -o \u003cfile path to export\u003e\n```\n\nFor instance,\n\n```shell\npython -m notion_graph -p 856391c93ae64bd1b7ebf699ca0cd861 -t secret_b8p7uLp3j3n95IDgofC9GviXP111Skx6NOt2d20U8e -o ./graph_out.html\n```\n\n`graph_out.html` would be generated at your specific path.\n\n### Importing as a Python Library\n\nYou can also import `notion_graph` as a library.\n\nFor instance, draw your diagram in Jupyter Notebook.\n\n```python\nimport notion_graph as ng\n\nmy_ng = ng.NotionGraph(bearer_token=\"secret_b8p7uLp3j3n95IDgofC9GviXP111Skx6NOt2d20U8e\")\nnetwork = my_ng.parse(page_id=\"856391c93ae64bd1b7ebf699ca0cd861\")\n# `network` is a `pyvis.network.Network` object, see more attributes: https://pyvis.readthedocs.io/en/latest/documentation.html\nnetwork.repulsion(node_distance=200, spring_length=200)\n# this line is for jupeter notebook only\nnetwork.prep_notebook()\n\nnetwork.show(\"graph.html\")\n```\n\n## Testing Environment\n\nThe testing page is [Notion-graph-view-demo](https://sund.notion.site/Notion-graph-view-Demo-856391c93ae64bd1b7ebf699ca0cd861). You can duplicate the page to your Notion account and run the project to test if everything goes well.\n\n## Development Guide\n\nThis project's dependencies are managed by [PDM](https://pdm.fming.dev/latest/).\n\n```shell\nbrew install pdm\npdm install\n```\n\nRunning the project by:\n\n```shell\npdm run start -p \u003cpage_id\u003e -t \u003cnotion_token\u003e -o ./graph_out.html\n```\n\n## 🔗 Supported Links\n\n|                    | database | page |\n| ------------------ | -------- | ---- |\n| paragraph          | ✔️       | ✔️   |\n| bulleted_list_item | ✔️       | ✔️   |\n| numbered_list_item | ✔️       | ✔️   |\n| to_do              | ✔️       | ✔️   |\n| toggle             | ✔️       | ✔️   |\n| child_page         | ✔️       | ✔️   |\n| child_database     | ✔️       | ✔️   |\n| embed              |          |      |\n| callout            | ✔️       | ✔️   |\n| quote              | ✔️       | ✔️   |\n| heading_1          | ✔️       | ✔️   |\n| heading_2          | ✔️       | ✔️   |\n| heading_3          | ✔️       | ✔️   |\n| column             | ✔️       | ✔️   |\n| column_list        | ✔️       | ✔️   |\n| synced_block       |          |      |\n| link_to_page       | ✔️       |  ✔️  |\n| table              | ✔️       | ✔️   |\n| table_row          | ✔️       | ✔️   |\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fstevedsun%2Fnotion-graph-view","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fstevedsun%2Fnotion-graph-view","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fstevedsun%2Fnotion-graph-view/lists"}