def record_diff ( old , new ) : old , new = _norm_json_params ( old , new ) return json_delta . diff ( new , old , verbose = False )
python json apply diff
Return a JSON - compatible structure capable turn the new record back into the old record . The parameters must be structures compatible with json . dumps * or * strings compatible with json . loads . Note that by design old == record_patch ( new record_diff ( old new ))
def record_diff(old, new):
    """Return a JSON-compatible structure capable turn the `new` record back
    into the `old` record. The parameters must be structures compatible with
    json.dumps *or* strings compatible with json.loads. Note that by design,
    `old == record_patch(new, record_diff(old, new))`"""
    old, new = _norm_json_params(old, new)
    return json_delta.diff(new, old, verbose=False)