notion-to-md-py
A package to convert Notion content into Markdown format
What it is and what it does
notion-to-md-py is a Python wrapper around the Notion API that extracts page content and converts it to Markdown format. It provides both synchronous and asynchronous interfaces, allowing you to export individual Notion pages or build batch export workflows. The package handles the translation of Notion's block-based content model into standard Markdown, making it useful for archiving, backing up, or migrating Notion content to Markdown-based systems.
The package depends on notion-client for API communication, httpx for HTTP requests, and pytablewriter for rendering Notion tables as Markdown. It requires a valid Notion API token and appropriate sharing permissions on the pages you want to export. The tool is limited by what the Notion API exposes—file downloads other than images are not supported, and complex Notion features may not translate perfectly to Markdown.
Use it for:
- Back up Notion pages as Markdown files for version control or offline storage.
- Migrate Notion documentation to a static site generator or Markdown-based wiki.
- Batch export database records from Notion into individual Markdown files for processing.
- Automate Notion-to-Markdown workflows in CI/CD pipelines using the async interface.
- Convert Notion meeting notes or project pages into shareable Markdown documents.
Worth the install?
AI-flagged interpretation of the facts on this page — verify before relying
Converts Notion pages to Markdown files via the Notion API, supporting both synchronous and asynchronous workflows.
Yes. The package is actively maintained, has no known vulnerabilities, low install friction, and solves a specific problem—exporting Notion content to Markdown—that has no obvious built-in alternative. The MIT license is permissive. Install it if you regularly need to extract Notion pages as Markdown; skip it if you only export occasionally or need features the Notion API doesn't support.
Install
notion-to-md-py on PyPI
pip
pip install notion-to-md-pyuv
uv add notion-to-md-pypoetry
poetry add notion-to-md-pyInstalling notion-to-md-py
Before you install
Low install friction with a pure-Python wheel distribution. Actively maintained with recent commits; last release was 95 days ago. Depends on httpx, pytablewriter, and notion-client, all standard packages.
License in practice
Licensed under MIT (permissive), imposing no restrictions on use, modification, or distribution in your own projects.
Quickstart
pip install notion-to-md-py
from notion_client import Client
from notion_to_md import NotionToMarkdown
notion = Client(auth="your-auth-token")
n2m = NotionToMarkdown(notion)
md_blocks = n2m.page_to_markdown("page-id")
md_str = n2m.to_markdown_string(md_blocks).get('parent')
with open("output.md", "w") as f:
f.write(md_str)
Requires a Notion API key and appropriate permissions; the Notion API limits what content types and features can be exported.
Verify before relying
- Whether embedded content types beyond images are handled or silently dropped during conversion.
- Performance characteristics when exporting large Notion workspaces or deeply nested page hierarchies.
- Fidelity of Markdown output for complex Notion formatting (e.g., database properties, synced blocks, advanced layouts).
Package facts
| License | not declared (permissive) |
| Python support | supports the current Python release (>=3.7) |
| Install friction | low — pure-Python wheel |
| Runtime dependencies | 3 — httpx, pytablewriter, notion-client |
| Maintenance | actively maintained — 95 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 133,144/month — #11,527 on PyPI (30-day window, as of 2026-08-14) |
| Known vulnerabilities | none known (OSV.dev, checked 2026-08-14) |
Evidence: notion_to_md_py-0.1.5-py3-none-any.whl
Keywords: notion, markdown, converter, python
Tags
More Markup packages
PyYAML parses and emits YAML 1.1 data format,…
permissive · top 100 on PyPI
markdown-it-pyA Python markdown parser that converts markdown…
permissive · top 100 on PyPI
beautifulsoup4Beautiful Soup parses HTML and XML documents…
permissive · top 100 on PyPI
et-xmlfileet_xmlfile writes large XML files with minimal…
permissive · top 1,000 on PyPI
tomlkitParses and edits TOML files while preserving…
permissive · top 1,000 on PyPI
docstring-parserParses Python docstrings in ReST, Google,…
permissive · top 1,000 on PyPI
notion-clientA Python client library for the official Notion…
permissive · top 5,000 on PyPI
notion2mdExports Notion pages and blocks to Markdown…
permissive · top 15,000 on PyPI
notionUnofficial Python client for Notion.so API v3…
permissive · top 5,000 on PyPI
md2pdfConverts Markdown files to PDF with custom CSS…
permissive · top 15,000 on PyPI
markdownifyConverts HTML to Markdown, with fine-grained…
permissive · top 1,000 on PyPI
md2SlackConverts Markdown syntax into Slack-compatible…
permissive · top 15,000 on PyPI
sphinx_mdincludeSphinx extension that lets you include and…
permissive · top 15,000 on PyPI
mdformat-blackA plugin for mdformat that automatically…
permissive · top 15,000 on PyPI
markdown2Converts Markdown text to HTML using a fast,…
permissive · top 5,000 on PyPI
strip-markdownConverts markdown text to plain text, removing…
permissive · top 15,000 on PyPI