{
    "content": [
        {
            "type": "text",
            "text": "# jsonpatch (pydoc)\n\n**Summary:** jsonpatch - Apply JSON-Patches (RFC 6902)\n\n## Section Outline\n\n- **NAME** (2 lines)\n- **CLASSES** (16 lines) — 13 subsections\n  - class AddOperation (45 lines)\n  - class CopyOperation (45 lines)\n  - class DiffBuilder (30 lines)\n  - class InvalidJsonPatch (70 lines)\n  - class JsonPatch (143 lines)\n  - class JsonPatchConflict (74 lines)\n  - class JsonPatchException (69 lines)\n  - class JsonPatchTestFailed (71 lines)\n  - class MoveOperation (55 lines)\n  - class PatchOperation (37 lines)\n  - class RemoveOperation (45 lines)\n  - class ReplaceOperation (45 lines)\n  - class TestOperation (45 lines)\n- **FUNCTIONS** (1 lines) — 3 subsections\n  - apply_patch (31 lines)\n  - make_patch (19 lines)\n  - multidict (2 lines)\n- **DATA** (5 lines)\n- **VERSION** (2 lines)\n- **AUTHOR** (2 lines)\n- **FILE** (3 lines)\n\n## Full Content\n\n### NAME\n\njsonpatch - Apply JSON-Patches (RFC 6902)\n\n### CLASSES\n\nbuiltins.Exception(builtins.BaseException)\nJsonPatchException\nInvalidJsonPatch\nJsonPatchConflict\nJsonPatchTestFailed(JsonPatchException, builtins.AssertionError)\nbuiltins.object\nDiffBuilder\nJsonPatch\nPatchOperation\nAddOperation\nCopyOperation\nMoveOperation\nRemoveOperation\nReplaceOperation\nTestOperation\n\n#### class AddOperation\n\n|  AddOperation(operation, pointercls=<class 'jsonpointer.JsonPointer'>)\n|\n|  Adds an object property or an array element.\n|\n|  Method resolution order:\n|      AddOperation\n|      PatchOperation\n|      builtins.object\n|\n|  Methods defined here:\n|\n|  apply(self, obj)\n|      Abstract method that applies a patch operation to the specified object.\n|\n|  ----------------------------------------------------------------------\n|  Methods inherited from PatchOperation:\n|\n|  eq(self, other)\n|      Return self==value.\n|\n|  hash(self)\n|      Return hash(self).\n|\n|  init(self, operation, pointercls=<class 'jsonpointer.JsonPointer'>)\n|      Initialize self.  See help(type(self)) for accurate signature.\n|\n|  ne(self, other)\n|      Return self!=value.\n|\n|  ----------------------------------------------------------------------\n|  Readonly properties inherited from PatchOperation:\n|\n|  path\n|\n|  ----------------------------------------------------------------------\n|  Data descriptors inherited from PatchOperation:\n|\n|  dict\n|      dictionary for instance variables (if defined)\n|\n|  weakref\n|      list of weak references to the object (if defined)\n|\n|  key\n\n#### class CopyOperation\n\n|  CopyOperation(operation, pointercls=<class 'jsonpointer.JsonPointer'>)\n|\n|  Copies an object property or an array element to a new location\n|\n|  Method resolution order:\n|      CopyOperation\n|      PatchOperation\n|      builtins.object\n|\n|  Methods defined here:\n|\n|  apply(self, obj)\n|      Abstract method that applies a patch operation to the specified object.\n|\n|  ----------------------------------------------------------------------\n|  Methods inherited from PatchOperation:\n|\n|  eq(self, other)\n|      Return self==value.\n|\n|  hash(self)\n|      Return hash(self).\n|\n|  init(self, operation, pointercls=<class 'jsonpointer.JsonPointer'>)\n|      Initialize self.  See help(type(self)) for accurate signature.\n|\n|  ne(self, other)\n|      Return self!=value.\n|\n|  ----------------------------------------------------------------------\n|  Readonly properties inherited from PatchOperation:\n|\n|  path\n|\n|  ----------------------------------------------------------------------\n|  Data descriptors inherited from PatchOperation:\n|\n|  dict\n|      dictionary for instance variables (if defined)\n|\n|  weakref\n|      list of weak references to the object (if defined)\n|\n|  key\n\n#### class DiffBuilder\n\n|  DiffBuilder(srcdoc, dstdoc, dumps=<function dumps at 0x7f5570ea5bd0>, pointercls=<class 'jsonpointer.JsonPointer'>)\n|\n|  Methods defined here:\n|\n|  init(self, srcdoc, dstdoc, dumps=<function dumps at 0x7f5570ea5bd0>, pointercls=<class 'jsonpointer.JsonPointer'>)\n|      Initialize self.  See help(type(self)) for accurate signature.\n|\n|  iter(self)\n|\n|  execute(self)\n|\n|  insert(self, op)\n|\n|  iterfrom(self, start)\n|\n|  remove(self, index)\n|\n|  storeindex(self, value, index, st)\n|\n|  takeindex(self, value, st)\n|\n|  ----------------------------------------------------------------------\n|  Data descriptors defined here:\n|\n|  dict\n|      dictionary for instance variables (if defined)\n|\n|  weakref\n|      list of weak references to the object (if defined)\n\n#### class InvalidJsonPatch\n\n|  Raised if an invalid JSON Patch is created\n|\n|  Method resolution order:\n|      InvalidJsonPatch\n|      JsonPatchException\n|      builtins.Exception\n|      builtins.BaseException\n|      builtins.object\n|\n|  Data descriptors inherited from JsonPatchException:\n|\n|  weakref\n|      list of weak references to the object (if defined)\n|\n|  ----------------------------------------------------------------------\n|  Methods inherited from builtins.Exception:\n|\n|  init(self, /, *args, kwargs)\n|      Initialize self.  See help(type(self)) for accurate signature.\n|\n|  ----------------------------------------------------------------------\n|  Static methods inherited from builtins.Exception:\n|\n|  new(*args, kwargs) from builtins.type\n|      Create and return a new object.  See help(type) for accurate signature.\n|\n|  ----------------------------------------------------------------------\n|  Methods inherited from builtins.BaseException:\n|\n|  delattr(self, name, /)\n|      Implement delattr(self, name).\n|\n|  getattribute(self, name, /)\n|      Return getattr(self, name).\n|\n|  reduce(...)\n|      Helper for pickle.\n|\n|  repr(self, /)\n|      Return repr(self).\n|\n|  setattr(self, name, value, /)\n|      Implement setattr(self, name, value).\n|\n|  setstate(...)\n|\n|  str(self, /)\n|      Return str(self).\n|\n|  withtraceback(...)\n|      Exception.withtraceback(tb) --\n|      set self.traceback to tb and return self.\n|\n|  ----------------------------------------------------------------------\n|  Data descriptors inherited from builtins.BaseException:\n|\n|  cause\n|      exception cause\n|\n|  context\n|      exception context\n|\n|  dict\n|\n|  suppresscontext\n|\n|  traceback\n|\n|  args\n\n#### class JsonPatch\n\n|  JsonPatch(patch, pointercls=<class 'jsonpointer.JsonPointer'>)\n|\n|  Methods defined here:\n|\n|  bool(self)\n|\n|  eq(self, other)\n|      Return self==value.\n|\n|  hash(self)\n|      Return hash(self).\n|\n|  init(self, patch, pointercls=<class 'jsonpointer.JsonPointer'>)\n|      Initialize self.  See help(type(self)) for accurate signature.\n|\n|  iter(self)\n|\n|  ne(self, other)\n|      Return self!=value.\n|\n|  nonzero = bool(self)\n|\n|  str(self)\n|      str(self) -> self.tostring()\n|\n|  apply(self, obj, inplace=False)\n|      Applies the patch to a given object.\n|\n|      :param obj: Document object.\n|      :type obj: dict\n|\n|      :param inplace: Tweaks the way how patch would be applied - directly to\n|                       specified `obj` or to its copy.\n|      :type inplace: bool\n|\n|      :return: Modified `obj`.\n|\n|  tostring(self, dumps=None)\n|      Returns patch set as JSON string.\n|\n|  ----------------------------------------------------------------------\n|  Class methods defined here:\n|\n|  fromdiff(src, dst, optimization=True, dumps=None, pointercls=<class 'jsonpointer.JsonPointer'>) from builtins.type\n|      Creates JsonPatch instance based on comparison of two document\n|      objects. Json patch would be created for `src` argument against `dst`\n|      one.\n|\n|      :param src: Data source document object.\n|      :type src: dict\n|\n|      :param dst: Data source document object.\n|      :type dst: dict\n|\n|      :param dumps: A function of one argument that produces a serialized\n|                    JSON string.\n|      :type dumps: function\n|\n|      :param pointercls: JSON pointer class to use.\n|      :type pointercls: Type[JsonPointer]\n|\n|      :return: :class:`JsonPatch` instance.\n|\n|      >>> src = {'foo': 'bar', 'numbers': [1, 3, 4, 8]}\n|      >>> dst = {'baz': 'qux', 'numbers': [1, 4, 7]}\n|      >>> patch = JsonPatch.fromdiff(src, dst)\n|      >>> new = patch.apply(src)\n|      >>> new == dst\n|      True\n|\n|  fromstring(patchstr, loads=None, pointercls=<class 'jsonpointer.JsonPointer'>) from builtins.type\n|      Creates JsonPatch instance from string source.\n|\n|      :param patchstr: JSON patch as raw string.\n|      :type patchstr: str\n|\n|      :param loads: A function of one argument that loads a serialized\n|                    JSON string.\n|      :type loads: function\n|\n|      :param pointercls: JSON pointer class to use.\n|      :type pointercls: Type[JsonPointer]\n|\n|      :return: :class:`JsonPatch` instance.\n|\n|  ----------------------------------------------------------------------\n|  Static methods defined here:\n|\n|  jsondumper = dumps(obj, *, skipkeys=False, ensureascii=True, checkcircular=True, allownan=True, cls=None, indent=None, separators=None, default=None, sortkeys=False, kw)\n|      Serialize ``obj`` to a JSON formatted ``str``.\n|\n|      If ``skipkeys`` is true then ``dict`` keys that are not basic types\n|      (``str``, ``int``, ``float``, ``bool``, ``None``) will be skipped\n|      instead of raising a ``TypeError``.\n|\n|      If ``ensureascii`` is false, then the return value can contain non-ASCII\n|      characters if they appear in strings contained in ``obj``. Otherwise, all\n|      such characters are escaped in JSON strings.\n|\n|      If ``checkcircular`` is false, then the circular reference check\n|      for container types will be skipped and a circular reference will\n|      result in an ``RecursionError`` (or worse).\n|\n|      If ``allownan`` is false, then it will be a ``ValueError`` to\n|      serialize out of range ``float`` values (``nan``, ``inf``, ``-inf``) in\n|      strict compliance of the JSON specification, instead of using the\n|      JavaScript equivalents (``NaN``, ``Infinity``, ``-Infinity``).\n|\n|      If ``indent`` is a non-negative integer, then JSON array elements and\n|      object members will be pretty-printed with that indent level. An indent\n|      level of 0 will only insert newlines. ``None`` is the most compact\n|      representation.\n|\n|      If specified, ``separators`` should be an ``(itemseparator, keyseparator)``\n|      tuple.  The default is ``(', ', ': ')`` if *indent* is ``None`` and\n|      ``(',', ': ')`` otherwise.  To get the most compact JSON representation,\n|      you should specify ``(',', ':')`` to eliminate whitespace.\n|\n|      ``default(obj)`` is a function that should return a serializable version\n|      of obj or raise TypeError. The default simply raises TypeError.\n|\n|      If *sortkeys* is true (default: ``False``), then the output of\n|      dictionaries will be sorted by key.\n|\n|      To use a custom ``JSONEncoder`` subclass (e.g. one that overrides the\n|      ``.default()`` method to serialize additional types), specify it with\n|      the ``cls`` kwarg; otherwise ``JSONEncoder`` is used.\n|\n|  jsonloader = functools.partial(<function loads at 0x7f5570ea6...airshook=<function multidict at 0x7f5570ea4790>)\n|  ----------------------------------------------------------------------\n|  Data descriptors defined here:\n|\n|  dict\n|      dictionary for instance variables (if defined)\n|\n|  weakref\n|      list of weak references to the object (if defined)\n|\n|  ----------------------------------------------------------------------\n|  Data and other attributes defined here:\n|\n|  operations = mappingproxy({'remove': <class 'jsonpatch.Remove...on'>, ...\n\n#### class JsonPatchConflict\n\n|  Raised if patch could not be applied due to conflict situation such as:\n|  - attempt to add object key when it already exists;\n|  - attempt to operate with nonexistence object key;\n|  - attempt to insert value to array at position beyond its size;\n|  - etc.\n|\n|  Method resolution order:\n|      JsonPatchConflict\n|      JsonPatchException\n|      builtins.Exception\n|      builtins.BaseException\n|      builtins.object\n|\n|  Data descriptors inherited from JsonPatchException:\n|\n|  weakref\n|      list of weak references to the object (if defined)\n|\n|  ----------------------------------------------------------------------\n|  Methods inherited from builtins.Exception:\n|\n|  init(self, /, *args, kwargs)\n|      Initialize self.  See help(type(self)) for accurate signature.\n|\n|  ----------------------------------------------------------------------\n|  Static methods inherited from builtins.Exception:\n|\n|  new(*args, kwargs) from builtins.type\n|      Create and return a new object.  See help(type) for accurate signature.\n|\n|  ----------------------------------------------------------------------\n|  Methods inherited from builtins.BaseException:\n|\n|  delattr(self, name, /)\n|      Implement delattr(self, name).\n|\n|  getattribute(self, name, /)\n|      Return getattr(self, name).\n|\n|  reduce(...)\n|      Helper for pickle.\n|\n|  repr(self, /)\n|      Return repr(self).\n|\n|  setattr(self, name, value, /)\n|      Implement setattr(self, name, value).\n|\n|  setstate(...)\n|\n|  str(self, /)\n|      Return str(self).\n|\n|  withtraceback(...)\n|      Exception.withtraceback(tb) --\n|      set self.traceback to tb and return self.\n|\n|  ----------------------------------------------------------------------\n|  Data descriptors inherited from builtins.BaseException:\n|\n|  cause\n|      exception cause\n|\n|  context\n|      exception context\n|\n|  dict\n|\n|  suppresscontext\n|\n|  traceback\n|\n|  args\n\n#### class JsonPatchException\n\n|  Base Json Patch exception\n|\n|  Method resolution order:\n|      JsonPatchException\n|      builtins.Exception\n|      builtins.BaseException\n|      builtins.object\n|\n|  Data descriptors defined here:\n|\n|  weakref\n|      list of weak references to the object (if defined)\n|\n|  ----------------------------------------------------------------------\n|  Methods inherited from builtins.Exception:\n|\n|  init(self, /, *args, kwargs)\n|      Initialize self.  See help(type(self)) for accurate signature.\n|\n|  ----------------------------------------------------------------------\n|  Static methods inherited from builtins.Exception:\n|\n|  new(*args, kwargs) from builtins.type\n|      Create and return a new object.  See help(type) for accurate signature.\n|\n|  ----------------------------------------------------------------------\n|  Methods inherited from builtins.BaseException:\n|\n|  delattr(self, name, /)\n|      Implement delattr(self, name).\n|\n|  getattribute(self, name, /)\n|      Return getattr(self, name).\n|\n|  reduce(...)\n|      Helper for pickle.\n|\n|  repr(self, /)\n|      Return repr(self).\n|\n|  setattr(self, name, value, /)\n|      Implement setattr(self, name, value).\n|\n|  setstate(...)\n|\n|  str(self, /)\n|      Return str(self).\n|\n|  withtraceback(...)\n|      Exception.withtraceback(tb) --\n|      set self.traceback to tb and return self.\n|\n|  ----------------------------------------------------------------------\n|  Data descriptors inherited from builtins.BaseException:\n|\n|  cause\n|      exception cause\n|\n|  context\n|      exception context\n|\n|  dict\n|\n|  suppresscontext\n|\n|  traceback\n|\n|  args\n\n#### class JsonPatchTestFailed\n\n|  A Test operation failed\n|\n|  Method resolution order:\n|      JsonPatchTestFailed\n|      JsonPatchException\n|      builtins.AssertionError\n|      builtins.Exception\n|      builtins.BaseException\n|      builtins.object\n|\n|  Data descriptors inherited from JsonPatchException:\n|\n|  weakref\n|      list of weak references to the object (if defined)\n|\n|  ----------------------------------------------------------------------\n|  Methods inherited from builtins.AssertionError:\n|\n|  init(self, /, *args, kwargs)\n|      Initialize self.  See help(type(self)) for accurate signature.\n|\n|  ----------------------------------------------------------------------\n|  Static methods inherited from builtins.AssertionError:\n|\n|  new(*args, kwargs) from builtins.type\n|      Create and return a new object.  See help(type) for accurate signature.\n|\n|  ----------------------------------------------------------------------\n|  Methods inherited from builtins.BaseException:\n|\n|  delattr(self, name, /)\n|      Implement delattr(self, name).\n|\n|  getattribute(self, name, /)\n|      Return getattr(self, name).\n|\n|  reduce(...)\n|      Helper for pickle.\n|\n|  repr(self, /)\n|      Return repr(self).\n|\n|  setattr(self, name, value, /)\n|      Implement setattr(self, name, value).\n|\n|  setstate(...)\n|\n|  str(self, /)\n|      Return str(self).\n|\n|  withtraceback(...)\n|      Exception.withtraceback(tb) --\n|      set self.traceback to tb and return self.\n|\n|  ----------------------------------------------------------------------\n|  Data descriptors inherited from builtins.BaseException:\n|\n|  cause\n|      exception cause\n|\n|  context\n|      exception context\n|\n|  dict\n|\n|  suppresscontext\n|\n|  traceback\n|\n|  args\n\n#### class MoveOperation\n\n|  MoveOperation(operation, pointercls=<class 'jsonpointer.JsonPointer'>)\n|\n|  Moves an object property or an array element to a new location.\n|\n|  Method resolution order:\n|      MoveOperation\n|      PatchOperation\n|      builtins.object\n|\n|  Methods defined here:\n|\n|  apply(self, obj)\n|      Abstract method that applies a patch operation to the specified object.\n|\n|  ----------------------------------------------------------------------\n|  Readonly properties defined here:\n|\n|  frompath\n|\n|  ----------------------------------------------------------------------\n|  Data descriptors defined here:\n|\n|  fromkey\n|\n|  ----------------------------------------------------------------------\n|  Methods inherited from PatchOperation:\n|\n|  eq(self, other)\n|      Return self==value.\n|\n|  hash(self)\n|      Return hash(self).\n|\n|  init(self, operation, pointercls=<class 'jsonpointer.JsonPointer'>)\n|      Initialize self.  See help(type(self)) for accurate signature.\n|\n|  ne(self, other)\n|      Return self!=value.\n|\n|  ----------------------------------------------------------------------\n|  Readonly properties inherited from PatchOperation:\n|\n|  path\n|\n|  ----------------------------------------------------------------------\n|  Data descriptors inherited from PatchOperation:\n|\n|  dict\n|      dictionary for instance variables (if defined)\n|\n|  weakref\n|      list of weak references to the object (if defined)\n|\n|  key\n\n#### class PatchOperation\n\n|  PatchOperation(operation, pointercls=<class 'jsonpointer.JsonPointer'>)\n|\n|  A single operation inside a JSON Patch.\n|\n|  Methods defined here:\n|\n|  eq(self, other)\n|      Return self==value.\n|\n|  hash(self)\n|      Return hash(self).\n|\n|  init(self, operation, pointercls=<class 'jsonpointer.JsonPointer'>)\n|      Initialize self.  See help(type(self)) for accurate signature.\n|\n|  ne(self, other)\n|      Return self!=value.\n|\n|  apply(self, obj)\n|      Abstract method that applies a patch operation to the specified object.\n|\n|  ----------------------------------------------------------------------\n|  Readonly properties defined here:\n|\n|  path\n|\n|  ----------------------------------------------------------------------\n|  Data descriptors defined here:\n|\n|  dict\n|      dictionary for instance variables (if defined)\n|\n|  weakref\n|      list of weak references to the object (if defined)\n|\n|  key\n\n#### class RemoveOperation\n\n|  RemoveOperation(operation, pointercls=<class 'jsonpointer.JsonPointer'>)\n|\n|  Removes an object property or an array element.\n|\n|  Method resolution order:\n|      RemoveOperation\n|      PatchOperation\n|      builtins.object\n|\n|  Methods defined here:\n|\n|  apply(self, obj)\n|      Abstract method that applies a patch operation to the specified object.\n|\n|  ----------------------------------------------------------------------\n|  Methods inherited from PatchOperation:\n|\n|  eq(self, other)\n|      Return self==value.\n|\n|  hash(self)\n|      Return hash(self).\n|\n|  init(self, operation, pointercls=<class 'jsonpointer.JsonPointer'>)\n|      Initialize self.  See help(type(self)) for accurate signature.\n|\n|  ne(self, other)\n|      Return self!=value.\n|\n|  ----------------------------------------------------------------------\n|  Readonly properties inherited from PatchOperation:\n|\n|  path\n|\n|  ----------------------------------------------------------------------\n|  Data descriptors inherited from PatchOperation:\n|\n|  dict\n|      dictionary for instance variables (if defined)\n|\n|  weakref\n|      list of weak references to the object (if defined)\n|\n|  key\n\n#### class ReplaceOperation\n\n|  ReplaceOperation(operation, pointercls=<class 'jsonpointer.JsonPointer'>)\n|\n|  Replaces an object property or an array element by a new value.\n|\n|  Method resolution order:\n|      ReplaceOperation\n|      PatchOperation\n|      builtins.object\n|\n|  Methods defined here:\n|\n|  apply(self, obj)\n|      Abstract method that applies a patch operation to the specified object.\n|\n|  ----------------------------------------------------------------------\n|  Methods inherited from PatchOperation:\n|\n|  eq(self, other)\n|      Return self==value.\n|\n|  hash(self)\n|      Return hash(self).\n|\n|  init(self, operation, pointercls=<class 'jsonpointer.JsonPointer'>)\n|      Initialize self.  See help(type(self)) for accurate signature.\n|\n|  ne(self, other)\n|      Return self!=value.\n|\n|  ----------------------------------------------------------------------\n|  Readonly properties inherited from PatchOperation:\n|\n|  path\n|\n|  ----------------------------------------------------------------------\n|  Data descriptors inherited from PatchOperation:\n|\n|  dict\n|      dictionary for instance variables (if defined)\n|\n|  weakref\n|      list of weak references to the object (if defined)\n|\n|  key\n\n#### class TestOperation\n\n|  TestOperation(operation, pointercls=<class 'jsonpointer.JsonPointer'>)\n|\n|  Test value by specified location.\n|\n|  Method resolution order:\n|      TestOperation\n|      PatchOperation\n|      builtins.object\n|\n|  Methods defined here:\n|\n|  apply(self, obj)\n|      Abstract method that applies a patch operation to the specified object.\n|\n|  ----------------------------------------------------------------------\n|  Methods inherited from PatchOperation:\n|\n|  eq(self, other)\n|      Return self==value.\n|\n|  hash(self)\n|      Return hash(self).\n|\n|  init(self, operation, pointercls=<class 'jsonpointer.JsonPointer'>)\n|      Initialize self.  See help(type(self)) for accurate signature.\n|\n|  ne(self, other)\n|      Return self!=value.\n|\n|  ----------------------------------------------------------------------\n|  Readonly properties inherited from PatchOperation:\n|\n|  path\n|\n|  ----------------------------------------------------------------------\n|  Data descriptors inherited from PatchOperation:\n|\n|  dict\n|      dictionary for instance variables (if defined)\n|\n|  weakref\n|      list of weak references to the object (if defined)\n|\n|  key\n\n### FUNCTIONS\n\n#### apply_patch\n\nApply list of patches to specified json document.\n\n:param doc: Document object.\n:type doc: dict\n\n:param patch: JSON patch as list of dicts or raw JSON-encoded string.\n:type patch: list or str\n\n:param inplace: While :const:`True` patch will modify target document.\nBy default patch will be applied to document copy.\n:type inplace: bool\n\n:param pointercls: JSON pointer class to use.\n:type pointercls: Type[JsonPointer]\n\n:return: Patched document object.\n:rtype: dict\n\n>>> doc = {'foo': 'bar'}\n>>> patch = [{'op': 'add', 'path': '/baz', 'value': 'qux'}]\n>>> other = applypatch(doc, patch)\n>>> doc is not other\nTrue\n>>> other == {'foo': 'bar', 'baz': 'qux'}\nTrue\n>>> patch = [{'op': 'add', 'path': '/baz', 'value': 'qux'}]\n>>> applypatch(doc, patch, inplace=True) == {'foo': 'bar', 'baz': 'qux'}\nTrue\n>>> doc == other\nTrue\n\n#### make_patch\n\nGenerates patch by comparing two document objects. Actually is\na proxy to :meth:`JsonPatch.fromdiff` method.\n\n:param src: Data source document object.\n:type src: dict\n\n:param dst: Data source document object.\n:type dst: dict\n\n:param pointercls: JSON pointer class to use.\n:type pointercls: Type[JsonPointer]\n\n>>> src = {'foo': 'bar', 'numbers': [1, 3, 4, 8]}\n>>> dst = {'baz': 'qux', 'numbers': [1, 4, 7]}\n>>> patch = makepatch(src, dst)\n>>> new = patch.apply(src)\n>>> new == dst\nTrue\n\n#### multidict\n\nConvert duplicate keys values to lists.\n\n### DATA\n\nlicense = 'Modified BSD License'\nwebsite = 'https://github.com/stefankoegl/python-json-patch'\nbasestring = (<class 'bytes'>, <class 'str'>)\nunicodeliterals = Feature((2, 6, 0, 'alpha', 2), (3, 0, 0, 'alpha', ...\n\n### VERSION\n\n1.32\n\n### AUTHOR\n\nStefan Kögl <stefan@skoegl.net>\n\n### FILE\n\n/usr/lib/python3/dist-packages/jsonpatch.py\n\n"
        }
    ],
    "structuredContent": {
        "command": "jsonpatch",
        "section": "",
        "mode": "pydoc",
        "summary": "jsonpatch - Apply JSON-Patches (RFC 6902)",
        "synopsis": null,
        "tldr_summary": null,
        "tldr_examples": [],
        "tldr_source": null,
        "flags": [],
        "examples": [],
        "see_also": [],
        "section_outline": [
            {
                "name": "NAME",
                "lines": 2,
                "subsections": []
            },
            {
                "name": "CLASSES",
                "lines": 16,
                "subsections": [
                    {
                        "name": "class AddOperation",
                        "lines": 45
                    },
                    {
                        "name": "class CopyOperation",
                        "lines": 45
                    },
                    {
                        "name": "class DiffBuilder",
                        "lines": 30
                    },
                    {
                        "name": "class InvalidJsonPatch",
                        "lines": 70
                    },
                    {
                        "name": "class JsonPatch",
                        "lines": 143
                    },
                    {
                        "name": "class JsonPatchConflict",
                        "lines": 74
                    },
                    {
                        "name": "class JsonPatchException",
                        "lines": 69
                    },
                    {
                        "name": "class JsonPatchTestFailed",
                        "lines": 71
                    },
                    {
                        "name": "class MoveOperation",
                        "lines": 55
                    },
                    {
                        "name": "class PatchOperation",
                        "lines": 37
                    },
                    {
                        "name": "class RemoveOperation",
                        "lines": 45
                    },
                    {
                        "name": "class ReplaceOperation",
                        "lines": 45
                    },
                    {
                        "name": "class TestOperation",
                        "lines": 45
                    }
                ]
            },
            {
                "name": "FUNCTIONS",
                "lines": 1,
                "subsections": [
                    {
                        "name": "apply_patch",
                        "lines": 31
                    },
                    {
                        "name": "make_patch",
                        "lines": 19
                    },
                    {
                        "name": "multidict",
                        "lines": 2
                    }
                ]
            },
            {
                "name": "DATA",
                "lines": 5,
                "subsections": []
            },
            {
                "name": "VERSION",
                "lines": 2,
                "subsections": []
            },
            {
                "name": "AUTHOR",
                "lines": 2,
                "subsections": []
            },
            {
                "name": "FILE",
                "lines": 3,
                "subsections": []
            }
        ]
    }
}