Skip to main content

A Python package for Notion API: Markdown to Notion uploader with full-featured support powered by Mistune.

Project description

NotionIt

PyPI PyPI - Downloads

Markdown to Notion uploader powered by Mistune. It supports rich Markdown, math, tables, files, images, and duplicate-title handling.

TLDR

pip install notionit
notionit

notionit shows the setup steps and checks whether the required Notion settings are visible.

$env:NOTION_TOKEN="YOUR_NOTION_INTEGRATION_SECRET"
$env:NOTION_PARENT_PAGE_ID="YOUR_PAGE_ID"
notionit status
notionit upload path/to/file.md

You can also pass the required values directly.

notionit upload path/to/file.md --token YOUR_NOTION_TOKEN --parent-page-id YOUR_PAGE_ID

What You Need

NotionIt needs a Notion integration secret and a parent page ID.

Setting Required Default
NOTION_TOKEN yes
NOTION_PARENT_PAGE_ID yes
NOTION_BASE_URL no https://api.notion.com/v1
NOTION_API_VERSION no 2026-03-11
NOTION_PARSER_PLUGINS no built-in Markdown plugin list

notionit status checks local environment variables only. It does not verify the token with Notion.

CLI

notionit setup
notionit status
notionit upload notes.md
notionit upload notes.md --page-title "My Notes"
notionit upload notes.md --duplicate-strategy timestamp
notionit upload notes.md --debug

Useful aliases are also supported: --parent for --parent-page-id, --title for --page-title, and --duplicate for --duplicate-strategy.

Run notionit upload --help for all options.

Python API

from notionit import quick_upload

quick_upload(
    file_path="example.md",
    token="secret_abc123",
    parent_page_id="notion_page_id",
)

Markdown Support

NotionIt supports common Mistune-powered Markdown features, including code blocks, tables, task lists, strikethrough, footnotes, inline and block math, file/image attachments, and invalid anchor-link skipping.

Default parser plugins are strikethrough, mark, insert, subscript, superscript, footnotes, table, task_lists, def_list, abbr, ruby, and notionit.math_plugin.notion_math.

Customize parser plugins with --plugins or NOTION_PARSER_PLUGINS.

Development

uv run --group dev pytest
uv run --group dev pyright
uv run --group dev ruff check .

Live Notion API tests are skipped by default because they create a temporary page in your workspace and then move it to trash with in_trash.

$env:NOTIONIT_LIVE_TEST="1"
$env:NOTION_TOKEN="YOUR_NOTION_INTEGRATION_SECRET"
$env:NOTION_PARENT_PAGE_ID="YOUR_PAGE_ID"
uv run --group dev pytest -m live

License

MIT

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

notionit-0.2.0.tar.gz (26.3 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

notionit-0.2.0-py3-none-any.whl (25.8 kB view details)

Uploaded Python 3

File details

Details for the file notionit-0.2.0.tar.gz.

File metadata

  • Download URL: notionit-0.2.0.tar.gz
  • Upload date:
  • Size: 26.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.9.28 {"installer":{"name":"uv","version":"0.9.28","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":null,"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

File hashes

Hashes for notionit-0.2.0.tar.gz
Algorithm Hash digest
SHA256 da6e532a4dbd2ffb8ada5a8a5f1f51d54c229611a4447b9d93c274a7ca819c57
MD5 1561cdbcb3bc3a52f94ed3d5f0235728
BLAKE2b-256 ea3bf0a17d8374990874425e7e1c257b8841ca7c417ae7d710111ee3725ff92c

See more details on using hashes here.

File details

Details for the file notionit-0.2.0-py3-none-any.whl.

File metadata

  • Download URL: notionit-0.2.0-py3-none-any.whl
  • Upload date:
  • Size: 25.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.9.28 {"installer":{"name":"uv","version":"0.9.28","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":null,"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

File hashes

Hashes for notionit-0.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 de8e5de1ed96e32708eb9a8d87a87ab1930a0c76f62ec27eef0b1f9113100a7d
MD5 5cea8ac522563796a7de9a5290f372a3
BLAKE2b-256 b69a3fb268b7e2acb3171aa50e33706a6deb29b18adf788460d825c4d2251ca6

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page