skillfed

python-Levenshtein

Python extension for computing string edit distances and similarities.

python-levenshtein v0.27.4 14.1M downloads/30d#1,248 on PyPI126
Copyleft license GPL-2.0-or-later Active released

What it is and what it does

Levenshtein is a Python C extension that provides fast computation of string edit distances and similarity metrics. It implements the classic Levenshtein algorithm along with related operations like approximate median strings and sequence similarity, making it suitable for fuzzy string matching, deduplication, and text comparison tasks where performance matters.

The package is actively maintained and supports current Python versions (3.10 through 3.14). It installs as a wheel with low friction and has no external runtime dependencies beyond the Python standard library. The copyleft GPL-2.0-or-later license means derivative works must be open-sourced under compatible terms.

Use it for:

  • Fuzzy string matching in search or autocomplete systems where approximate matches are needed.
  • Data deduplication by computing similarity scores between records to identify near-duplicates.
  • Spell-checking and typo correction by finding the closest matching word in a dictionary.
  • Record linkage in data integration pipelines to match entities across datasets.
  • Sequence alignment in bioinformatics or text analysis workflows.

Worth the install?

AI-flagged interpretation of the facts on this page — verify before relying

Computes Levenshtein edit distance, string similarity, and approximate median strings through a C extension module for fast string comparison operations.

Yes. The package is actively maintained, has no known vulnerabilities, installs with low friction, and fills a specific need for fast string distance computation. The GPL-2.0-or-later license is a hard requirement only if you need to distribute proprietary code; for internal use or open-source projects it poses no barrier.

Install

python-levenshtein on PyPI

pip

pip install python-levenshtein

uv

uv add python-levenshtein

poetry

poetry add python-levenshtein

Installing python-Levenshtein

Before you install

Low install friction with a pure wheel distribution. Actively maintained as of 2026-08-08 with recent releases; requires Python 3.10 or later.

License in practice

Licensed under GPL-2.0-or-later (copyleft). Any derivative work or distribution must comply with GPL terms; proprietary projects should review compatibility before use.

Quickstart

pip install levenshtein

from Levenshtein import distance
result = distance('kitten', 'sitting')

Requires Python 3.10 or later.

Verify before relying

  • Whether the C extension compiles without additional system dependencies on all target platforms.
  • Performance characteristics compared to pure-Python alternatives for typical workload sizes.

Package facts

License GPL-2.0-or-later (copyleft)
Python support supports the current Python release (>=3.10)
Install friction low — pure-Python wheel
Runtime dependencies 1 — Levenshtein
Maintenance actively maintained — 6 days since the last release
Last repo commit
First released
Downloads 14,084,844/month — #1,248 on PyPI (30-day window, as of 2026-08-14)
Known vulnerabilities none known (OSV.dev, checked 2026-08-14)

Evidence: python_levenshtein-0.27.4-py3-none-any.whl

Keywords: string, Levenshtein, comparison, edit-distance

Programming Language :: Python :: 3Programming Language :: Python :: 3.10Programming Language :: Python :: 3.11Programming Language :: Python :: 3.12Programming Language :: Python :: 3.13Programming Language :: Python :: 3.14

Tags

edit distance computationstring similarity matchinglevenshtein distanceapproximate string comparisonstring averagingsequence similarity
string-algorithmsfuzzy-matching

More Text Processing packages