clustering.distance.levenshtein

The Levenshtein distance is a metric for measuring the amount of difference
between two sequences (i.e. an edit distance). The Levenshtein distance
between two strings is defined as the minimum number of edits needed to
transform one string into the other, with the allowable edit operations
being insertion, deletion, or substitution of a single character.

distance