Evernote is one of those programs that I had heard a lot about peripherally over the years but never really dived in to explore it myself. The pile of documents in my Dropbox account however was beginning to get a bit unwieldy, and the traditional file system model just wouldn’t allow me to make the additional links of logic that keywording organization could, so I thought I would finally take a look.
So far I have enjoyed the new-to-me ecosystem, and have made the move to consolidate a few of my other accounts into my Evernote one. Springpad in particular seems to be one that people are having problems migrating over.
I have written a Python script that saved me and a friend some time, and maybe it can save some of you some time as well. It’s not perfect, and it takes some organization/editing once everything is imported to Evernote (due to different APIs), but it is a good starting point.
#!/bin/python import re def writeNote(noteSubjectParam): origParam = noteSubjectParam for ch in ':;/\\`<>|' : noteSubjectParam = noteSubjectParam.replace("&", "&") noteSubjectParam = noteSubjectParam.replace("–", "-") noteSubjectParam = noteSubjectParam.replace(ch, '-') print "Processing: ", origParam, "\n -> ", noteSubjectParam nf = open(noteSubjectParam + '.htm', 'w') nf.write(note) nf.write(footer) nf.close() f = open('index.html','r') header = "" headerComplete = False footer = """</div> </body> </html> """ noteStart = False noteSubject = "" note = "" h2re = re.compile(' <h2 class="fn">(.*)</h2> ', re.IGNORECASE) invalidFSChars = re.compile i = 0 for line in f: if ' <div class="instance' in line: if not headerComplete: headerComplete = True #Finish header if noteStart: #Finish note writeNote(noteSubject) i += 1 noteStart = True note = line elif ' <h2 ' in line: m = h2re.match(line) noteSubject = m.group(1) else: if not headerComplete: header += line elif noteStart: note += line if noteStart: #Finish last note writeNote(noteSubject)
General usage instructions:
- Save this code to a Python file (eg: pythonSplitScript.py) in its own directory.
- Download a backup of your Springpad data. Log in to your account at www.sprintpadit.com and go Settings -> Services -> Backup to create/download a zip file of your account information.
- Extract the zip file and you should see an index.html file. This file has all of your information in it! Move this file into the same directory as your script so that it can be split into seperate html files that Evernote can understand and import.
- Open your terminal and run the script from the command line. On a Mac, the command looks like:
- Now there will be a bunch of *.htm files in your directory. Open your Evernote desktop app, select all these generated files (omit the original index.html file) and drag them into an Evernote notebook to import them.
This should work fine with the Mac and PC Evernote apps. As far as I know, the mobile and browser apps do not have this import functionality.