editdistpy
Fast Levenshtein and Damerau optimal string alignment algorithms.
Decision gist · record as of 2026-08-14
Yes, if you need fast edit-distance computation in Python. The library is actively maintained, has no external dependencies, installs cleanly on modern Python versions, carries a permissive MIT license, and shows good performance on short and medium strings. Install it if fuzzy string matching or similarity measurement is core to your application; skip it if you only need exact string matching or have no string-comparison requirements.AI-flagged interpretation of the facts on this page — verify before relying
Before you install
- Requires Python 3.10 or later.
- Medium install friction due to compiled wheels; however, prebuilt binaries are available for Python 3.10–3.14 across Linux, macOS (Intel and ARM), Windows, and musl systems, so installation typically succeeds without compilation.
- Actively maintained with a recent release.
License · maintenance · safety
MIT (permissive) — MIT license permits commercial and private use with minimal restrictions; suitable for most projects.
last release 2026-07-12 (33 days) · last repo commit 2026-08-14 · 27 stars
0 known vulnerabilities (OSV.dev, 2026-08-14) · 382,152 downloads/mo, #7,091 on PyPI
Alternatives
Verify before relying
from editdistpy import levenshtein
import sys
string_1 = "flintstone"
string_2 = "hanson"
max_distance = sys.maxsize
result = levenshtein.distance(string_1, string_2, max_distance)
print(result) # 6- Whether the package is actively maintained beyond the recent release date (last commit and maintenance status are current as of the fact sheet date).
- Performance characteristics on very long strings or in high-throughput scenarios compared to alternatives.
What it is and what it does
editdistpy is a compiled Python library that calculates edit distances—the minimum number of single-character edits needed to transform one string into another. It implements two algorithms: the classic Levenshtein distance (insertions, deletions, substitutions) and the Damerau-Levenshtein optimal string alignment distance (which also allows transpositions). The library is ported from a C# implementation and supports an optional `max_distance` parameter; when the distance would exceed this threshold, the function returns -1 instead of computing the full result, which can significantly speed up comparisons when you only care whether strings are "close enough" within a bound.
The package has no runtime dependencies and is distributed as precompiled wheels for modern Python versions (3.10–3.14) on common platforms. It is suitable for tasks like fuzzy string matching, spell-checking, duplicate detection, and record linkage where you need to measure how different two strings are. The library is actively maintained and carries an MIT license.
Use it for
- Spell-checking or autocorrect: find candidate corrections by computing edit distances from a misspelled word to a dictionary.
- Duplicate detection: identify similar product names, user entries, or records that may refer to the same entity.
- Fuzzy search: rank search results by string similarity when exact matches are unavailable.
- Data deduplication: merge or flag records with similar identifiers or names across datasets.
- Typo tolerance in user input: accept user queries that are within a small edit distance of known commands or entities.
Worth the install?
AI-flagged interpretation of the facts on this page. Verify before relying on it.
Yes, if you need fast edit-distance computation in Python.
The library is actively maintained, has no external dependencies, installs cleanly on modern Python versions, carries a permissive MIT license, and shows good performance on short and medium strings. Install it if fuzzy string matching or similarity measurement is core to your application; skip it if you only need exact string matching or have no string-comparison requirements.
Install
editdistpy on PyPI
Before you install
Medium install friction due to compiled wheels; however, prebuilt binaries are available for Python 3.10–3.14 across Linux, macOS (Intel and ARM), Windows, and musl systems, so installation typically succeeds without compilation. Actively maintained with a recent release.
Requires Python 3.10 or later.
License in practice
MIT license permits commercial and private use with minimal restrictions; suitable for most projects.
Quickstart
from editdistpy import levenshtein
import sys
string_1 = "flintstone"
string_2 = "hanson"
max_distance = sys.maxsize
result = levenshtein.distance(string_1, string_2, max_distance)
print(result) # 6
Verify before relying
- Whether the package is actively maintained beyond the recent release date (last commit and maintenance status are current as of the fact sheet date).
- Performance characteristics on very long strings or in high-throughput scenarios compared to alternatives.
Package facts
| License | MIT permissive |
| Python support | Supports the current Python release >=3.10 |
| Install friction | Medium. Platform-specific wheel |
| Runtime dependencies | None |
| Maintenance | Actively maintained 33 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 382,152 / month, #7,091 on PyPI 30-day window, as of 2026-08-14 |
| Known vulnerabilities | None known OSV.dev, checked 2026-08-14 |
| Classifiers | Development Status :: 4 - BetaIntended Audience :: DevelopersIntended Audience :: Science/ResearchNatural Language :: EnglishOperating System :: OS IndependentProgramming Language :: PythonProgramming Language :: Python :: 3Programming Language :: Python :: 3.10Programming Language :: Python :: 3.11Programming Language :: Python :: 3.12Programming Language :: Python :: 3.13Programming Language :: Python :: 3.14Programming Language :: Python :: Implementation :: CPythonProgramming Language :: Rust |
Evidence: editdistpy-0.4.0-cp310-cp310-macosx_10_12_x86_64.whl; editdistpy-0.4.0-cp310-cp310-macosx_11_0_arm64.whl; editdistpy-0.4.0-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.whl; editdistpy-0.4.0-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl; editdistpy-0.4.0-cp310-cp310-musllinux_1_1_aarch64.whl; editdistpy-0.4.0-cp310-cp310-musllinux_1_1_x86_64.whl; editdistpy-0.4.0-cp310-cp310-win32.whl; editdistpy-0.4.0-cp310-cp310-win_amd64.whl; editdistpy-0.4.0-cp311-cp311-macosx_10_12_x86_64.whl; editdistpy-0.4.0-cp311-cp311-macosx_11_0_arm64.whl; editdistpy-0.4.0-cp311-cp311-manylinux_2_17_aarch64.manylinux2014_aarch64.whl; editdistpy-0.4.0-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl; editdistpy-0.4.0-cp311-cp311-musllinux_1_1_aarch64.whl; editdistpy-0.4.0-cp311-cp311-musllinux_1_1_x86_64.whl; editdistpy-0.4.0-cp311-cp311-win32.whl; editdistpy-0.4.0-cp311-cp311-win_amd64.whl; editdistpy-0.4.0-cp312-cp312-macosx_10_12_x86_64.whl; editdistpy-0.4.0-cp312-cp312-macosx_11_0_arm64.whl; editdistpy-0.4.0-cp312-cp312-manylinux_2_17_aarch64.manylinux2014_aarch64.whl; editdistpy-0.4.0-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.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 › “damerau levenshtein”
- editdistpyComputes Levenshtein and Damerau-Levenshtein edit distances between…
- pyxDamerauLevenshteinComputes Damerau-Levenshtein edit distance between sequences using…
- strsimpyImplements a dozen string similarity and distance algorithms…
Give your agent the search over MCP, or paste the wish link into any chat.
More Linguistic packages
Detects and normalizes text encoding from unknown or ambiguous sources, supporting all IANA character sets that Python's core library provides codecs for, with the ability to register custom codecs.
tiktoken is a fast BPE tokenizer that converts text into token sequences compatible with OpenAI models, supporting multiple encoding schemes including o200k_base and model-specific encodings.
Install it if you work with OpenAI APIs or need to understand token boundaries in GPT-family models.
Detects character encoding and language in byte sequences with high accuracy, supporting 99 encodings and returning confidence scores, language tags, and MIME types.
Install it if you need to detect character encoding or language in byte data; the rewrite makes it substantially faster and more accurate than its predecessors.
Converts Unicode text to ASCII by transliterating non-ASCII characters into their closest ASCII equivalents, with no runtime dependencies.
However, if transliteration quality or ongoing maintenance matters, consider unidecode instead despite its GPL-only license.
Lark is a parsing library that builds abstract syntax trees from context-free grammars, supporting multiple parsing algorithms (Earley, LALR(1), CYK) with automatic line and column tracking.
Python bindings to the tree-sitter parsing library, enabling incremental parsing and syntax tree analysis for source code.
See also editdistance · pyxDamerauLevenshtein · strsimpy · edlib · Levenshtein · kaldialign · polyleven · pylev · textdistance · symspellpy