json-merge-patch
JSON Merge Patch library (https://tools.ietf.org/html/rfc7386)
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-patchuv
uv add json-merge-patchpoetry
poetry add json-merge-patchInstalling 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
More Utilities packages
Converts domain names between Unicode and…
permissive · top 100 on PyPI
charset-normalizerDetects and normalizes text encoding from…
permissive · top 100 on PyPI
setuptoolsSetuptools is a Python build backend and…
permissive · top 100 on PyPI
pluggyPluggy provides a plugin system that lets you…
permissive · top 100 on PyPI
PygmentsPygments is a syntax highlighter that colorizes…
permissive · top 100 on PyPI
sixSix provides utility functions to write Python…
permissive · top 100 on PyPI
jsonpatchApplies JSON Patches according to RFC 6902,…
permissive · top 1,000 on PyPI
dictdifferDictdiffer computes and applies diffs and…
permissive · top 5,000 on PyPI
patchParses and applies unified diff patches to…
permissive · top 15,000 on PyPI
condense-jsonCondense JSON by replacing repeated strings and…
permissive · top 15,000 on PyPI
jsonpointerResolves JSON Pointers according to RFC 6901,…
permissive · top 1,000 on PyPI
diff-match-patchProvides diff, match, and patch algorithms for…
permissive · top 5,000 on PyPI
pytest-html-mergerMerges multiple pytest HTML reports generated…
unclear · top 15,000 on PyPI
deepmergeMerges nested Python data structures (dicts,…
permissive · top 5,000 on PyPI
dict-recursive-updateRecursively merges one dictionary into another,…
permissive · top 15,000 on PyPI
patchyPatchy modifies Python functions at runtime by…
permissive · top 5,000 on PyPI