--- id: pylcs version: "0.1.1" license: Apache 2.0 license_treatment: permissive maintenance: dormant --- # pylcs — super fast cpp implementation of longest common subsequence License: permissive · Maintenance: dormant · Downloads: 213.6K/mo ## What it is and what it does pylcs is a C++ extension that solves three classic string-comparison problems: finding the longest common subsequence (LCS), longest common substring, and computing edit distance (Levenshtein distance) between two strings. It uses dynamic programming for speed and supports UTF-8 strings including Chinese characters. The package can compare a single string against multiple targets in batch, and includes visualization functions to colorize matching regions with ANSI escape codes. The primary use case is rapid string similarity analysis in NLP, data deduplication, or sequence alignment tasks where performance matters. It exposes functions like `lcs_sequence_length()`, `lcs_string_length()`, and `edit_distance()` for length computation, plus `_idx` variants that return alignment indices. The package is dormant (last release October 2023, no commits since then) but carries no known security vulnerabilities. Use it for: - Detect duplicate or near-duplicate text records in data cleaning pipelines by computing edit distance or LCS length. - Align DNA or protein sequences in bioinformatics by finding longest common subsequences. - Measure string similarity in fuzzy matching, autocomplete, or spell-check systems. - Batch-compare a query string against many candidates to find the most similar match. - Visualize string alignment differences with colored output for debugging or reporting. ## Worth the install? AI-flagged interpretation of the facts above — verify before relying. Computes longest common subsequence, longest common substring, and edit distance (Levenshtein distance) between strings using C++ dynamic programming, with support for UTF-8 and batch comparisons. Yes, if you need fast string-comparison algorithms and can tolerate dormant maintenance. The package has no known vulnerabilities, permissive licensing, and adequate Windows binary support. However, verify platform availability (macOS/Linux) and Python version coverage before adopting in production; the last release was October 2023 and the original repository is no longer maintained. ## Install pip install pylcs uv add pylcs poetry add pylcs ## Installing pylcs Before you install: Medium install friction due to compiled C++ extension requiring pybind11. Binary wheels available for Windows across multiple Python versions (3.5–3.11), but platform support beyond Windows is unclear from the fact sheet. License in practice: Apache 2.0 is permissive, allowing commercial and private use with minimal restrictions; no notable licensing constraints for typical adoption. Quickstart: pip install pylcs import pylcs # Longest common subsequence length A = 'We are shannonai' B = 'We like shannonai' result = pylcs.lcs_sequence_length(A, B) print(result) # 14 # Edit distance dist = pylcs.edit_distance('aaa', 'aba') print(dist) # 1 Requires a C++ compiler and pybind11 at build time; binary wheels provided for Windows Python 3.5–3.11, but non-Windows users may need to compile from source. Verify before relying: - Whether binary wheels or source builds are available for macOS and Linux platforms. - Current maintenance status and whether the transfer from the original repository is actively supported. - Whether the package works with Python versions beyond 3.11. ## Package facts - License: Apache 2.0 (permissive) - Python support: unspecified - Install friction: medium - Maintenance: dormant - Downloads: 213.6K/month (top 15,000 on PyPI) - Known vulnerabilities: none known ## Tags longest common subsequence, longest common substring, edit distance levenshtein, string similarity matching, sequence alignment, string diff algorithm, lcs implementation, string-algorithms, sequence-alignment, c++-extension [View on SkillFed](https://skillfed.io/packages/pylcs) · [View on PyPI](https://pypi.org/project/pylcs/)