Created
July 16, 2012 09:32
-
-
Save bamanzi/3121820 to your computer and use it in GitHub Desktop.
Extract notes' title & url from Evernote exported file (*.enex)
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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") |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Thanks for that, very helpful!