Registry / data / pyxdameraulevenshtein

pyxdameraulevenshtein

JSON →
library1.10.0pypypi✓ verified 87d ago

High-performance Damerau-Levenshtein edit distance computation for Python, implemented in Cython. Currently at version 1.10.1, with wheels for CPython 3.9–3.14 on Linux, macOS, and Windows. Releases are stable and infrequent.

pip install pyxdameraulevenshtein
INSTALL
IMPORT
SIG · PYXDAMERAULEVENSHT
P
pyxdameraulevenshtein
datapythonv1.10.0
Install
1.6s avg
Import
Disk
16MB
Pass rate
10/ 10
Env Coverage10 / 10
glibc
3.93.13
musl
3.93.13
Install & Compatibility
Where this runs
tested against v1.10.0 · pip install
no network on importno background threads
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
musl
py 3.103.95 runs
installs and imports cleanly · install 0.0s · import 0.000s · 18.4MB
glibc
py 3.103.95 runs
installs and imports cleanly · install 1.6s · import 0.000s · 19MB
16MB installed
● package 16MB
Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

damerau_levenshtein_distance
from pyxdameraulevenshtein import damerau_levenshtein_distance
import pyxdameraulevenshtein
Direct import without function name requires qualifying the call, but most users expect the function directly.
normalized_damerau_levenshtein_distance
from pyxdameraulevenshtein import normalized_damerau_levenshtein_distance
from pyxdameraulevenshtein import normalized_distance
Function name is unique; common typo omits 'damerau'.

Compute Damerau-Levenshtein distance between two strings. Works for any hashable sequences (e.g., lists of tokens).

from pyxdameraulevenshtein import damerau_levenshtein_distance string1 = 'hello' string2 = 'hola' dist = damerau_levenshtein_distance(string1, string2) print(f"DL distance: {dist}") # Normalized distance (0.0 to 1.0) from pyxdameraulevenshtein import normalized_damerau_levenshtein_distance norm_dist = normalized_damerau_levenshtein_distance(string1, string2) print(f"Normalized DL distance: {norm_dist:.4f}")
Debug
Known issues
gotchaThe library uses Cython and ships prebuilt wheels for most platforms. On unsupported architectures (e.g., ARM Linux without manylinux), install from source requires a C compiler.
fix
Install via pip; if source build fails, install a C compiler (gcc, clang) and ensure Python development headers are available.
affects: all
gotchaInput strings must be of the same type (both str or both bytes). Mixing types may raise a TypeError.
fix
Ensure both arguments are strings (or both bytes) before calling the distance functions.
affects: all
gotchaThe normalized distance function returns 0.0 for identical strings and 1.0 for completely different strings. It is not a symmetric normalized version of edit distance in the typical Levenshtein sense; it uses max length of the two strings as denominator.
fix
Understand that normalized_damerau_levenshtein_distance computes distance / max(len(s1), len(s2)).
affects: all
Errors
Common errors & fixes
ModuleNotFoundError: No module named 'pyxdameraulevenshtein'
Library not installed or wrong import name (common typo: pyxdameraulevenshtein vs pyxdamerau-levenshtein).
fix
Run: pip install pyxdameraulevenshtein
TypeError: expected string or bytes-like object
Passed non-string (e.g., int, list) to distance function.
fix
Convert arguments to strings: str(arg1), str(arg2)
ImportError: cannot import name 'damerau_levenshtein_distance' from 'pyxdameraulevenshtein'
Old library version (<1.0.0) may have different API. Current version 1.10.1 has this function.
fix
Upgrade: pip install --upgrade pyxdameraulevenshtein
Upgrade
Version history
1.10.0latest on PyPI · released Mar 18, 2026
Audit
Dependencies

No dependency data recorded yet.

Agent activity
4 hits · last 30 days
node
4
Resources
pyxdameraulevenshtein — pip install pyxdameraulevenshtein · libregistry