skillfed

json-merge-patch

JSON Merge Patch library (https://tools.ietf.org/html/rfc7386)

json-merge-patch v0.3.0 5.2M downloads/30d#2,143 on PyPI36
Permissive license BSD AGING released

What it is and what it does

json-merge-patch is a lightweight library that implements JSON Merge Patch as defined in RFC 7386. It provides two core operations: merge, which combines multiple dictionaries in sequence, and create_patch, which computes the minimal patch needed to transform one dictionary into another. The library works only with Python dictionaries and leaves JSON serialization/deserialization to the caller.

It has no external dependencies and runs on Python 3.9 or later. The package also includes a command-line interface for merging JSON files and generating patches without writing code. It's useful for configuration management, API responses, and any workflow where you need to apply or compute incremental changes to JSON data.

Use it for:

  • Merge configuration files or settings objects where later values override earlier ones.
  • Generate minimal patches for API responses or data synchronization protocols.
  • Build tools that need to apply incremental updates to JSON documents.
  • Command-line workflows to combine or diff JSON files without scripting.
  • Implement RFC 7386–compliant merge semantics in larger applications.

Worth the install?

AI-flagged interpretation of the facts on this page — verify before relying

Merges JSON objects according to RFC 7386 and generates minimal patches to transform one JSON structure into another.

Yes. The package is stable, dependency-free, and widely used (top 5000 on PyPI). It solves a specific, well-defined problem with no security vulnerabilities. The aging maintenance status is not a concern for a small, feature-complete library—install it if you need RFC 7386 merge semantics.

Install

json-merge-patch on PyPI

pip

pip install json-merge-patch

uv

uv add json-merge-patch

poetry

poetry add json-merge-patch

Installing json-merge-patch

Before you install

Low friction—no runtime dependencies outside the standard library. Aging maintenance status (last release 507 days ago), but the repository remains active and the package is widely used.

License in practice

BSD license is permissive; you can use, modify, and distribute this package freely with minimal restrictions.

Quickstart

pip install json-merge-patch

import json_merge_patch

input1 = {"a": 1}
input2 = {"a": 2, "b": 3}
result = json_merge_patch.merge(input1, input2)
print(result)  # {'a': 2, 'b': 3}

Requires Python 3.9 or later.

Verify before relying

  • Whether the 507-day gap since last release indicates maintenance is stalled or simply stable.
  • Performance characteristics when merging very large JSON structures.

Package facts

License BSD (permissive)
Python support supports the current Python release (>=3.9)
Install friction low — pure-Python wheel
Runtime dependencies none
Maintenance aging — 507 days since the last release
Last repo commit
First released
Downloads 5,199,053/month — #2,143 on PyPI (30-day window, as of 2026-08-14)
Known vulnerabilities none known (OSV.dev, checked 2026-08-14)

Evidence: json_merge_patch-0.3.0-py3-none-any.whl

Tags

json merge patch rfc 7386merge json objectsjson patch generationjson diff and patchapply json patchesjson merge library
jsonrfc-7386cli-tool

More Utilities packages