{"id":26494009,"url":"https://github.com/dwarvesf/notion-export-markdown","last_synced_at":"2026-04-09T11:02:37.341Z","repository":{"id":205070475,"uuid":"713344384","full_name":"dwarvesf/notion-export-markdown","owner":"dwarvesf","description":"An internal tool we use to convert our Notion pages and databases into Markdown to be used with Obsidian.","archived":false,"fork":false,"pushed_at":"2023-11-17T17:57:47.000Z","size":24,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":3,"default_branch":"main","last_synced_at":"2023-11-17T18:46:04.061Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/dwarvesf.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null}},"created_at":"2023-11-02T10:32:52.000Z","updated_at":"2023-11-04T08:03:48.000Z","dependencies_parsed_at":"2023-11-17T18:53:36.531Z","dependency_job_id":null,"html_url":"https://github.com/dwarvesf/notion-export-markdown","commit_stats":null,"previous_names":["dwarvesf/notion-export-markdown"],"tags_count":0,"template":null,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dwarvesf%2Fnotion-export-markdown","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dwarvesf%2Fnotion-export-markdown/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dwarvesf%2Fnotion-export-markdown/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dwarvesf%2Fnotion-export-markdown/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/dwarvesf","download_url":"https://codeload.github.com/dwarvesf/notion-export-markdown/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":244591451,"owners_count":20477709,"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":[],"created_at":"2025-03-20T09:58:35.657Z","updated_at":"2025-12-30T21:51:25.516Z","avatar_url":"https://github.com/dwarvesf.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"## Notion Export Markdown\n\nThis is our internal tool to convert Notion pages to markdown. It is loosely based off of [notion4ever](https://github.com/MerkulovDaniil/notion4ever). Most of the code from notion4ever that is used to parse the Notion objects to markdown is kept as-is with some few tweaks.\n\n\n### Differences from notion4ever\n\n[notion4ever](https://github.com/MerkulovDaniil/notion4ever) mutates the `notion_content.json` file before structuring it with `notion_structured.json`. This allows it to process blocks, pages, and images simultaneously. However, this also means that it can only download blocks, pages, and databases one at a time, as it needs to update those files synchronously. This process can be quite slow for large Notion databases, such as our [memo](https://memo.d.foundation/1f6986deb0db47769ddd7e9012699740).\n\nAdditionally, Notion images have a one-hour expiration time as they are accessed through presigned URLs from Amazon's S3 storage. This means that even if we successfully download Notion metadata, it would be mostly unusable without those accompanying images.\n\nOur implementation simplifies a few things:\n- Everything is processed in memory and we just dump `page.json` and `blocks.json` files for reference.\n- We only update blocks to include nested pages/blocks to keep track of content\n- We do **parallel downloads** using `asyncio`\n- We **don't** download the images directly, and instead use the [`obsidian-local-images-plus`](https://github.com/Sergei-Korneev/obsidian-local-images-plus) extension on Obsidian to do that for us\n\n\n## Getting started\n\n[![Built with Devbox](https://jetpack.io/img/devbox/shield_galaxy.svg)](https://jetpack.io/devbox/docs/contributor-quickstart/)\n\nThis repository uses [devbox](https://www.jetpack.io/devbox/docs/) and [devcontainers](https://code.visualstudio.com/docs/devcontainers/containers) to manage dependencies and setup a common development environment. To get started with devbox, once installed, just run `devbox shell` and you should be up and running.\n\nWe recommend using Python 3.10 as versions after this do not support `asyncio` and `aiohttp` since there are no build support for `wheels`. Refer to [VSCode's developing inside a devcontainer](https://code.visualstudio.com/docs/devcontainers/containers) to get started with devcontainers, or you can also open it with [DevPod](https://devpod.sh/):\n\n[![Open in DevPod!](https://devpod.sh/assets/open-in-devpod.svg)](https://devpod.sh/open#https://github.com/dwarvesf/notion-export-markdown)\n\n### Exporting an example Notion Database:\n\nExport the `NOTION_TOKEN` environment variable in your current shell, or create a `.env` file with your token:\n\n```\nNOTION_TOKEN=...\n```\n\nThen we run the command on `parallel_n2md.py` and specify our output path (`-p`) and database ID (`-d`). The files will be built in the `build` folder.\n\nFor instance, we will output the markdown files in the `./build/memo/_markdown` folder with our [memo](https://memo.d.foundation/1f6986deb0db47769ddd7e9012699740) Notion page database ID being `1f6986deb0db47769ddd7e9012699740`\n\n```\npython parallel_n2md.py -p memo -d 1f6986deb0db47769ddd7e9012699740\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdwarvesf%2Fnotion-export-markdown","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdwarvesf%2Fnotion-export-markdown","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdwarvesf%2Fnotion-export-markdown/lists"}