Exports notes and lists from Google Keep and imports them into your Notion.
Supports exporting:
This script requires Python 3.9+, https://github.com/kiwiz/gkeepapi, https://github.com/ramnes/notion-sdk-py, and a couple more libraries to run. Install the pre-requisite libraries via Pip3:
pip3 install -r requirements.txt
Optional: make the script executable:
chmod +x gkeep2notion.py
In order to use the gkeepapi
dependency, you'll need to run it inside of a docker container that is compatible with it. Otherwise you'll most likely run into an "Authentication failed" error.
docker build -t gkeep2notion_image .
docker run -it --name gkeep2notion_container gkeep2notion_image /bin/bash
On some systems the authentication fails even with valid credentials. This may happen because of three reasons:
To fix the 2FA problem:
You need to create an app specific password for the script.
Select the app and device you want to generate the app password for.
section:
Other(Custom name)
from the Select app
dropdowngkeep2notion
and click on Generate
buttonTo fix the CAPTCHA problem:
Try using the Unlock CAPTCHA link before retrying login.
**To try fixing the SSL problem:***
Revert to an older version of the following library:
pip3 install requests==2.23.0
Before use, copy config.example.ini to config.ini and edit its contents. See configuration explanation below:
[gkeep]
email=your_name@gmail.com # Your Google account
import_notes=true # Set to false if you don't want to import notes
import_todos=true # Set to false if you don't want to import TODO lists
import_media=true # Set to false if you don't need to import images and audio
[notion]
token=Copy it from your Notion integratin # See documentation below
root_url=https://notion.so/PAGE-ID Create a root url in your Notion # See documentation below
The importer needs to access your Notion account and it needs to know the root URL in which to import all the Google Keep contents.
To get a Notion authentication token:
gkeep2notion
. As per Integration type, choose Internal integration. In the Capabilities make sure this integration can Read, Update, and Insert content.token
in your config.ini
.This script imports all the content under a certain page in Notion that has to exist already. It is recommended to create a special page for the imported content, and then migrate it to your regular Notion structure from there.
•••
button on top right of the page and select "Add Connections" (at the bottom) from the menu.root_url
in the config.ini.The first time you run gkeep2notion
it will ask for your Google Account's password to authenticate into your Google Keep account. After obtaining an authentication token, gkeep2notion
saves it in your system's keyring. Next time you won't need to enter the password again.
Note: export/import takes a considerable amount of time. Especially when working with notes containing media files. So you may want to try importing a subset of your records before importing everything.
By default gkeep2notion exports everything in your Google Keep account and imports it into Notion. It can be done as simple as:
./gkeep2notion.py
You can use the search function built into Google Keep to import notes matching a search query:
./gkeep2notion.py -q 'Orange apple'
You can import notes and tasklists containing specific label(s) in Google Keep using the -l
option.
An example with one label:
./gkeep2notion.py -l cooking
An example with multiple labels, comma separated:
./gkeep2notion.py -l 'work, business, management'
This tool uses the unofficial Google Keep API for Python by kiwiz. Google Keep is of course a registered trademark of Google and neither the API nor this script are affiliated with Google, Inc.
Thanks to ramnes for the unofficial Notion Python SDK. Neither that API nor this script are affiliated with Notion. Notion is a trademark of Notion Labs, Inc.