Skip to main content
Join the official Python Developers Survey 2018 and win valuable prizes: Start the survey!

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

This version
History Node

0.1

Download files

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

Filename, size & hash SHA256 hash help File type Python version Upload date
json_patch-0.1.tar.gz (2.5 kB) Copy SHA256 hash SHA256 Source None Oct 22, 2013

Supported by

Elastic Elastic Search Pingdom Pingdom Monitoring Google Google BigQuery Sentry Sentry Error logging AWS AWS Cloud computing DataDog DataDog Monitoring Fastly Fastly CDN SignalFx SignalFx Supporter DigiCert DigiCert EV certificate StatusPage StatusPage Status page