notion2md is a Python CLI tool designed to export Notion pages, databases, and blocks into markdown files. It leverages the Notion API client to fetch content and convert it into a standard markdown format. The current version is 2.9.0, and the project has an active, though irregular, release cadence with recent updates.
pip install notion2mdVerified import paths — ran on the pinned version, not inferred.
The primary use case for notion2md is via its command-line interface. This quickstart demonstrates how to export a Notion page by setting the `NOTION_TOKEN` environment variable and executing the `notion2md` command with a page ID and an output directory. Ensure your Notion API token has the necessary read permissions.
Completely uninstall any old versions (`pip uninstall notion2md`) and reinstall (`pip install notion2md`). Review your code and CLI usage against the new documentation, as command-line arguments and internal APIs have changed.
Verify your Notion API token is correct and set in your environment (e.g., `export NOTION_TOKEN='secret_...'`). In Notion, go to 'Settings & members' -> 'Integrations', find your integration, and ensure it has access to the pages/databases by inviting it to them.
If you encounter unexpected errors, check the project's GitHub issues for recent reports and updates. Consider pinning `notion2md` to a specific version if you need stability in production and test updates carefully.
Test your specific Notion content before relying on the export for complex layouts. Manually review exported markdown files for fidelity and be aware of limitations for certain Notion block types.
No dependency data recorded yet.