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.

textdistancepython-Levenshtein
LanguagePythonC
LicenseMITGPL-2.0
Stars3.5k1.3k
Forks262151
Last analyzedOct 17, 2026Oct 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.
Read the textdistance analysis →

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.
Read the python-Levenshtein analysis →

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.