Skip to main content

Import markdown files to Notion

Project description

Notionfier: Import Markdown Pages to Notion.so

Fork of https://github.com/Arsenal591/notionfier

  • updated dependencies
  • published to PyPi
  • reformatted, updated python version

Import markdown files to Notion.so using its official API.

Requirments: Python >= 3.11.

Features

  • All markdown basic syntax.
  • Some markdown extended syntax:
    • Tables.
    • Code blocks.
    • Footnotes.
    • Definition lists.
    • Strikethrough.
    • Task lists.
    • Automatic URL Linking.

Usage

  • Firstly, follow the instruction to create an notion integration and share a page with the integration.

CLI

notionfier import -t={{YOUR NOTION TOKEN}} -pid={{PAGE ID}} -f={{FILE PATH}}

Programmatically

from notionfier import NotionPageBuilder

token = "TOKEN"
builder = NotionPageBuilder(token)

parent_page_id = "123"
name = "Import Markdown File"
content = "##Markdown!!!"

# For sync
builder.create_page(parent_page_id, name, content)

# For async
await builder.acreate_page(parent_page_id, name, content)

TODOs

  • Highlighting.
  • MathJax.
  • Support local image files.
  • Handle deeply (> 3 levels) nested children properly.
  • Deal with Notion API's request limits.
  • More tests on markdown extensions.

LICENSE

MIT License

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

notionfier-1.0.1.tar.gz (8.4 kB view hashes)

Uploaded Source

Built Distribution

notionfier-1.0.1-py3-none-any.whl (10.7 kB view hashes)

Uploaded Python 3

Supported by

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