This tool can accurately convert HTML to Notion notes and is also useful for exporting Evernote notes to Notion.
Project description
html2notion is a very useful Python library that allows you to import content from HTML documents into Notion notes, making it easier for you to organize information on the Notion platform. In addition, because html2notion is compatible with Evernote, you can also use it to export notes from Evernote to Notion.
The html2notion library is very powerful and supports converting HTML files to various elements in Notion, such as text blocks, headings, images, code blocks, and more. These elements can be arranged and edited freely in Notion, which is very convenient.
If you are looking for a way to better manage your notes and information and want to use the Notion platform, then the html2notion library is a great choice. You just need to install it and you can start converting HTML documents to Notion notes.
Installation
- First, you need to install the html2notion library in your Python environment. You can use the pip command to install it:
pip install html2notion
Usage
Get Notion parameters
To get a Notion API key, follow these steps:
- Log in to Notion. If you don't have a Notion account yet, please register one first.
- Go to the Notion Developer page.
- Click "My integrations".
- Click "New integration".
- Enter a name and click "Submit".
- Click "Add a client secret".
- Copy the generated API key to your code.
To authorize a Notion API key to access a database, follow these steps:
- Go to the database you want to share with the API key.
- Click the three dots next to the database name.
- Now your API key will be able to access this database.
Note that in order for an API key to access a database, you must first add it as an integration to Notion. To add an integration, go to the Notion Developer page and follow the instructions. For more information, see Notion's API documentation: Notion API Docs.
To get the ID of a Notion database, follow these steps:
- Go to the Notion database you want to import HTML into.
- Click the three dots next to the database name.
- Select "Properties".
- Hover over the column where you want to import HTML and click the three dots next to the column name.
- Click "Property settings".
- Copy the database ID to your code.
Tencent Cloud COS key
Evernote migration
If you want to import notes from Evernote into Notion, you can use Evernote's export function to export notes as HTML files and then use the above command to import them into Notion.
Supported HTML elements
The following is a list of HTML elements supported by html2notion:
p
h1
,h2
,h3
,h4
,h5
,h6
ul
,ol
li
a
img
code
blockquote
hr
br
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 improvement suggestions, please do not hesitate to submit a pull request or issue. We are happy to accept your contributions and feedback!
License
This project uses the MIT license. Please refer to the LICENSE file for details.
Project details
Release history Release notifications | RSS feed
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
File details
Details for the file html2notion-0.1.0.tar.gz
.
File metadata
- Download URL: html2notion-0.1.0.tar.gz
- Upload date:
- Size: 20.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.11.2
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | f0d9c22704ef22ea69b3ca1e3f81675f5f0fc5b90f0fefbd221b3b9833343198 |
|
MD5 | b1b607c616d5cedafef74b9ef73d1cb6 |
|
BLAKE2b-256 | 85b1c4d8f569e74e772c3c843145cd326af30839ef3f9486a25d880f5c13262f |
File details
Details for the file html2notion-0.1.0-py3-none-any.whl
.
File metadata
- Download URL: html2notion-0.1.0-py3-none-any.whl
- Upload date:
- Size: 20.1 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.11.2
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 9719d85d660242e20a77b8a9d7d83b50dc039533575d0e1d176450eff6f2758e |
|
MD5 | 4b50cd96f985e1797ed102d98956ba03 |
|
BLAKE2b-256 | 22713d882d384941fdd4f743fd4d468c467d44ac840f109aa0ec673129e45892 |