Skip to main content

Implementation of the json-patch spec

Project description

https://drone.io/bitbucket.org/eodolphi/json-patch/status.png

JSON Patch

Implementation of json-patch draft 04:

http://tools.ietf.org/html/draft-pbryan-json-patch-04

Installation

$ pip install json_patch

Usage

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

0.1

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 details)

Uploaded Source

File details

Details for the file json_patch-0.1.tar.gz.

File metadata

  • Download URL: json_patch-0.1.tar.gz
  • Upload date:
  • Size: 2.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No

File hashes

Hashes for json_patch-0.1.tar.gz
Algorithm Hash digest
SHA256 cfa67749e1f4704975659bd9ef36f0e2d266ed0bf5999b2046f3a30e80b8c883
MD5 ec6bd2ea726525ba8adcf377ebd11c50
BLAKE2b-256 2c171f8d70831a05ed91a6ff19fb446b669810ebc4e079a6ba3e2ac1723fab27

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page