The evernote software gives option to export notebook into .enex file. This can be parsed to get the recognized text and its location in the image. (As shown in http://blog.evernote.com/tech/2013/07/18/how-evernotes-image-recognition-works/) Now I want to get this recognized text through Evernote's python SDK. Here's what I have done till now:
Created a notebook in https://sandbox.evernote.com I am able to search for text in the note from the browser.
Created a dev token for accessing this notebook.
I am able to iterate over my notebooks and get their guid. And using that able to access note inside the notebooks.
notebooks = self.noteStore.listNotebooks() print "Notebooks:" for notebook in notebooks: print notebook.name, notebook.guid # display notes in the notebook print self.noteStore.findNoteCounts(self.dev_token, NoteFilter(notebookGuid=notebook.guid), True) spec = NotesMetadataResultSpec(includeTitle=True) # The following provides the note guid print self.noteStore.findNotesMetadata(self.dev_token, NoteFilter(notebookGuid=notebook.guid), 0, 10, spec)`
- But I am not able to access the recognized text in the note. Tried:
note = self.noteStore.getNote(self.dev_token, note_guid, False, True, True, True) for r in note.resources: print "resource guid: ", r.guid resource = self.noteStore.getResource(r.guid, True, False, True, False) print resource.data.body
Also tried(as mentioned in How to Access A Note's Content):
noteContent = self.noteStore.getNoteContent(self.dev_token, note_guid)
print noteContent
This gives something like this:
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE en-note SYSTEM "http://xml.evernote.com/pub/enml2.dtd">
<en-note><div><br clear="none"/></div><br/><en-media hash="dhhd2e240c83140sjskca0bf6e8c9661fd1c3472" type="image/jpeg"/></en-note>
But in http://dev.evernote.com/doc/articles/image_recognition.php recoExample.py is able to extract the recognized text. Only difference between that and mine is I am running on sandbox environment.
What should I do to get the recognized text?