fuzzywuzzy
from fuzzywuzzy import fuzz txt_score = fuzz.ratio(all_name_str, item['name'])
Ref
https://github.com/seatgeek/fuzzywuzzy