Comparison
Levenshtein vs polyleven vs strsimpy vs textdistance
Maintenance, adoption and momentum side by side, from PyPI, GitHub and deps.dev data refreshed every day.
Python extension for computing string edit distances and similarities.
Maintained. Last release today, commits in 5 of the last 26 weeks. Weaker on commit activity and contributor spread.
pip install levenshteinA fast C-implemented library for Levenshtein distance
Maintained. Last release 7 weeks ago, commits in 1 of the last 26 weeks. Weaker on commit activity and contributor spread.
pip install polylevenA library implementing different string similarity and distance measures
Maintained. Last release 13 days ago, commits in 6 of the last 26 weeks. Weaker on contributor spread and security practices.
pip install strsimpyCompute distance between the two texts.
Slowing down. Last release over 2 years ago, little activity since. Fine for existing code; think twice for a new project.
pip install textdistanceIn short
- textdistance is slowing down (last release over 2 years ago): fine for existing code, risky for a new project.
- Levenshtein is the most used: 21M downloads a month, 4.4× more than polyleven.
- Maintenance is comparable: strsimpy 65, Levenshtein 62, polyleven 50 on Pythie’s Index.
- Levenshtein is growing fastest: downloads +30% over the last month.
- Safe default for a new project: Levenshtein.
Side by side
| Metric | Levenshtein | polyleven | strsimpy | textdistance |
|---|---|---|---|---|
| Pythie’s Index | Pythie’s Index: 62 | 50 |