Registry / devops / pyjsonpatch

pyjsonpatch

JSON →
library0.1.3pypypi✓ verified 82d ago

A Python implementation of JSON Pointer (RFC 6901) and JSON Patch (RFC 6902) for applying partial updates to JSON documents. Current version 0.1.3, with no recent changes.

pip install pyjsonpatch
INSTALL
IMPORT
SIG · PYJSONPATCH
P
pyjsonpatch
devopspythonv0.1.3
harness data pending
Install & Compatibility
Where this runs

No compatibility data collected yet for this library.

Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

apply_patch
from pyjsonpatch import apply_patch
from pyjsonpatch import JsonPatch
Operation
from pyjsonpatch import Operation
generate_patch
from pyjsonpatch import generate_patch

Create a JSON Patch from a list of operations and apply it to a document.

from pyjsonpatch import JsonPatch patch = JsonPatch([{"op": "replace", "path": "/foo", "value": "bar"}]) doc = {"foo": "baz"} result = patch.apply(doc) print(result) # {'foo': 'bar'}
Debug
Known issues
breakingpyjsonpatch uses RFC 6902 exactly; operations must be valid per spec. Invalid operations raise exceptions.
fix
Ensure operations conform to RFC 6902 (op, path, value optional for remove, etc.).
affects: all
gotchaThe 'path' in each operation must be a JSON Pointer string. Escaping rules for ~ and / apply.
fix
Use valid JSON Pointer syntax: escape ~ as ~0 and / as ~1.
affects: all
Upgrade
Version history
0.1.3latest on PyPI · released Feb 25, 2025
Audit
Dependencies

No dependency data recorded yet.

Agent activity
6 hits · last 30 days
node
6
Resources

No resource links recorded.

pyjsonpatch — pip install pyjsonpatch · libregistry