textdistance vs python-Levenshtein
Python text comparison libraries compared
textdistance and python-Levenshtein both help Python developers compare strings and other collections of text. textdistance offers a broad set of algorithms through a common interface, while python-Levenshtein focuses on Levenshtein-based calculations implemented as a C extension.

textdistance: Compare Sequences with 30+ Distance Algorithms
TextDistance is a Python library for comparing two or more sequences with a common interface to 30+ distance and similarity algorithms. It provides pure-Python implementations, with optional external libraries and NumPy for speed.

python-Levenshtein: Fast String Similarity for Python
python-Levenshtein is a C extension for Python that computes Levenshtein edit distance and related string similarity measures. It also provides edit operations, string averaging, and sequence and set comparisons for ordinary and Unicode strings.
| textdistance | python-Levenshtein | |
|---|---|---|
| Language | Python | C |
| License | MIT | GPL-2.0 |
| Stars | 3.5k | 1.3k |
| Forks | 262 | 151 |
| Last analyzed | Oct 17, 2026 | Oct 19, 2026 |
Key differences
- textdistance provides 30+ distance and similarity algorithms across several method families; python-Levenshtein centers on Levenshtein distance and related string tools.
- textdistance has pure-Python implementations and optional acceleration for selected algorithms; python-Levenshtein is a C extension and can also be compiled as a standalone C library.
- textdistance is licensed under MIT; python-Levenshtein is licensed under GPL-2.0-or-later.
- Both projects are marked inactive. textdistance has had no commits or releases in over a year, while python-Levenshtein's last recorded commit was in 2021.
- textdistance supports comparisons involving more than two sequences and customizable algorithm parameters; python-Levenshtein includes edit operations, string averages, and sequence and set comparisons.
Choose textdistance if you…
- need a range of distance and similarity algorithms behind a common interface.
- want pure-Python implementations or optional acceleration for selected algorithms.
- need to compare more than two sequences or customize algorithm parameters.
Choose python-Levenshtein if you…
- need Levenshtein edit distance, edit operations, or related string similarity measures.
- want string averages or comparisons involving sequences and sets.
- need a C extension or a standalone C compilation option, and can work with its GPL-2.0-or-later terms.
Compare the numbers side by side, or add more projects
This comparison is generated with AI from the OSRepos analyses of both projects. Always check each project's repository and documentation before choosing.