{"id":27693,"library":"diffplus","title":"Diffplus","description":"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.","status":"active","version":"1.4.0","language":"python","source_language":"en","source_url":"https://github.com/angely-dev/diffplus","tags":["diff","indented","configuration","text","incremental"],"install":[{"cmd":"pip install diffplus","lang":"bash","label":""}],"dependencies":[],"imports":[{"note":null,"wrong":null,"symbol":"diff_texts","correct":"from diffplus import diff_texts"},{"note":"DiffResult is exported from top-level module, not a subpackage.","wrong":"from diffplus.models import DiffResult","symbol":"DiffResult","correct":"from diffplus import DiffResult"}],"quickstart":{"code":"from diffplus import diff_texts\n\ntext_a = \"\"\"\nparent:\n  child1: value1\n  child2: value2\n\"\"\"\n\ntext_b = \"\"\"\nparent:\n  child1: modified_value1\n  child3: value3\n\"\"\"\n\ndiff_result = diff_texts(text_a, text_b, context_lines=2)\nprint(diff_result)\n# Optional: access structured changes\nfor change in diff_result.changes:\n    print(change.line, change.type)","lang":"python","description":"Basic usage: diff two indented text strings and print the result."},"warnings":[{"fix":"Preprocess inputs to replace tabs with spaces before calling diff_texts.","message":"The library assumes input text has consistent indentation (spaces only). Mixing tabs and spaces may produce incorrect diffs.","severity":"gotcha","affected_versions":"all"},{"fix":"Explicitly set context_lines for your use case, e.g., diff_texts(..., context_lines=1).","message":"The 'context_lines' parameter can cause unexpected output if set too high. Default is 3; for large files, consider reducing to 1 or 0.","severity":"gotcha","affected_versions":"all"},{"fix":"Use 'from diffplus import diff_texts' instead of 'from diffplus import diff_indented'.","message":"Function 'diff_indented' has been renamed to 'diff_texts' in v1.0.0.","severity":"deprecated","affected_versions":"<1.0.0"}],"env_vars":null,"last_verified":"2026-05-09T00:00:00.000Z","next_check":"2026-08-07T00:00:00.000Z","problems":[{"fix":"Use diff_texts instead: from diffplus import diff_texts","cause":"Function renamed in v1.0.0.","error":"AttributeError: module 'diffplus' has no attribute 'diff_indented'"},{"fix":"Use context_lines instead: diff_texts(..., context_lines=2)","cause":"Parameter name changed from 'context' to 'context_lines' in v1.0.0.","error":"TypeError: diff_texts() got an unexpected keyword argument 'context'"},{"fix":"Ensure both inputs use consistent indentation (spaces only) and are not empty.","cause":"Inconsistent indentation (e.g., mixed tabs and spaces) or empty input.","error":"ValueError: Input text is not properly indented"}],"ecosystem":"pypi","meta_description":null,"install_score":null,"install_tag":null,"quickstart_score":null,"quickstart_tag":null}