Package jsondata :: Module JSONPatch
[hide private]
[frames] | no frames]

Module JSONPatch

source code

The JSONPatch module provides for the alteration of JSON data compliant to RFC6902.

The emphasis of the design combines low resource requirement with features
designed for the application of large filters onto large JSON based data 
structures.

The patch list itself is defined by RFC6902 as a JSON array. The entries 
could be either constructed in-memory, or imported from a persistent storage.
The export feature provides for the persistent storage of a modified patch
list for later reuse.

The module contains the following classes:

* **JSONPatch**:
    The controller for the application of patches on in-memory
    data structures provided by the package 'json'.
    
* **JSONPatchItem**:
    Representation of one patch entry in accordance to RFC6902.

* **JSONPatchItemRaw**:
    Representation of one patch entry read as a raw entry in accordance to RFC6902.

* **JSONPatchFilter**:
    Selection filter for the application on the current patch list
    entries JSONPatchItem.

* **JSONPatchException**:
    Specific exception for this module.


The address of the the provided 'path' components for the entries are managed
by the class JSONPointer in accordance to RFC6901. 


Version: 0.2.14

Author: Arno-Can Uestuensoez

Copyright: Copyright (C) 2015-2016 Arno-Can Uestuensoez @Ingenieurbuero Arno-Can Uestuensoez

License: Artistic-License-2.0 + Forced-Fairplay-Constraints

Classes [hide private]
  JSONPatchException
  JSONPatchItemException
  JSONPatchItem
Record entry for list of patch tasks.
  JSONPatchItemRaw
Adds native patch strings or an unsorted dict for RFC6902.
  JSONPatchFilter
Filtering capabilities on the entries of patch lists.
  JSONPatch
Representation of a JSONPatch task list for RFC6902.
Functions [hide private]
 
getOp(x)
Converts input into corresponding enumeration.
source code
Variables [hide private]
  __maintainer__ = 'Arno-Can Uestuensoez'
  __uuid__ = '63b597d6-4ada-4880-9f99-f5e0961351fb'
  version = '2.7'
  _appname = 'jsonpatch'
  _interactive = False
  RFC6902_ADD = 1
  RFC6902_COPY = 2
  RFC6902_MOVE = 3
  RFC6902_REMOVE = 4
  RFC6902_REPLACE = 5
  RFC6902_TEST = 6
  op2str = {1: 'add', 2: 'copy', 3: 'move', 4: 'remove', 5: 'rep...
  str2op = {'add': 1, 'copy': 2, 'move': 3, 'remove': 4, 'replac...
  __package__ = 'jsondata'
Variables Details [hide private]

op2str

Value:
{1: 'add', 2: 'copy', 3: 'move', 4: 'remove', 5: 'replace', 6: 'test'}

str2op

Value:
{'add': 1, 'copy': 2, 'move': 3, 'remove': 4, 'replace': 5, 'test': 6}