--- id: edlib version: "1.3.9.post1" license: MIT license_treatment: permissive maintenance: aging --- # edlib — Lightweight, super fast library for sequence alignment using edit (Levenshtein) distance. License: permissive · Maintenance: aging · Downloads: 273.6K/mo ## What it is and what it does Edlib is a Python wrapper around a C/C++ library that computes edit distance and sequence alignment using Myers's bit-vector algorithm. It takes two sequences (strings, bytes, or iterables of hashable objects) and returns the edit distance, alignment locations, and optionally the alignment path in CIGAR format. The package supports three alignment modes: global (NW), prefix (SHW), and infix (HW), each suited to different use cases. You can also define custom character equalities to handle case-insensitive matching, wildcards, or degenerate nucleotides. Common use cases include aligning DNA sequences in bioinformatics, calculating text or word similarity, and finding optimal subsequence matches. The library is designed for speed and can handle both small and large sequences efficiently. It has no runtime dependencies and is available as pre-built wheels for modern Python versions on standard platforms. Use it for: - Align DNA or protein sequences in bioinformatics pipelines to find mutations or similarities. - Calculate edit distance between user-provided strings to detect typos or find similar text. - Find the best alignment location of a query sequence within a larger target sequence using infix mode. - Implement fuzzy string matching with custom equality rules (e.g., case-insensitive or with wildcards). - Benchmark or validate sequence alignment algorithms in research or testing workflows. ## Worth the install? AI-flagged interpretation of the facts above — verify before relying. Edlib calculates edit distance (Levenshtein distance) between two sequences and optionally finds the optimal alignment path, supporting global, prefix, and infix alignment modes. Yes, if you need fast edit distance or sequence alignment. The package is lightweight, has no runtime dependencies, and offers good performance via compiled bindings. The aging maintenance status (last release 709 days ago) is a minor concern but not a blocker; the repository is still active and there are no known vulnerabilities. The constraint that alphabet length must be ≤ 256 may limit use cases with very large character sets. ## Install pip install edlib uv add edlib poetry add edlib ## Installing edlib Before you install: Medium install friction due to compiled C/C++ bindings, but pre-built wheels are available for common Python versions (3.10–3.13) and platforms (macOS, Linux, musl). Last release was 709 days ago; repository is active but aging. License in practice: MIT license is permissive; you may use, modify, and distribute this package freely in commercial and private projects with minimal restrictions. Quickstart: pip install edlib import edlib result = edlib.align("elephant", "telephone") print(result) # {'editDistance': 3, 'alphabetLength': 8, 'locations': [(None, 8)], 'cigar': None} # For alignment path visualization: result = edlib.align("elephant", "telephone", task="path") nice = edlib.getNiceAlignment(result, "elephant", "telephone") print("\n".join(nice.values())) Alphabet length (unique characters across both sequences) must be <= 256. Verify before relying: - Whether the package supports Python versions earlier than 3.10 or later than 3.13. - Performance characteristics on sequences larger than the benchmark examples shown in the description. ## Package facts - License: MIT (permissive) - Python support: unspecified - Install friction: medium - Maintenance: aging - Downloads: 273.6K/month (top 15,000 on PyPI) - Known vulnerabilities: none known ## Tags edit distance calculation, levenshtein distance, sequence alignment, dna sequence alignment, string similarity, sequence matching, alignment path, bioinformatics, sequence-alignment, string-similarity [View on SkillFed](https://skillfed.io/packages/edlib) · [View on PyPI](https://pypi.org/project/edlib/)