skillfed

editdistance

Fast implementation of the edit distance (Levenshtein distance)

editdistance v0.8.1 3.9M downloads/30d#2,439 on PyPI704
Permissive license MIT Abandoned released

What it is and what it does

editdistance is a Python library that calculates the edit distance (Levenshtein distance) between two sequences—the minimum number of single-character edits (insertions, deletions, substitutions) needed to transform one sequence into another. It wraps a C++ implementation with Cython bindings to achieve performance significantly faster than pure-Python alternatives. The library accepts strings or any hashable iterables (such as lists of words), making it more flexible than some competitors that only handle strings.

The package has no runtime dependencies and provides a single main function, `eval()`, that takes two sequences and returns their edit distance. It is commonly used in spell-checking, fuzzy matching, record deduplication, and natural-language processing tasks where approximate string matching is needed. The repository is archived and no longer actively maintained as of February 2024, though the last release (0.8.1) supports Python 3.8 and later with prebuilt wheels for major platforms.

Use it for:

  • Spell-checking and typo correction by finding the closest matching word in a dictionary.
  • Fuzzy record matching to identify duplicate or near-duplicate entries in databases.
  • Approximate string search in text processing pipelines where exact matches are too strict.
  • Sequence alignment in bioinformatics or computational linguistics for comparing word or token sequences.
  • Similarity scoring in recommendation systems to find similar user queries or product names.

Worth the install?

AI-flagged interpretation of the facts on this page — verify before relying

Computes the edit distance (Levenshtein distance) between two sequences using a fast C++ and Cython implementation, supporting strings and any hashable iterables.

Yes, if you need fast edit-distance computation and can accept an unmaintained package. The library is stable, has no known vulnerabilities, and prebuilt wheels minimize install friction on common platforms. However, be aware the repository is archived; no new features or security updates will be released. For active maintenance and ongoing support, consider alternatives, but for a straightforward, performant edit-distance calculation in an existing codebase, this remains a solid choice.

Install

editdistance on PyPI

pip

pip install editdistance

uv

uv add editdistance

poetry

poetry add editdistance

Installing editdistance

Before you install

Medium install friction due to compiled wheels; binary distributions are available for common platforms (Linux, macOS, Windows across multiple architectures), but source builds require a C++ compiler. Repository is archived and unmaintained since February 2024.

License in practice

MIT license is permissive; you may use, modify, and distribute this package freely in both open-source and commercial projects with minimal restrictions.

Quickstart

pip install editdistance

import editdistance
editdistance.eval('banana', 'bahama')
# 2

Requires Python 3.8 or later; if no prebuilt wheel exists for your platform, a C++ compiler is needed to build from source.

Verify before relying

  • Whether the archived repository will receive security patches or bug fixes in the future.
  • Performance characteristics on very large sequences or in memory-constrained environments.
  • Compatibility with Python versions beyond those explicitly tested in the wheel distribution.

Package facts

License MIT (permissive)
Python support supports the current Python release (>=3.8)
Install friction medium — platform-specific wheel
Runtime dependencies none
Maintenance abandoned — 916 days since the last release
Last repo commit (repository archived)
First released
Downloads 3,940,760/month — #2,439 on PyPI (30-day window, as of 2026-08-14)
Known vulnerabilities none known (OSV.dev, checked 2026-08-14)

Evidence: editdistance-0.8.1-cp310-cp310-macosx_10_9_universal2.whl; editdistance-0.8.1-cp310-cp310-macosx_10_9_x86_64.whl; editdistance-0.8.1-cp310-cp310-macosx_11_0_arm64.whl; editdistance-0.8.1-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.whl; editdistance-0.8.1-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl; editdistance-0.8.1-cp310-cp310-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl; editdistance-0.8.1-cp310-cp310-musllinux_1_1_aarch64.whl; editdistance-0.8.1-cp310-cp310-musllinux_1_1_i686.whl; editdistance-0.8.1-cp310-cp310-musllinux_1_1_x86_64.whl; editdistance-0.8.1-cp310-cp310-win32.whl; editdistance-0.8.1-cp310-cp310-win_amd64.whl; editdistance-0.8.1-cp311-cp311-macosx_10_9_universal2.whl; editdistance-0.8.1-cp311-cp311-macosx_10_9_x86_64.whl; editdistance-0.8.1-cp311-cp311-macosx_11_0_arm64.whl; editdistance-0.8.1-cp311-cp311-manylinux_2_17_aarch64.manylinux2014_aarch64.whl; editdistance-0.8.1-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl; editdistance-0.8.1-cp311-cp311-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl; editdistance-0.8.1-cp311-cp311-musllinux_1_1_aarch64.whl; editdistance-0.8.1-cp311-cp311-musllinux_1_1_i686.whl; editdistance-0.8.1-cp311-cp311-musllinux_1_1_x86_64.whl

Tags

levenshtein distanceedit distance calculationstring similaritysequence alignmentfast string matchinghamming distance alternativetext similarity metric
string-similaritylevenshteinfuzzy-matching

More Text Processing packages