pylev

1.4.0 · active · verified Sat Apr 11

pylev is a pure Python implementation for calculating the Levenshtein distance between two strings, notable for its New BSD license unlike many other GPL-licensed alternatives. The current version is 1.4.0. It has an irregular release cadence, with updates addressing performance improvements and minor fixes.

Warnings

Install

Imports

Quickstart

Calculates the Levenshtein distance between two simple strings.

import pylev

str1 = 'kitten'
str2 = 'sitting'
distance = pylev.levenshtein(str1, str2)

print(f"Levenshtein distance between '{str1}' and '{str2}': {distance}")

view raw JSON →