skillfed

pylev

A pure Python Levenshtein implementation that's not freaking GPL'd.

pylev v1.4.0 1.9M downloads/30d#3,455 on PyPI99
Permissive license Abandoned released

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 pylev

uv

uv add pylev

poetry

poetry add pylev

Installing 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

Development Status :: 5 - Production/StableIntended Audience :: DevelopersLicense :: OSI Approved :: BSD LicenseOperating System :: OS IndependentProgramming Language :: PythonProgramming Language :: Python :: 3

Tags

levenshtein distancestring similarityedit distancestring matchingtext similarity metricfuzzy string comparisoncharacter edit distance
string-algorithmstext-similarity

More Text Processing packages