from evernote.api.client import EvernoteClient
from evernote.edam.notestore.ttypes import NoteFilter, NotesMetadataResultSpec

class Evernote:
    def __init__(self):
        self.dev_token = "S=s1:U=9102a:E=15565f4827a:C=14e0e4352d0:P=1cd:A=en-devtoken:V=2:H=aaecb8b4f4bc389f6cca05b9855de859"
        self.client = EvernoteClient(token=self.dev_token)

    def listar_notes(self):
        note_store = self.client.get_note_store()
        filter = NoteFilter()
        filter.word = "notebook:Faculdade"
        spec = NotesMetadataResultSpec()
        spec.includeTitle = True
        all_notes = note_store.findNotesMetadata(self.dev_token, filter, 0, 10, spec)
        for note in all_notes.notes:
            print(note.title)
            conteudo = note_store.getNoteContent(note.guid)
            print(conteudo)

        # notebooks = note_store.listNotebooks()
        # notebook = notebooks[1]
        # notas = notebook.findNotesMetadata(self.dev_token, filter, 0, 4000, result_spec)
        # print(notas)
        



e = Evernote()
e.listar_notes()
