1

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:

  1. Created a notebook in https://sandbox.evernote.com I am able to search for text in the note from the browser.

  2. Created a dev token for accessing this notebook.

  3. 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)`
    
    1. 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?

Kaushik Acharya
  • 1,520
  • 2
  • 16
  • 25
  • 1
    Where do you want to use this recognition data? Note that Evernote already uses this recognition data for searching, and all external uses of recognition data are prohibited by [Evernote API License Agreement](https://dev.evernote.com/doc/reference/api_license.php), see item 1.8.10 of that document. – Igor Afanasyev Apr 10 '18 at 15:41
  • 1
    @IgorAfanasyev So the recoExample.py mentioned in http://dev.evernote.com/doc/articles/image_recognition.php is not for public usage? – Kaushik Acharya Apr 10 '18 at 19:08
  • 1
    This example is provided to explain how the recognition data is stored. This data can be used legally to e.g. implement local search or search highlighting in images within third-party Evernote clients. But you can't use this recognition data by itself. That's why I asked about the intended use of recognition data. – Igor Afanasyev Apr 15 '18 at 05:22

0 Answers0