skillfed

pyxDamerauLevenshtein

pyxDamerauLevenshtein implements the Damerau-Levenshtein (DL) edit distance algorithm for Python in Cython for high performance.

pyxdameraulevenshtein v1.10.0 153.5K downloads/30d#10,881 on PyPI257
Permissive license BSD 3-Clause License Active released

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 pyxdameraulevenshtein

uv

uv add pyxdameraulevenshtein

poetry

poetry add pyxdameraulevenshtein

Installing 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

Development Status :: 5 - Production/StableIntended Audience :: DevelopersIntended Audience :: EducationIntended Audience :: Science/ResearchLicense :: OSI Approved :: BSD LicenseOperating System :: OS IndependentProgramming Language :: CythonProgramming 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 :: 3.9Topic :: Scientific/Engineering :: Bio-InformaticsTopic :: Scientific/Engineering :: Information AnalysisTopic :: Text Processing :: Linguistic

Tags

damerau levenshtein distanceedit distance algorithmstring similarity metricsequence comparisonfast string matchingunicode edit distanceoptimal string alignment
string-matchingsequence-alignmentbioinformatics

More Information Analysis packages