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.
pip install pylevVerified import paths — ran on the pinned version, not inferred.
Calculates the Levenshtein distance between two simple strings.
Always use `pylev.levenshtein()` for the optimized algorithm. If you explicitly need the naive implementation, use `pylev.classic_levenschtein()`.
Ensure all calls to pylev functions use the correct spelling 'levenshtein' (without a 'c').
For word-level distance, convert strings to lists of words: `pylev.levenshtein(sentence1.split(), sentence2.split())`.
Install the package using pip: `pip install pylev`
Access the `levenshtein` function within the `pylev` module: `pylev.levenshtein('string1', 'string2')`Ensure you are importing the correct and currently supported function name, which is `levenshtein`: `from pylev import levenshtein` or `import pylev` and then `pylev.levenshtein(...)`
Ensure both arguments passed to `pylev.levenshtein` are strings, lists, or other iterable sequences: `pylev.levenshtein('apple', 'aple')` or `pylev.levenshtein(['a', 'p', 'p', 'l', 'e'], ['a', 'p', 'l', 'e'])`No dependency data recorded yet.