Find neareast match for a name in the history names using python