[SOLVED] Importing from Google Keep

@gme Maybe you want to add a new topic to the #apps category for your script.

It’s just a slightly modified version of the former one, I wouldn’t want to get the credit. But this post comes up as the first result on Google when people search for anything related to importing notes from Google Keep to Joplin. So I just wanted to add a better working(for my case at least) solution.

1 Like

yes! Importing from HTML would be a great and super useful feature!

1 Like

Unfortunately I can’t import the enex file created by the last version of the python program by @gme. Screenshot of the error message:

it seems something like an encryption error. Joplin crashes, too.

If anyone could help, I’d be very grateful!

@xplosionmind is there a reason why you take s screenshot of a terminal instead of copying the text directly and put it in a code block?

You know, I once asked a customer to send me the error message and I got a Word document with a screenshot of the terminal window cramped into half a page. All I needed was a few lines of text in an email. Especially since I didn’t have Word and needed to copy the error code number to search for it in a reference database. I can’t copy text from an image.

I’m sorry that you are the first one who I ask abut this, but it seems to get more and more common in this forum that people do this and I really would like to stop this behavior.

Sorry. Here it is:

Unhandled promise rejection Promise {
  <rejected> TypeError: Cannot read property 'encryption_applied' of undefined
      at arrayHasEncryptedItems (/usr/local/Cellar/joplin/1.0.150/libexec/lib/node_modules/joplin/lib/reducer.js:107:16)
      at stateHasEncryptedItems (/usr/local/Cellar/joplin/1.0.150/libexec/lib/node_modules/joplin/lib/reducer.js:115:6)
      at reducer (/usr/local/Cellar/joplin/1.0.150/libexec/lib/node_modules/joplin/lib/reducer.js:733:32)
      at reducer (/usr/local/Cellar/joplin/1.0.150/libexec/lib/node_modules/joplin/lib/BaseApplication.js:485:10)
      at dispatch (/usr/local/Cellar/joplin/1.0.150/libexec/lib/node_modules/joplin/node_modules/redux/lib/createStore.js:178:22)
      at Application.generalMiddleware (/usr/local/Cellar/joplin/1.0.150/libexec/lib/node_modules/joplin/lib/BaseApplication.js:387:18)
      at Function.dispatch (/usr/local/Cellar/joplin/1.0.150/libexec/lib/node_modules/joplin/lib/BaseApplication.js:324:16)
      at Function.addNote (/usr/local/Cellar/joplin/1.0.150/libexec/lib/node_modules/joplin/lib/models/Tag.js:69:8)
      at processTicksAndRejections (internal/process/task_queues.js:97:5)
      at async saveNoteTags (/usr/local/Cellar/joplin/1.0.150/libexec/lib/node_modules/joplin/lib/import-enex.js:114:3)
} reason: TypeError: Cannot read property 'encryption_applied' of undefined
    at arrayHasEncryptedItems (/usr/local/Cellar/joplin/1.0.150/libexec/lib/node_modules/joplin/lib/reducer.js:107:16)
    at stateHasEncryptedItems (/usr/local/Cellar/joplin/1.0.150/libexec/lib/node_modules/joplin/lib/reducer.js:115:6)
    at reducer (/usr/local/Cellar/joplin/1.0.150/libexec/lib/node_modules/joplin/lib/reducer.js:733:32)
    at reducer (/usr/local/Cellar/joplin/1.0.150/libexec/lib/node_modules/joplin/lib/BaseApplication.js:485:10)
    at dispatch (/usr/local/Cellar/joplin/1.0.150/libexec/lib/node_modules/joplin/node_modules/redux/lib/createStore.js:178:22)
    at Application.generalMiddleware (/usr/local/Cellar/joplin/1.0.150/libexec/lib/node_modules/joplin/lib/BaseApplication.js:387:18)
    at Function.dispatch (/usr/local/Cellar/joplin/1.0.150/libexec/lib/node_modules/joplin/lib/BaseApplication.js:324:16)
    at Function.addNote (/usr/local/Cellar/joplin/1.0.150/libexec/lib/node_modules/joplin/lib/models/Tag.js:69:8)
    at processTicksAndRejections (internal/process/task_queues.js:97:5)
    at async saveNoteTags (/usr/local/Cellar/joplin/1.0.150/libexec/lib/node_modules/joplin/lib/import-enex.js:114:3)

