Skip to content

Instantly share code, notes, and snippets.

@Kwpolska
Created January 26, 2015 14:45
Show Gist options
  • Save Kwpolska/4c39421d125ae63868fe to your computer and use it in GitHub Desktop.
Save Kwpolska/4c39421d125ae63868fe to your computer and use it in GitHub Desktop.
Evernote Note Mover

This is some code that I intended to use to manage my Evernote workflow, but then decided a saved search (reminderDoneTime:*) is easier.

Fill in auth_token (that is, implement OAuth), APGuid (source notebook) and CTGuid (destination notebook). Figure out GUIDs using the two _nl lines.

All notes with a Done reminder in the APGuid notebook are moved to the CTGuid notebook.

import evernote.edam.userstore.constants as UserStoreConstants
from evernote.edam.notestore.ttypes import NoteFilter, NotesMetadataResultSpec
from evernote.api.client import EvernoteClient
auth_token = ''
APGuid = ''
CTGuid = ''
APFilter = NoteFilter(words='reminderDoneTime:*', notebookGuid=APGuid)
client = EvernoteClient(token=auth_token, sandbox=True)
user_store = client.get_user_store()
note_store = client.get_note_store()
#_nl = note_store.listNotebooks()
#for i in _nl: print(i.guid, i.name)
result_spec = NotesMetadataResultSpec(includeTitle=True)
result_list = note_store.findNotesMetadata(auth_token, APFilter, 0, 100, result_spec)
for nd in result_list.notes:
no = note_store.getNote(auth_token, nd.guid, True, True, True, True)
no.notebookGuid = CTGuid
note_store.updateNote(auth_token, no)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment