/notion2md

Notion Markdown Exporter with Python Cli

Primary LanguagePythonMIT LicenseMIT

Notion2Md logo - an arrow pointing from "N" to "MD"


About Notion2Md

PyPI version

  • Notion Markdown Exporter using official notion api by notion-sdk-py

API Key(Token)

$ export NOTION_TOKEN="{your integration token key}"

Install

$ pip install notion2md

Usage: Shell Command

Terminal output of the notion2md -h command

  • Notion2md requires either id or url of the Notion page/block
  • Download option will download files/images in the path directory
notion2md --download -n post -p ~/MyBlog/content/posts -u https://notion.so/...
  • This command will generate "post.md" in your '~/MyBlog/content/posts' directory

Usage: Python

from notion2md.exporter import block_markdown_exporter, block_string_exporter

# block_markdown_exporter will make markdown file on your output path
block_markdown_exporter(id='...',path='...',download=True)

# block_string_exporter will return output as String type
md = block_string_exporter(id='...',path='...')

To-do

  • Download file object(image and files)
  • Table blocks
  • Synced Block
  • Page Exporter
  • Database Exporter
  • Child page
  • Column List and Column Blocks

Contribution

Please read Contribution Guide

Donation

If you think Notion2Md is helpful to you, you can support me here:

Buy Me A Coffee

License

MIT