A Python package for Notion API: Markdown to Notion uploader with full-featured support powered by Mistune.
Project description
NotionIt
Markdown to Notion uploader with full-featured support powered by Mistune.
Upload rich, formatted Markdown files—including equations, code, tables, and attachments—directly to Notion with ease.
✨ Features
- ✅ Full Markdown Support via Mistune
- 📤 Upload to Notion using official API
- 📎 File & Image Attachment Support
- 🔗 Skips invalid links like anchors
- 📐 LaTeX Math Block Rendering
- 🧩 Plugin-based Parsing (supports strikethrough, footnotes, task lists, etc.)
- 📄 Table-to-Block Conversion
- 🧠 Smart Title Conflict Handling (
timestamp,counter,ask,skip) - 🛠️ Debug Mode for Development
🚀 Quick Start
pip install notionit
Then run:
notionit upload path/to/file.md --token YOUR_NOTION_TOKEN --parent-page-id YOUR_PAGE_ID
You'll see an animated progress bar showing upload percentage and remaining time.
Or use the convenience function in Python:
from notionit import quick_upload
quick_upload(
file_path="example.md",
token="secret_abc123",
parent_page_id="notion_page_id",
)
🧩 Plugin Support
Default enabled plugins:
strikethroughmarkinsertsubscriptsuperscriptfootnotestabletask_listsdef_listabbrrubymath(vianotionit.math_plugin.notion_mathfor single-line $$ and list support)
Customize them via --plugins or programmatically.
🛡️ Environment Variables
Optionally configure via environment variables:
| Variable | Description |
|---|---|
NOTION_TOKEN |
Notion integration token |
NOTION_PARENT_PAGE_ID |
Parent page ID |
NOTION_BASE_URL |
API base (default: https://api.notion.com/v1) |
NOTION_API_VERSION |
API version (default: 2022-06-28) |
NOTION_PARSER_PLUGINS |
Comma-separated plugin list |
📦 CLI Options
Run notionit --help for full options:
notionit upload example.md \
--page-title "My Notes" \
--duplicate-strategy timestamp \
--debug
During uploads, the CLI reports progress with a spinner and estimated remaining time.
🧠 Use Case Ideas
- Publish lecture notes with math equations
- Upload tech blogs with code snippets
- Back up documentation in Notion
- Convert Markdown meeting notes into Notion pages
📃 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
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file notionit-0.1.3.tar.gz.
File metadata
- Download URL: notionit-0.1.3.tar.gz
- Upload date:
- Size: 22.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.7.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
2e4511ba66e269de10d8dd2cf872d5365a07aeb1c2b419ef27e8a8c348da143b
|
|
| MD5 |
efe66a64c0cb7e83016cb1e3c078761e
|
|
| BLAKE2b-256 |
82ff1297071a4d23f06c4abfdd81c305a8ab776d2a855d9b2f87cdd1c3ad6a7e
|
File details
Details for the file notionit-0.1.3-py3-none-any.whl.
File metadata
- Download URL: notionit-0.1.3-py3-none-any.whl
- Upload date:
- Size: 23.8 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.7.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
83f7e25d113bd749e28b050df91c99053c9a9d0c62c640bfd87deba2c5bb5d0e
|
|
| MD5 |
5ba04141c91b4c4d7948db9570bd15ce
|
|
| BLAKE2b-256 |
74923bf21324753dcdc847ce9000d32f4cc4bc7514b7de2536e4f7c9bd6585a9
|