--- id: cdifflib version: "1.2.9" license: Copyright (c) 2013, Matthew Duggan All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:… (full text in the JSON record) license_treatment: permissive maintenance: dormant --- # cdifflib — C implementation of parts of difflib License: permissive · Maintenance: dormant · Downloads: 233.2K/mo ## What it is and what it does cdifflib is a C-language reimplementation of core parts of Python's standard difflib module, specifically the SequenceMatcher class. It trades the flexibility of generic iterables for raw speed: it only accepts lists as input, but performs sequence matching roughly 4x faster than the pure Python version when processing large data. The API is fully compatible with difflib.SequenceMatcher, so you can drop it in as a replacement—even monkey-patch it into difflib itself to accelerate other libraries that use difflib transparently. The package has no runtime dependencies and compiles to platform-specific wheels. It is marked Production/Stable and supports Python 3.4 and later, though the project is dormant (last release 578 days ago). The main gotcha is that it requires list inputs; anything else gets converted to a list in the constructor, which can be surprising if you pass generators or other iterables expecting lazy evaluation. Use it for: - Accelerating diff operations in large-scale text processing pipelines where sequence matching is a bottleneck. - Speeding up test frameworks or code review tools that compare file contents or code snippets. - Replacing difflib globally in an application to transparently accelerate any library that depends on difflib. - Comparing large lists of structured data (records, tokens, etc.) where Python's difflib would be too slow. ## Worth the install? AI-flagged interpretation of the facts above — verify before relying. cdifflib provides a C-accelerated reimplementation of Python's difflib.SequenceMatcher for faster sequence comparison on lists, offering roughly 4x speedup over the pure Python version. Yes, if you have a performance-critical diffing workload on lists and are willing to accept medium install friction (compiled extension). The package is stable, permissively licensed, has no dependencies, and offers a straightforward 4x speedup. Dormant maintenance is a minor concern but not a blocker—the code is mature and the repo remains reachable. Install only if you've profiled and confirmed difflib is actually your bottleneck. ## Install pip install cdifflib uv add cdifflib poetry add cdifflib ## Installing cdifflib Before you install: Medium install friction due to compiled C extension requiring platform-specific wheels. The package is dormant (last release 578 days ago) but repo remains active with recent commits; no runtime dependencies simplifies deployment. License in practice: BSD 2-Clause license (permissive) permits commercial and private use with minimal restrictions—retain copyright notice and disclaimer in distributions. Quickstart: from cdifflib import CSequenceMatcher s = CSequenceMatcher(None, ['a', 'b', 'c'], ['a', 'x', 'c']) match = s.find_longest_match(0, 3, 0, 3) print(match) # Match(a=0, b=0, size=1) Input sequences must be lists; non-list iterables are converted to lists automatically, which may cause unexpected memory or performance behavior with very large iterables. Verify before relying: - Whether prebuilt wheels are available for all modern Python versions and platforms beyond the arm64 macOS wheels listed. - Current test coverage and whether the package passes on Python 3.13+ given the dormant maintenance status. - Whether the 4x speedup claim holds for typical real-world use cases or only for specific input patterns. ## Package facts - License: Copyright (c) 2013, Matthew Duggan All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:… (full text in the JSON record) (permissive) - Python support: supports_current - Install friction: medium - Maintenance: dormant - Downloads: 233.2K/month (top 15,000 on PyPI) - Known vulnerabilities: none known ## Tags fast sequence diffing, c accelerated difflib, sequence matcher performance, diff algorithm optimization, list comparison speed, performance-optimization, c-extension [View on SkillFed](https://skillfed.io/packages/cdifflib) · [View on PyPI](https://pypi.org/project/cdifflib/)