Registry / serialization / diffplus

diffplus

JSON →
library1.4.0pypypi✓ verified 85d ago

Diffplus is a Python library for computing incremental and contextual diffs between two indented configurations (e.g., YAML, INI, or any indented text). Version 1.4.0, last updated in 2025. Release cadence is irregular (major versions every few months). It supports Python >=3.8 and is designed to produce structured diff output highlighting additions, deletions, and context.

pip install diffplus
INSTALL
IMPORT
SIG · DIFFPLUS
D
diffplus
serializationpythonv1.4.0
harness data pending
Install & Compatibility
Where this runs

No compatibility data collected yet for this library.

Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

IncrementalDiff
✓ from diffplus import IncrementalDiff
✗ from diffplus import diff_texts
incremental_diff
✓ from diffplus import incremental_diff
✗ from diffplus import diff_texts

Basic usage: diff two indented text strings and print the result.

from diffplus import diff_texts text_a = """ parent: child1: value1 child2: value2 """ text_b = """ parent: child1: modified_value1 child3: value3 """ diff_result = diff_texts(text_a, text_b, context_lines=2) print(diff_result) # Optional: access structured changes for change in diff_result.changes: print(change.line, change.type)
Debug
Known issues
gotchaThe library assumes input text has consistent indentation (spaces only). Mixing tabs and spaces may produce incorrect diffs.
fix
Preprocess inputs to replace tabs with spaces before calling diff_texts.
affects: all
gotchaThe 'context_lines' parameter can cause unexpected output if set too high. Default is 3; for large files, consider reducing to 1 or 0.
fix
Explicitly set context_lines for your use case, e.g., diff_texts(..., context_lines=1).
affects: all
deprecatedFunction 'diff_indented' has been renamed to 'diff_texts' in v1.0.0.
fix
Use 'from diffplus import diff_texts' instead of 'from diffplus import diff_indented'.
affects: <1.0.0
Upgrade
Version history
1.4.0latest on PyPI · released Mar 16, 2025
Audit
Dependencies

No dependency data recorded yet.

Agent activity
13 hits · last 30 days
node
12
OpenAI (training)
1
Resources
diffplus — pip install diffplus · libregistry