Levenshtein
Python extension for computing string edit distances and similarities.
Decision gist · record as of 2026-08-14
Yes, with license awareness. Levenshtein is actively maintained, has no known vulnerabilities, and provides a fast, well-documented solution for string distance computation. Install it if you need edit-distance operations and can accept the GPL-2.0-or-later copyleft requirement; avoid it if your project must remain proprietary without GPL compliance.AI-flagged interpretation of the facts on this page — verify before relying
Before you install
- Requires Python 3.10 or later; compiled wheels provided for common platforms but may require a C compiler on unsupported architectures.
- Medium install friction due to compiled wheels; prebuilt binaries available for Python 3.10–3.14 across macOS, Linux (multiple architectures), and Windows, reducing build requirements for most users.
License · maintenance · safety
GPL-2.0-or-later (copyleft) — GPL-2.0-or-later copyleft license requires derivative works and modifications to be distributed under compatible terms; acceptable for internal or open-source use but incompatible with proprietary closed-source distribution.
last release 2026-08-08 (6 days) · last repo commit 2026-08-10 · 398 stars
0 known vulnerabilities (OSV.dev, 2026-08-14) · 22,279,949 downloads/mo, #978 on PyPI
Alternatives
Verify before relying
pip install levenshtein
import Levenshtein
distance = Levenshtein.distance('kitten', 'sitting')
print(distance) # 3- Whether rapidfuzz dependency is automatically installed or must be added separately to the environment.
- Performance characteristics (speed vs. pure-Python alternatives) for typical use cases.
- Specific string averaging algorithm behavior and output format.
What it is and what it does
Levenshtein is a Python C extension that provides fast computation of string edit distances and related metrics. It wraps compiled code to calculate Levenshtein distance (the minimum number of single-character edits needed to transform one string into another), string similarity scores, approximate median strings, and sequence/set similarity measures. The package is designed for performance-critical applications where repeated distance calculations are needed.
The module depends on rapidfuzz and supports Python 3.10 through 3.14. Prebuilt wheels are available for most common platforms (macOS, Linux on x86_64/ARM/ARMv7, Windows, and musl-based systems), making installation straightforward on standard environments. The GPL-2.0-or-later license means it is suitable for open-source and internal projects but not for proprietary closed-source distribution without careful licensing review.
Use it for
- Fuzzy string matching in search or autocomplete features to find similar strings despite typos or variations.
- Deduplication of records in databases or data pipelines by identifying near-duplicate entries.
- Spell-checking and correction by computing distances between user input and dictionary words.
- Approximate string averaging to generate representative strings from a set of similar inputs.
- Sequence similarity analysis in bioinformatics or text processing workflows.
Worth the install?
AI-flagged interpretation of the facts on this page. Verify before relying on it.
Yes, with license awareness.
Levenshtein is actively maintained, has no known vulnerabilities, and provides a fast, well-documented solution for string distance computation. Install it if you need edit-distance operations and can accept the GPL-2.0-or-later copyleft requirement; avoid it if your project must remain proprietary without GPL compliance.
Install
levenshtein on PyPI
Before you install
Medium install friction due to compiled wheels; prebuilt binaries available for Python 3.10–3.14 across macOS, Linux (multiple architectures), and Windows, reducing build requirements for most users.
Requires Python 3.10 or later; compiled wheels provided for common platforms but may require a C compiler on unsupported architectures.
License in practice
GPL-2.0-or-later copyleft license requires derivative works and modifications to be distributed under compatible terms; acceptable for internal or open-source use but incompatible with proprietary closed-source distribution.
Quickstart
pip install levenshtein
import Levenshtein
distance = Levenshtein.distance('kitten', 'sitting')
print(distance) # 3
Verify before relying
- Whether rapidfuzz dependency is automatically installed or must be added separately to the environment.
- Performance characteristics (speed vs. pure-Python alternatives) for typical use cases.
- Specific string averaging algorithm behavior and output format.
Package facts
| License | GPL-2.0-or-later copyleft |
| Python support | Supports the current Python release >=3.10 |
| Install friction | Medium. Platform-specific wheel |
| Runtime dependencies | 1 packagerapidfuzz |
| Maintenance | Actively maintained 6 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 22,279,949 / month, #978 on PyPI 30-day window, as of 2026-08-14 |
| Known vulnerabilities | None known OSV.dev, checked 2026-08-14 |
| Classifiers | Programming Language :: Python :: 3Programming Language :: Python :: 3.10Programming Language :: Python :: 3.11Programming Language :: Python :: 3.12Programming Language :: Python :: 3.13Programming Language :: Python :: 3.14 |
Evidence: levenshtein-0.27.4-cp310-cp310-macosx_10_9_x86_64.whl; levenshtein-0.27.4-cp310-cp310-macosx_11_0_arm64.whl; levenshtein-0.27.4-cp310-cp310-manylinux_2_24_aarch64.manylinux_2_28_aarch64.whl; levenshtein-0.27.4-cp310-cp310-manylinux_2_24_armv7l.manylinux_2_31_armv7l.whl; levenshtein-0.27.4-cp310-cp310-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl; levenshtein-0.27.4-cp310-cp310-musllinux_1_2_aarch64.whl; levenshtein-0.27.4-cp310-cp310-musllinux_1_2_armv7l.whl; levenshtein-0.27.4-cp310-cp310-musllinux_1_2_x86_64.whl; levenshtein-0.27.4-cp310-cp310-win32.whl; levenshtein-0.27.4-cp310-cp310-win_amd64.whl; levenshtein-0.27.4-cp310-cp310-win_arm64.whl; levenshtein-0.27.4-cp311-cp311-macosx_10_9_x86_64.whl; levenshtein-0.27.4-cp311-cp311-macosx_11_0_arm64.whl; levenshtein-0.27.4-cp311-cp311-manylinux_2_24_aarch64.manylinux_2_28_aarch64.whl; levenshtein-0.27.4-cp311-cp311-manylinux_2_24_armv7l.manylinux_2_31_armv7l.whl; levenshtein-0.27.4-cp311-cp311-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl; levenshtein-0.27.4-cp311-cp311-musllinux_1_2_aarch64.whl; levenshtein-0.27.4-cp311-cp311-musllinux_1_2_armv7l.whl; levenshtein-0.27.4-cp311-cp311-musllinux_1_2_x86_64.whl; levenshtein-0.27.4-cp311-cp311-win32.whl
Tags
Let your AI agent find packages like this
Example. Real query, live index.
You found this page by searching. An agent finds it by wishing: SkillFed indexes 14,416 PyPI packages by what they can do, searchable in plain language.
wish › “string averaging”
- LevenshteinLevenshtein computes string edit distances, similarities, and related…
- python-LevenshteinComputes Levenshtein edit distance, string similarity, and…
- ema-pytorchMaintains an exponential moving average (EMA) copy of a PyTorch model…
Give your agent the search over MCP, or paste the wish link into any chat.
More Text Processing packages
A drop-in replacement for Python's standard `re` module that adds advanced regex features like nested sets, fuzzy matching, lookaround in conditionals, and full Unicode case-folding while maintaining backward compatibility.
pyparsing provides a library for building text parsers directly in Python code using composable grammar classes, handling quoted strings, whitespace variation, and embedded comments without regex or lex/yacc.
Install it if you need to parse text or define grammars programmatically.
fonttools manipulates font files in multiple formats (TrueType, OpenType, AFM, Type 1, Mac-specific) and includes TTX, a tool to convert fonts to and from XML text format.
Install it if you need to read, write, or manipulate fonts programmatically or via the TTX command-line tool.
Docutils converts plaintext documentation in reStructuredText format into multiple output formats including HTML, XML, and LaTeX using a modular processing system.
RapidFuzz provides fast fuzzy string matching using Levenshtein Distance and related metrics, implemented mostly in C++ with Python bindings for rapid similarity scoring and approximate string matching.
Install it if you need fuzzy string matching; it's a solid replacement for FuzzyWuzzy with better licensing and performance.
tinycss2 parses CSS strings into token and block objects, and generates CSS strings from those objects, following the CSS Syntax Level 3 specification without enforcing specific properties or values.
Install it if your project requires CSS tokenization or syntax manipulation.
See also python-Levenshtein · pylev · polyleven · editdistance · editdistpy · strsimpy · pyxDamerauLevenshtein · edlib · stringzilla