pylev
A pure Python Levenshtein implementation that's not freaking GPL'd.
What it is and what it does
pylev is a pure Python implementation of the Levenshtein distance algorithm, which measures how different two strings are by counting the minimum edits (insertions, deletions, substitutions) needed to transform one into the other. It has no external dependencies and works across Python versions. The package is straightforward: you import it, call the levenshtein() function with two strings, and get back an integer distance.
The library is useful for fuzzy matching, spell-checking, and similarity scoring in text processing pipelines. The current version (1.4.0) was released in 2021-05-30. The project is no longer actively maintained, but the algorithm itself is deterministic and unlikely to break.
Use it for:
- Fuzzy string matching in search or autocomplete features to find similar terms despite typos
- Spell-checking and correction by ranking candidate words by their edit distance from a misspelled input
- Duplicate detection in datasets by comparing record fields and flagging near-identical entries
- Name matching across databases where entries may have minor variations in spelling or formatting
Worth the install?
AI-flagged interpretation of the facts on this page — verify before relying
Computes the Levenshtein distance between two strings—the minimum number of single-character edits needed to transform one string into another.
Yes, if you need a lightweight, dependency-free Levenshtein implementation. The package is stable, permissively licensed, and carries no known vulnerabilities. The abandoned maintenance status is not a blocker for a mature algorithm, but consider alternatives if you need active support or performance-critical use.
Install
pylev on PyPI
pip
pip install pylevuv
uv add pylevpoetry
poetry add pylevInstalling pylev
Before you install
Low friction: pure Python with no runtime dependencies and a wheel distribution. Maintenance is abandoned (last commit 2023-04-04, no releases since 2021-05-30), but the package is stable and unlikely to require updates for basic use.
License in practice
Licensed under BSD (permissive), which allows free use, modification, and distribution with minimal restrictions—suitable for both open-source and proprietary projects.
Quickstart
import pylev
distance = pylev.levenshtein('kitten', 'sitting')
assert distance == 3
Verify before relying
- Whether the package receives security updates despite the abandoned status
- Performance characteristics compared to alternative Levenshtein implementations
Package facts
| License | not declared (permissive) |
| Python support | not specified |
| Install friction | low — pure-Python wheel |
| Runtime dependencies | none |
| Maintenance | abandoned — 1,902 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 1,894,735/month — #3,455 on PyPI (30-day window, as of 2026-08-14) |
| Known vulnerabilities | none known (OSV.dev, checked 2026-08-14) |
Evidence: pylev-1.4.0-py2.py3-none-any.whl
Tags
More Text Processing packages
A drop-in replacement for Python's standard…
permissive · top 100 on PyPI
pyparsingpyparsing provides a library for building text…
permissive · top 1,000 on PyPI
docutilsDocutils converts plaintext documentation in…
unclear · top 1,000 on PyPI
RapidFuzzRapidFuzz provides fast fuzzy string matching…
permissive · top 1,000 on PyPI
tinycss2tinycss2 parses CSS strings into token and…
permissive · top 1,000 on PyPI
llama-parseLlamaParse parses complex documents (PDFs,…
permissive · top 1,000 on PyPI
editdistanceComputes the edit distance (Levenshtein…
permissive · top 5,000 on PyPI
python-LevenshteinComputes Levenshtein edit distance, string…
copyleft · top 5,000 on PyPI
LevenshteinLevenshtein computes string edit distances,…
copyleft · top 1,000 on PyPI
textdistanceComputes distance and similarity between text…
permissive · top 5,000 on PyPI
strsimpyImplements a dozen string similarity and…
permissive · top 15,000 on PyPI
DistanceComputes distance metrics (Levenshtein,…
copyleft · top 15,000 on PyPI
editdistpyComputes Levenshtein and Damerau-Levenshtein…
permissive · top 15,000 on PyPI
polylevenPolyleven computes Levenshtein distance between…
unclear · top 5,000 on PyPI
fuzzywuzzyFuzzyWuzzy performs fuzzy string matching using…
copyleft · top 5,000 on PyPI
pyjarowinklerComputes Jaro and Jaro-Winkler similarity and…
permissive · top 15,000 on PyPI