No worries and thank you, but in this case I actually just wanted to know why people choose to take a screeenshot of text. It’s just something I never understood.

This is a Joplin error, so it would be interesting to know if this still happens with the latest version. (It seems that you use version 1.0.150.)
On the other side, maybe the script passes either a null value to the API or something the API does not expect. Maybe @gme has an idea what the issue might be.

I installed Joplin with Homebrew, I just checked the update and it seems it’s the latest available.

Hmm, in that case, I need more information. Are you using the terminal or the desktop version? I really do not know why we even have brew as an option. It is always behind and always gives people some sort of trouble. (Not in your case, since you were able to install it.)

But back to the issue. What did you update? The script or Joplin? What happens, if you use the previous version of the script? Either way, I think @gme will have to chime in.

I updated both Joplin and the script.
I’m using Joplin on iTerm, I didn’t even know there is a desktop version.

Ok, 1.0.150 is the latest CLI version. Anyway, let’s see what @gme has to say.

1 Like

UPDATE: on the desktop version, everything works perfectly. Problem solved

If anyone is looking for a more automated solution try gkeepapi
I use it to back up my keep (not yet ready to fully switch to joplin – for small notes keep is much faster) and it works well.

1 Like

@seffyroff/@gme
I’ve expanded the original python script to handle importing image attachments from Google Keep as well. I’d love to share those changes with one of the forks if possible.
I’d also be interested in adapting the algorithm to incorporate it into Joplin officially using Electron!

@Leonard777 I’m interested in your changes. Could you please upload your version here as is, or if possible integrated into the script from post 8 in this thread by @gme? Either is fine, I can probably figure it out. TIA!

Sure can! Here you go. I’m talking to the original poster of the script from git labs here about contributing my changes along with several those of @gme.
Note, I added argparse logic so you can run -h to see the usage. I undid the default file export that gme did because I prefer to have the option of location and name. You can also pipe the output this way as with the original script so the API isn’t changed.
Just pulled in all my Keep notes with images today and it worked like a charm!

keep-to-enex.py (7.4 KB)

2 Likes

I confirmed that this code works with my 6.7 GB Keep collections with ~3800 items.

Note,

Dear @Leonard777, @gme, and all of Good People here,

thank you.

Renan

I will just post here few steps how to transfer Google Keep notes to Joplin on Windows for users that are not so familiar with "running scripts".

  1. Go to https://takeout.google.com/settings/takeout and request notes from Keep. Unzip downloaded file.
  2. Download python script from couple posts above
    For example that named keep20191210-to-enex6.1.py
    Copy that script directly to Keep folder unzipped in step 1.
  3. Download and install Python - for example Python 3.9.0 or newer
    https://www.python.org/downloads/windows/
  4. Start Windows command line - shortcut Win key + R and type "cmd" (Command Line). Type "cd 'path to unzipped Keep directory' ". For example "cd c:\Keep". The last line in the cmd window should start with that directory path.
  5. Run the script in that cmd window typing "py keep20191210-to-enex6.1.py" (or other name of the script). After that there should be keep.enex file in that directory ready to be imported in Joplin (File - Import - ENEX)

Note: script mentioned above is not able to transfer everything (for example pictures). So be careful and check if everything seems ok. See more above or in the first few lines in the script file.

Optional: If there is error in the step 4 about date/time you need to download and install library from
https://pypi.org/project/parsedatetime/ (for example parsedatetime-2.6-py3-none-any.whl). Using cmd from step 4 you need to type "pip install parsedatetime-2.6-py3-none-any.whl" in the directory where that library whl file is downloaded.

1 Like

If you are looking to convert from Google Keep to Evernote, so you can import to Joplin, I recommend getting the latest version of the python script from the gitlab repo as it now supports importing images.

NOTE: I has to use both the input path and output file name in order to get it to work properly for me on Ubuntu 20.04. (That is also noting that need for the parsedatetime module.)

Also I used the import Evernote as Markdown , because the following post said that makes the notes more editable.

Thank you for doing this!