to Evernote migration

I have been using catch notes for the past 2 years. When I knew the news about catch notes shutting down “Catch will no longer be available after 30 August 2013.”, I started looking for alternatives. One of the best alternative is evernote. Though I have tried few years ago, but I havent used it effectively.

As per the above URL, exported my notes from

Though the exported data contains enex file to import into Evernote. It does not automatically add the pictures and tags.

As I had only few pictures in my notes, I manually added it to the notes in Evernote. But I had around 800 notes, I dont want to tag each and every note manually. So I wrote a simple python script to convert all the #tag to evernote tags.

Check the gist at

from evernote.api.client import NoteStore
from evernote.api.client import EvernoteClient

#Get your dev token from the following URL

dev_token = "<your api token>"
client = EvernoteClient(token=dev_token, sandbox=False)
noteStore = client.get_note_store()

filter = NoteStore.NoteFilter()

#Find the guid of your catch notebook, by selecting the catch notebook and see the URL
filter.notebookGuid = "<catch_notebook_guid>"

spec = NoteStore.NotesMetadataResultSpec()
spec.includeTitle = True
spec.includeTagGuids = True

index = 0
while True:
    noteList = noteStore.findNotesMetadata( dev_token, filter, index, 50, spec)
    for note in noteList.notes:
        index = index + 1
        if (note.tagGuids != None and len(note.tagGuids) > 0):
            print "already tags present, so skipping...."
            print "--------------[" + str(index) + "]"

        note = noteStore.getNote(dev_token, note.guid, True, True, True, True)
        content = note.content
        print 'Title:', note.title,
        print 'Content:', content
        print "--------------[" + str(index) + "]"
        titlecontent = note.title + " " + content

        #Remove HTML tags
        titlecontent = re.sub('<[^<]+?>', ' ', titlecontent)

        #get tags
        tags = [word for word in titlecontent.split() if word.startswith('#') and len(word) > 1]

        #remove unwanted characters
        tags = [word.strip(" #;.,").lower() for word in tags ]
        tags = [word.split()[0] for word in tags if len(word.split()) > 0 ]
        tags = [word.strip(" #;.,") for word in tags if len(word.strip(" #;.,")) > 0 ]

        #remove duplicate tags
        tags_set = set(tags)
        tags = list(tags_set)

        #Add tags only if the actual note does not contain tags
        if len(tags) > 0 and (note.tagNames == None or len(note.tagNames) == 0):
            print "[" + str(index) + "]###########" + str(tags)
            note.tagNames = tags
            noteStore.updateNote(dev_token, note)

    if noteList.totalNotes <= index:
    print "FETCHING NEXT PAGE======================="
This entry was posted in python and tagged , . Bookmark the permalink.

7 Responses to to Evernote migration

Leave a Reply

Your email address will not be published. Required fields are marked *