Plugin idea: Metadata-preserving Evernote import via ENEX

Hi all, this is not a feature request. Instead, I’m thinking about writing a plugin and I’d like to understand market demand and the parameter space a little better.

TL; DR: If you think it’d be good to import large amounts of Evernote data incl metadata, give this thread a like. Reply with more thoughts.

Motivation

The new Evernote version is annoying me so much that I’m considering a complete migration. This is not quite trivial since, as of today, I have 4762 notes spread across 122 notebooks and 53 tags.

It is particularly important to me that metadata (creation/modification date, source url, tags, …) is preserved, since I’m storing important information in metadata.

As far as I’m aware, the current route via HTML does not preserve that metadata. This is not Inkdrop’s fault but rather, it’s because Evernote stores that in a format that’s easily readable for humans, but less so for machines.

Unrelatedly, the HTML importer also has a tendency to crash on me and I’m wondering about performance when one imports are huge number of files.

Idea

Evernote’s native ENEX format is an XML format that is specifically made to export Evernote data to other applications, including machine-readable metadata. An arbitrary number of notes can be stored in one file, and this can be done very quickly.

The content of an Evernote note is basically HTML spiced up with some Evernote-specific tags.

I’m wondering if ENEX would provide a viable route to import from Evernote including metadata. It would basically go like this:

  1. Iterate the ENEX file and for each note (<en-export> tag) …
  2. Extract the metadata from tags and…
  3. Convert the note content to markdown, extracting and linking all images (this is nontrivial as images are stored using a combination of <en-media hash="…"> and <resource> elements)
  4. Ignore whatever can’t be converted (file attachments, too weird embedded HTML etc.)

There are already two projects that appear to have already done much of the heavy lifting for part 3 and 4 (I haven’t tested these yet):

Limitation

ENEX does not store each note’s notebook for some reason, so we’d have to export notebook-by-notebook.

For me personally this is not a big issue since I wanted to streamline my notebook system anyways.

Request for Comment

Perhaps you have a comment on:

  1. Is this going to be useful for many people? I might just do it for myself if it’s not too hard, but it’s even better when many people benefit.
  2. Any pitfalls I’m overlooking? Have you worked before with the ENEX format? Is it a terrible mess? You think it’s worth it?
  3. An alternative route might be to use Evernote’s API. Any experience with this?
  4. Any suggestions how I might go about this are appreciated. Can you point me to any hard/easy sub-problems?

Cheers!

3 Likes

I have the exact same problem.
For the time being, I’m migrating important notes “manually” as needed, but it’s a lot of work.

I don’t have any knowledge of NENX, etc., but I’m really rooting for you to make it happen.

I am hoping that it will be easier to migrate metadata, especially tags and note creation dates, and images.

I would like to avoid duplicating notes that have already been migrated, but I guess this can be done by excluding them when exporting ENEX.

It would be nice if the note name is output to the log when processing notes that contain Evernote application links or attachments that cannot be migrated.

The Inkdrop’s built-in import plugin would be helpful to build this:

Unrelatedly, the HTML importer also has a tendency to crash on me and I’m wondering about performance when one imports are huge number of files.

Ah, I didn’t test it with a huge number of files.
It just loops importing each file.
Maybe there is a memory leak or something in Electron.

I wrote an Evernote ENEX parser about 10 years ago IIRC. The only tricky thing I remember was the resource issue you mention. I think this more of a design exercise of mapping what you have in ENEX to what you want in Inkdrop, making it harder to write a plugin that pleases everyone. Still I think this doable and worth doing as a fellow hater of Evernote.

1 Like

Ok, thanks a lot for your feedback & hints. Looks like I should give this a try.

2 Likes

Hey guys, sorry to let you down, but I’ve changed my notetaking style so that this is not going to be a priority for me anytime soon.

FWIW, I’ve settled with something even more bare-bones, basically just markdown files in a folder, where existing ENEX exporters do a reasonable job.