edlib
Lightweight, super fast library for sequence alignment using edit (Levenshtein) distance.
Decision gist · record as of 2026-08-14
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.AI-flagged interpretation of the facts on this page — verify before relying
Before you install
- Alphabet length (unique characters across both sequences) must be <= 256.
- 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 · maintenance · safety
MIT (permissive) — MIT license is permissive; you may use, modify, and distribute this package freely in commercial and private projects with minimal restrictions.
last release 2024-09-04 (709 days) · last repo commit 2025-05-13 · 604 stars
0 known vulnerabilities (OSV.dev, 2026-08-14) · 273,649 downloads/mo, #8,199 on PyPI
Alternatives
Verify before relying
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()))- 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.
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 on this page. Verify before relying on it.
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
edlib on PyPI
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.
Alphabet length (unique characters across both sequences) must be <= 256.
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()))
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 | Not specified |
| Install friction | Medium. Platform-specific wheel |
| Runtime dependencies | None |
| Maintenance | Aging 709 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 273,649 / month, #8,199 on PyPI 30-day window, as of 2026-08-14 |
| Known vulnerabilities | None known OSV.dev, checked 2026-08-14 |
Evidence: edlib-1.3.9.post1-cp310-cp310-macosx_10_9_universal2.whl; edlib-1.3.9.post1-cp310-cp310-macosx_10_9_x86_64.whl; edlib-1.3.9.post1-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl; edlib-1.3.9.post1-cp310-cp310-musllinux_1_2_i686.whl; edlib-1.3.9.post1-cp310-cp310-musllinux_1_2_x86_64.whl; edlib-1.3.9.post1-cp311-cp311-macosx_10_9_universal2.whl; edlib-1.3.9.post1-cp311-cp311-macosx_10_9_x86_64.whl; edlib-1.3.9.post1-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl; edlib-1.3.9.post1-cp311-cp311-musllinux_1_2_i686.whl; edlib-1.3.9.post1-cp311-cp311-musllinux_1_2_x86_64.whl; edlib-1.3.9.post1-cp312-cp312-macosx_10_9_universal2.whl; edlib-1.3.9.post1-cp312-cp312-macosx_10_9_x86_64.whl; edlib-1.3.9.post1-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl; edlib-1.3.9.post1-cp312-cp312-musllinux_1_2_i686.whl; edlib-1.3.9.post1-cp312-cp312-musllinux_1_2_x86_64.whl; edlib-1.3.9.post1-cp313-cp313-macosx_10_13_universal2.whl; edlib-1.3.9.post1-cp313-cp313-macosx_10_13_x86_64.whl; edlib-1.3.9.post1-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.whl; edlib-1.3.9.post1-cp313-cp313-musllinux_1_2_i686.whl; edlib-1.3.9.post1-cp313-cp313-musllinux_1_2_x86_64.whl
Tags
Let your AI agent find packages like this
Example. Real query, live index.
You found this page by searching. An agent finds it by wishing: SkillFed indexes 14,416 PyPI packages by what they can do, searchable in plain language.
wish › “edit distance calculation”
- edlibEdlib calculates edit distance (Levenshtein distance) between two…
- polylevenPolyleven computes Levenshtein distance between two strings using a…
- editdistanceComputes the edit distance (Levenshtein distance) between two…
Give your agent the search over MCP, or paste the wish link into any chat.
More Linguistic packages
Detects and normalizes text encoding from unknown or ambiguous sources, supporting all IANA character sets that Python's core library provides codecs for, with the ability to register custom codecs.
tiktoken is a fast BPE tokenizer that converts text into token sequences compatible with OpenAI models, supporting multiple encoding schemes including o200k_base and model-specific encodings.
Install it if you work with OpenAI APIs or need to understand token boundaries in GPT-family models.
Detects character encoding and language in byte sequences with high accuracy, supporting 99 encodings and returning confidence scores, language tags, and MIME types.
Install it if you need to detect character encoding or language in byte data; the rewrite makes it substantially faster and more accurate than its predecessors.
Converts Unicode text to ASCII by transliterating non-ASCII characters into their closest ASCII equivalents, with no runtime dependencies.
However, if transliteration quality or ongoing maintenance matters, consider unidecode instead despite its GPL-only license.
Lark is a parsing library that builds abstract syntax trees from context-free grammars, supporting multiple parsing algorithms (Earley, LALR(1), CYK) with automatic line and column tracking.
Python bindings to the tree-sitter parsing library, enabling incremental parsing and syntax tree analysis for source code.
See also editdistance · polyleven · python-Levenshtein · editdistpy · kaldialign · apted · Levenshtein · textdistance · strsimpy · fastdtw