Skip to main content

Implementation of the json-patch spec

Project description

JSON Patch

Implementation of json-patch draft 04:


$ pip install json_patch


JSON patch makes it possible to patch arbitrary json objects

>>> from json_patch import Patch
>>> patch = Patch([
            'op': 'add'
            'path': '/c',
            'value': 'f'
            'op': 'remove':
            'path': '/a'
            'op': 'replace'
            'path': '/b',
            'value': 'g'
 >>> data = {'a': 'd', 'b': 'e'}
 >>> print patch.apply(data)
    {'b': 'g', 'c': 'f'}

Project details

Release history Release notifications | RSS feed

This version


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

json_patch-0.1.tar.gz (2.5 kB view hashes)

Uploaded source

Supported by

AWS AWS Cloud computing Datadog Datadog Monitoring Facebook / Instagram Facebook / Instagram PSF Sponsor Fastly Fastly CDN Google Google Object Storage and Download Analytics Huawei Huawei PSF Sponsor Microsoft Microsoft PSF Sponsor NVIDIA NVIDIA PSF Sponsor Pingdom Pingdom Monitoring Salesforce Salesforce PSF Sponsor Sentry Sentry Error logging StatusPage StatusPage Status page