Skip to main content

This tool can accurately convert HTML to Notion notes and is also useful for exporting Evernote notes to Notion.

Project description

简体中文

html2notion is an incredibly useful tool written in Python, which allows you to import content from HTML documents into Notion notes, making it more convenient for you to organize information on the Notion platform. In addition, html2notion has been specifically optimized for the content of Evernote, and you can also use it to import notes from Evernote into Notion.

html2notion has powerful features and supports converting various tags in HTML files into corresponding Blocks in Notion, such as rich text blocks, headings, images, code blocks, quotes, links, etc. Below are examples of converting notes from Evernote into Notion pages.

yinxiang notion(simple demos)

yinxiang notion2(rich text)

Prepare

You only need 3 steps to use htmlnotion to import HTML into Notion.

Duplicate database

Click the link notion template. As shown in the image below, use the "Duplicate" button to copy a new database to your own Notion workspace.

notion template

Install html2notion

Requires python>=3.8, install the html2notion library. You can use the pip command to install it:

pip install html2notion

Prepare Notion Configuration

We need to use the Notion API key and Database ID to authorize html2notion to access the Notion database. Please follow these steps:

  1. Create an integration;
  2. Share a database with your integration;
  3. Export the database ID;

When sharing the database here, you need to choose the previously duplicated database because the import operation requires some preset properties information in this database.

For specific methods, please refer to the Notion official documentation create an integration.

After the setup is complete, write your API Key and database ID into a configuration file config.json.

{
    "notion": {
        "database_id": "<***demo***>",
        "api_key": "<***demo***>"
    }
}

Usage

You can use html2notion -h to view detailed help documentation.

usage: html2notion [-h] --conf CONF [--log LOG] [--batch BATCH] (--file FILE | --dir DIR)

Html2notion: Save HTML to your Notion notes quickly and easily, while keeping the original format as much as possible

options:
  -h, --help     show this help message and exit
  --conf CONF    conf file path
  --log LOG      log direct path
  --batch BATCH  batch save concurrent limit
  --file FILE    Save single html file to notion
  --dir DIR      Save all html files in the dir to notion

For example, if you want to import all html files in the ./demos directory into Notion, you can use the following command:

html2notion --conf config.json --dir ./demos --log ~/logs --batch 10

The above command will import all html files in the ./demos directory into Notion, while outputting logs to the ~/logs directory, with up to 10 concurrent tasks.

More information

You can find more information and examples in the html2notion library's Issue: html2notion

Contribution

If you find any errors or have any suggestions for improvement, please do not hesitate to submit a pull request or raise an issue, I am more than happy to accept your contributions and feedback!

If you encounter import failures, you can submit the html file and log file together in the issue for easier problem identification.

If there are any private information in the files, please remove it first.

License

This project uses the MIT license. Please refer to the LICENSE for details.

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

html2notion-0.1.2.tar.gz (21.4 kB view details)

Uploaded Source

Built Distribution

html2notion-0.1.2-py3-none-any.whl (20.4 kB view details)

Uploaded Python 3

File details

Details for the file html2notion-0.1.2.tar.gz.

File metadata

  • Download URL: html2notion-0.1.2.tar.gz
  • Upload date:
  • Size: 21.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.11.0

File hashes

Hashes for html2notion-0.1.2.tar.gz
Algorithm Hash digest
SHA256 6793e4a6b19759ed1bba7de8af1152cb9564733f1d21770dbd65ed02db7f17b9
MD5 2cef0a23d183edb29292edc86313d4ab
BLAKE2b-256 1ef988592f4133391ef285f9c86232001f726d24f4db402bcd5ed1c1953d0d55

See more details on using hashes here.

File details

Details for the file html2notion-0.1.2-py3-none-any.whl.

File metadata

  • Download URL: html2notion-0.1.2-py3-none-any.whl
  • Upload date:
  • Size: 20.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.11.0

File hashes

Hashes for html2notion-0.1.2-py3-none-any.whl
Algorithm Hash digest
SHA256 d8b71eaf34c0fdd282f4c195ffb2b1dace1e6ec7a4746a5de166ccaee1b1de05
MD5 763ba3365edf2fcf02ce756a49a9740e
BLAKE2b-256 e26a6f9e58bd06c7aab5bcef9f08e280ff0ae3367712d795857039ab6cd88220

See more details on using hashes here.

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