Skip to content

Instantly share code, notes, and snippets.

@bamanzi
Created Jul 16, 2012
Embed
What would you like to do?
Extract notes' title & url from Evernote exported file (*.enex)
from lxml import etree
def enex_list_notes_info(enex_file_name):
f = file(enex_file_name, "r")
enex = etree.parse(f)
notes = enex.xpath("//note")
for note in notes:
title = url = ""
etitle = note.xpath("title")
if len(etitle)>0:
title = etitle[0].text
eurl = note.xpath("note-attributes/source-url")
if len(eurl)>0:
url = eurl[0].text
print(" - [[%(url)s][%(title)s]]" % locals())
enex_list_notes_info("emacs-2evernote.enex")
@michaellenaghan

This comment has been minimized.

Copy link

@michaellenaghan michaellenaghan commented Jun 17, 2021

Thanks for that, very helpful!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment