{"library":"recursive-diff","title":"Recursive Diff","description":"recursive-diff is a Python library that provides a function to recursively compare two Python data structures (dictionaries, lists, and basic types) and return a detailed diff. It is currently at version 2.1.0 and is actively maintained, with releases addressing bug fixes and minor enhancements.","language":"python","status":"active","last_verified":"Fri Apr 17","install":{"commands":["pip install recursive-diff"],"cli":null},"imports":["from recursive_diff import recursive_diff"],"auth":{"required":false,"env_vars":[]},"quickstart":{"code":"from recursive_diff import recursive_diff\n\nobj1 = {\n    \"name\": \"Alice\",\n    \"details\": {\"age\": 30, \"city\": \"New York\", \"preferences\": {\"color\": \"blue\"}},\n    \"items\": [\"apple\", \"banana\"],\n    \"tags\": {\"active\": True}\n}\nobj2 = {\n    \"name\": \"Bob\",\n    \"details\": {\"age\": 31, \"city\": \"London\", \"preferences\": {\"color\": \"red\"}},\n    \"items\": [\"apple\", \"cherry\"],\n    \"tags\": {\"active\": True, \"premium\": True}\n}\n\ndiff = recursive_diff(obj1, obj2)\n\n# The diff is a list of operation dictionaries\n# Example output structure:\n# [\n#   {'op': 'change', 'path': ['name'], 'old': 'Alice', 'new': 'Bob'},\n#   {'op': 'change', 'path': ['details', 'age'], 'old': 30, 'new': 31},\n#   {'op': 'change', 'path': ['details', 'city'], 'old': 'New York', 'new': 'London'},\n#   {'op': 'change', 'path': ['details', 'preferences', 'color'], 'old': 'blue', 'new': 'red'},\n#   {'op': 'remove', 'path': ['items', 1], 'old': 'banana'},\n#   {'op': 'add', 'path': ['items', 1], 'new': 'cherry'},\n#   {'op': 'add', 'path': ['tags', 'premium'], 'new': True}\n# ]\nprint(diff)\n","lang":"python","description":"This quickstart demonstrates how to compare two complex Python dictionaries using `recursive_diff` and interpret the resulting list of operation dictionaries.","tag":null,"tag_description":null,"last_tested":null,"results":[]},"compatibility":null}