I had to do something similar for autojump (fuzzy matching search string vs directories list).
I started hand rolling my own based on Damerau-Levenshtein, but it turns that Python already has a similar implementation in the difflib:
http://docs.python.org/2/library/difflib.html#difflib.get_cl...