fast-diff-match-patch
Packages the C++ implementation of google-diff-match-patch for Python for fast byte and string diffs.
Decision gist · record as of 2026-08-14
Yes, if you need fast string or byte diffs. The package is stable, permissively licensed, has no known vulnerabilities, and offers prebuilt wheels for common platforms. Maintenance is dormant but the code is mature; install friction is moderate due to compilation but mitigated by wheel availability. Not worth installing if you only diff small strings or can tolerate slower pure-Python performance.AI-flagged interpretation of the facts on this page — verify before relying
Before you install
- Medium install friction due to compiled wheels; prebuilt binaries available for Python 3.6–3.12 on macOS, Linux, and Windows.
- Maintenance is dormant (last release 2024-04-23, last commit 2024-06-13), but the repository remains active and unarchived.
License · maintenance · safety
Apache License 2.0 (permissive) — Licensed under Apache License 2.0 (permissive), allowing free use, modification, and distribution with minimal restrictions.
last release 2024-04-23 (843 days) · last repo commit 2024-06-13 · 91 stars
0 known vulnerabilities (OSV.dev, 2026-08-14) · 494,506 downloads/mo, #6,347 on PyPI
Alternatives
Verify before relying
pip install fast_diff_match_patch
from fast_diff_match_patch import diff
changes = diff("Hello world.", "Goodbye moon.")
for op, length in changes:
print(f"{op}: {length} chars")- Whether the package works reliably on Python 3.13+ despite classifier support only through 3.12.
- Performance characteristics on very large documents compared to pure-Python alternatives.
- Whether the GIL release during diff operations provides measurable benefit in typical multi-threaded scenarios.
What it is and what it does
fast_diff_match_patch is a Python wrapper around a C++ implementation of Google's diff-match-patch library, designed to compute differences between text or byte strings much faster than the pure-Python port. It exposes a single `diff()` function that takes two strings or bytes and returns a sequence of operations (delete, keep, insert) with their lengths or content, optionally formatted as patches. The package releases the Global Interpreter Lock during diffing, allowing use in multi-threaded applications.
The library supports several tuning options: `timelimit` to cap computation time, `checklines` to optimize line-based text, `cleanup` to choose semantic or efficiency-focused post-processing, and `counts_only` to return operation lengths or full strings. It handles both Unicode strings and byte sequences, though Windows has limitations with characters outside the Basic Multilingual Plane.
Use it for
- Generate diffs between code versions or document revisions for version control or review systems.
- Detect and highlight changes in text files for diff viewers or collaborative editing tools.
- Produce patch files for applying changes to source code or configuration.
- Compare large documents or byte streams where pure-Python diff is too slow.
- Integrate fast text comparison into multi-threaded applications without GIL contention.
Worth the install?
AI-flagged interpretation of the facts on this page. Verify before relying on it.
Yes, if you need fast string or byte diffs.
The package is stable, permissively licensed, has no known vulnerabilities, and offers prebuilt wheels for common platforms. Maintenance is dormant but the code is mature; install friction is moderate due to compilation but mitigated by wheel availability. Not worth installing if you only diff small strings or can tolerate slower pure-Python performance.
Install
fast-diff-match-patch on PyPI
Before you install
Medium install friction due to compiled wheels; prebuilt binaries available for Python 3.6–3.12 on macOS, Linux, and Windows. Maintenance is dormant (last release 2024-04-23, last commit 2024-06-13), but the repository remains active and unarchived.
License in practice
Licensed under Apache License 2.0 (permissive), allowing free use, modification, and distribution with minimal restrictions.
Quickstart
pip install fast_diff_match_patch
from fast_diff_match_patch import diff
changes = diff("Hello world.", "Goodbye moon.")
for op, length in changes:
print(f"{op}: {length} chars")
Verify before relying
- Whether the package works reliably on Python 3.13+ despite classifier support only through 3.12.
- Performance characteristics on very large documents compared to pure-Python alternatives.
- Whether the GIL release during diff operations provides measurable benefit in typical multi-threaded scenarios.
Package facts
| License | Apache License 2.0 permissive |
| Python support | Not specified |
| Install friction | Medium. Platform-specific wheel |
| Runtime dependencies | None |
| Maintenance | Dormant 843 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 494,506 / month, #6,347 on PyPI 30-day window, as of 2026-08-14 |
| Known vulnerabilities | None known OSV.dev, checked 2026-08-14 |
| Classifiers | Programming Language :: Python :: 3Programming Language :: Python :: 3.10Programming Language :: Python :: 3.11Programming Language :: Python :: 3.12Programming Language :: Python :: 3.6Programming Language :: Python :: 3.7Programming Language :: Python :: 3.8Programming Language :: Python :: 3.9 |
Evidence: fast_diff_match_patch-2.1.0-cp310-cp310-macosx_10_9_universal2.whl; fast_diff_match_patch-2.1.0-cp310-cp310-macosx_10_9_x86_64.whl; fast_diff_match_patch-2.1.0-cp310-cp310-macosx_11_0_arm64.whl; fast_diff_match_patch-2.1.0-cp310-cp310-manylinux_2_17_i686.manylinux2014_i686.whl; fast_diff_match_patch-2.1.0-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl; fast_diff_match_patch-2.1.0-cp310-cp310-musllinux_1_1_i686.whl; fast_diff_match_patch-2.1.0-cp310-cp310-musllinux_1_1_x86_64.whl; fast_diff_match_patch-2.1.0-cp310-cp310-win32.whl; fast_diff_match_patch-2.1.0-cp310-cp310-win_amd64.whl; fast_diff_match_patch-2.1.0-cp311-cp311-macosx_10_9_universal2.whl; fast_diff_match_patch-2.1.0-cp311-cp311-macosx_10_9_x86_64.whl; fast_diff_match_patch-2.1.0-cp311-cp311-macosx_11_0_arm64.whl; fast_diff_match_patch-2.1.0-cp311-cp311-manylinux_2_17_i686.manylinux2014_i686.whl; fast_diff_match_patch-2.1.0-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl; fast_diff_match_patch-2.1.0-cp311-cp311-musllinux_1_1_i686.whl; fast_diff_match_patch-2.1.0-cp311-cp311-musllinux_1_1_x86_64.whl; fast_diff_match_patch-2.1.0-cp311-cp311-win32.whl; fast_diff_match_patch-2.1.0-cp311-cp311-win_amd64.whl; fast_diff_match_patch-2.1.0-cp312-cp312-macosx_10_9_universal2.whl; fast_diff_match_patch-2.1.0-cp312-cp312-macosx_10_9_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 › “fast string diff comparison”
- fast-diff-match-patchWraps the C++ implementation of google-diff-match-patch to perform…
- cydifflibCyDifflib provides a faster, drop-in replacement for Python's…
- fastdiffFastdiff provides a fast diff algorithm implementation using…
Give your agent the search over MCP, or paste the wish link into any chat.
More Text Processing packages
A drop-in replacement for Python's standard `re` module that adds advanced regex features like nested sets, fuzzy matching, lookaround in conditionals, and full Unicode case-folding while maintaining backward compatibility.
pyparsing provides a library for building text parsers directly in Python code using composable grammar classes, handling quoted strings, whitespace variation, and embedded comments without regex or lex/yacc.
Install it if you need to parse text or define grammars programmatically.
fonttools manipulates font files in multiple formats (TrueType, OpenType, AFM, Type 1, Mac-specific) and includes TTX, a tool to convert fonts to and from XML text format.
Install it if you need to read, write, or manipulate fonts programmatically or via the TTX command-line tool.
Docutils converts plaintext documentation in reStructuredText format into multiple output formats including HTML, XML, and LaTeX using a modular processing system.
RapidFuzz provides fast fuzzy string matching using Levenshtein Distance and related metrics, implemented mostly in C++ with Python bindings for rapid similarity scoring and approximate string matching.
Install it if you need fuzzy string matching; it's a solid replacement for FuzzyWuzzy with better licensing and performance.
tinycss2 parses CSS strings into token and block objects, and generates CSS strings from those objects, following the CSS Syntax Level 3 specification without enforcing specific properties or values.
Install it if your project requires CSS tokenization or syntax manipulation.
See also diff-match-patch · bsdiff4 · dictdiffer · patch · datadiff · jsondiff · xmldiff · whatthepatch · patch-ng · langdiff