Python script for importing iCloud notes via Gmail

Hi Joplin community!

I wanted to share a gist with a python script but I'm not allowed to share links, what an anticlimax. I'll try an ugly one.

I just switched over all my note taking to Joplin and I love it. Previously I've used Evernote, but lately just the iOS built-in notes app. What a disappointment when I found that Notes only does PDF exports. I couldn't find any good way to do it, but then saw that you can sync notes to Gmail.

So here's my approach, a multi-step process with a python script at the end.

It's not perfect, Apple jumbles some notes in the sync with Gmail, but it worked for me.
I hope it can be of help to someone else.

  1. Add notes sync to you gmail connection, giving you a Gmail section in the app.
  2. Copy all your note folders into that Gmail space in Notes. Probably should be done on a computer.
  3. Wait for all the notes to sync to Gmail.
  4. Download all emails tagged with Notes with takeout[dot]google[dot]com
  5. For each of the resulting mbox files, run this script with modified name and prefix.
  6. Import the markdown folder (with front matter) into Joplin.
  7. Note freedom!

Just to make it easier to follow your link:

1 Like

Hi Johan!

Thanks for your script and the export workflow. iCloud / Apple notes are notorious for its unintuitive and lossy export capabilities. A while ago I tried to summarise the main methods to do the deed.

Let me link the topic here real quick

Once again, thanks for your contribution and welcome to the community!

Thanks for your replies! I did search but never found your nice summary graphit0 before rolling my own solution. I also don't have an up-to-date Mac to use the exporter app. I just tried a data export from privacy dot apple dot com though, so I'll see what format they use in at most seven days.

A few days later, and my export is done. Unfortunately it's a dissapointing one - they've just converted everything to plain text files, all formatting gone and the images are in a separate folder for each note. My script, while not perfect, does a better job.

1 Like