Skip to content

Instantly share code, notes, and snippets.

@bamanzi
Created July 16, 2012 09:32
Show Gist options
  • Star 3 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save bamanzi/3121820 to your computer and use it in GitHub Desktop.
Save bamanzi/3121820 to your computer and use it in GitHub Desktop.
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
Copy link

Thanks for that, very helpful!

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