pyxDamerauLevenshtein
pyxDamerauLevenshtein implements the Damerau-Levenshtein (DL) edit distance algorithm for Python in Cython for high performance.
What it is and what it does
pyxDamerauLevenshtein is a Cython-accelerated implementation of the Damerau-Levenshtein edit distance algorithm, which measures the minimum number of single-character edits (insertions, deletions, substitutions, or transpositions of adjacent characters) needed to transform one sequence into another. It runs in O(N*M) time using O(M) space and supports any sequence type including strings, lists, tuples, and ranges, with full Unicode support.
The package provides four main functions: raw edit distance between two sequences, normalized distance (ratio scaled to 0.0–1.0), and batch versions that compute distances against multiple sequences at once. All functions accept an optional max_distance threshold that short-circuits computation when the true distance exceeds it, avoiding unnecessary work. It is significantly faster than pure Python implementations and comparable to or faster than other C-based alternatives like jellyfish.
Use it for:
- Spell-checking and typo correction by computing distance between user input and dictionary words.
- Fuzzy string matching in data deduplication and record linkage tasks.
- DNA/protein sequence alignment in bioinformatics applications.
- Search result ranking by scoring query similarity to indexed documents.
- Duplicate detection in user-generated content or database records.
- Phonetic matching and name variation handling in identity resolution.
Worth the install?
AI-flagged interpretation of the facts on this page — verify before relying
Computes Damerau-Levenshtein edit distance between sequences using Cython for high performance, supporting strings, lists, tuples, and other sequence types with optional distance thresholds.
Yes. The package is actively maintained, has no known vulnerabilities, uses a permissive BSD license, and provides a well-optimized implementation of a standard algorithm with broad applicability. Install friction is low due to prebuilt wheels. Suitable for production use in spell-checking, fuzzy matching, bioinformatics, and data deduplication workflows.
Install
pyxdameraulevenshtein on PyPI
pip
pip install pyxdameraulevenshteinuv
uv add pyxdameraulevenshteinpoetry
poetry add pyxdameraulevenshteinInstalling pyxDamerauLevenshtein
Before you install
Medium install friction due to compiled wheels; prebuilt binaries available for Python 3.9–3.14 on macOS, Linux, and Windows, so installation typically requires no build step. Actively maintained with recent releases.
License in practice
BSD 3-Clause License is permissive and allows commercial use, modification, and redistribution with attribution required. No restrictions on use in proprietary software.
Quickstart
pip install pyxDamerauLevenshtein
from pyxdameraulevenshtein import damerau_levenshtein_distance
damerau_levenshtein_distance('smtih', 'smith') # returns 1
damerau_levenshtein_distance('smtih', 'smith', max_distance=2) # short-circuits
Verify before relying
- Whether the package is actively maintained beyond the last commit date (2026-03-22) and whether future Python versions beyond 3.14 will be supported.
Package facts
| License | BSD 3-Clause License (permissive) |
| Python support | supports the current Python release (>=3.9) |
| Install friction | medium — platform-specific wheel |
| Runtime dependencies | none |
| Maintenance | actively maintained — 149 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 153,457/month — #10,881 on PyPI (30-day window, as of 2026-08-14) |
| Known vulnerabilities | none known (OSV.dev, checked 2026-08-14) |
Evidence: pyxdameraulevenshtein-1.10.0-cp310-cp310-macosx_10_9_x86_64.whl; pyxdameraulevenshtein-1.10.0-cp310-cp310-macosx_11_0_arm64.whl; pyxdameraulevenshtein-1.10.0-cp310-cp310-manylinux1_x86_64.manylinux_2_28_x86_64.manylinux_2_5_x86_64.whl; pyxdameraulevenshtein-1.10.0-cp310-cp310-musllinux_1_2_x86_64.whl; pyxdameraulevenshtein-1.10.0-cp310-cp310-win_amd64.whl; pyxdameraulevenshtein-1.10.0-cp311-cp311-macosx_10_9_x86_64.whl; pyxdameraulevenshtein-1.10.0-cp311-cp311-macosx_11_0_arm64.whl; pyxdameraulevenshtein-1.10.0-cp311-cp311-manylinux1_x86_64.manylinux_2_28_x86_64.manylinux_2_5_x86_64.whl; pyxdameraulevenshtein-1.10.0-cp311-cp311-musllinux_1_2_x86_64.whl; pyxdameraulevenshtein-1.10.0-cp311-cp311-win_amd64.whl; pyxdameraulevenshtein-1.10.0-cp312-cp312-macosx_10_13_x86_64.whl; pyxdameraulevenshtein-1.10.0-cp312-cp312-macosx_11_0_arm64.whl; pyxdameraulevenshtein-1.10.0-cp312-cp312-manylinux1_x86_64.manylinux_2_28_x86_64.manylinux_2_5_x86_64.whl; pyxdameraulevenshtein-1.10.0-cp312-cp312-musllinux_1_2_x86_64.whl; pyxdameraulevenshtein-1.10.0-cp312-cp312-win_amd64.whl; pyxdameraulevenshtein-1.10.0-cp313-cp313-macosx_10_13_x86_64.whl; pyxdameraulevenshtein-1.10.0-cp313-cp313-macosx_11_0_arm64.whl; pyxdameraulevenshtein-1.10.0-cp313-cp313-manylinux1_x86_64.manylinux_2_28_x86_64.manylinux_2_5_x86_64.whl; pyxdameraulevenshtein-1.10.0-cp313-cp313-musllinux_1_2_x86_64.whl; pyxdameraulevenshtein-1.10.0-cp313-cp313-win_amd64.whl
Tags
More Information Analysis packages
A drop-in replacement for Python's standard…
permissive · top 100 on PyPI
pyarrowpyarrow provides Python bindings to Apache…
permissive · top 100 on PyPI
networkxNetworkX provides data structures and…
permissive · top 1,000 on PyPI
snowflake-connector-pythonConnects Python applications to Snowflake data…
permissive · top 1,000 on PyPI
contourpyContourPy calculates contours of 2D…
permissive · top 1,000 on PyPI
snowflake-snowpark-pythonSnowpark Python provides APIs to query and…
permissive · top 1,000 on PyPI
editdistanceComputes the edit distance (Levenshtein…
permissive · top 5,000 on PyPI
editdistpyComputes Levenshtein and Damerau-Levenshtein…
permissive · top 15,000 on PyPI
cyseqcyseq provides a Cython-optimized…
permissive · top 15,000 on PyPI
textdistanceComputes distance and similarity between text…
permissive · top 5,000 on PyPI
cydifflibCyDifflib provides a faster, drop-in…
permissive · top 15,000 on PyPI
python-LevenshteinComputes Levenshtein edit distance, string…
copyleft · top 5,000 on PyPI
strsimpyImplements a dozen string similarity and…
permissive · top 15,000 on PyPI
LevenshteinLevenshtein computes string edit distances,…
copyleft · top 1,000 on PyPI
DistanceComputes distance metrics (Levenshtein,…
copyleft · top 15,000 on PyPI
cdifflibcdifflib provides a C-accelerated…
permissive · top 15,000 on PyPI