python-json-patch is a Python library implementing the JSON Patch format (RFC 6902) for applying operations like add, remove, replace, move, copy, and test to JSON documents. It includes a smart diff algorithm to generate minimal patches by comparing two JSON objects, and provides command-line utilities (jsondiff and jsonpatch) for file-based operations. The core logic resides in jsonpatch.py, which is self-contained aside from the jsonpointer dependency, and handles edge cases such as duplicate keys via a custom multidict function. The library supports Python 2.7 and 3.7+ (though its setup.py contains an version specifier error excluding 3.4-3.6).
Birdie is a snapshot testing library for the Gleam programming language. It provides a `snap` function to capture and compare test outputs against stored snapshots, and a CLI interface to review, accept, reject, and manage snapshots. The architecture separates concerns into modules for snapshot handling, CLI parsing, diagnostic formatting, diff computation, and project metadata. Key entry points are the `snap` function for writing tests and the `main` function for the CLI tool. The system relies on Gleam standard library and several community packages for argument parsing, file operations, ANSI styling, and source code analysis via the `glance` library. Data flows involve test execution creating `.new` snapshot files, CLI review moving them to `.accepted` or deleting them, and stale snapshot detection via a reference file tracking which snapshots were used during test runs.