Markdown Format | JSON API | MCP Server Tool
Help on module jsonpointer: NAME jsonpointer - Identify specific nodes in a JSON document (RFC 6901) CLASSES builtins.Exception(builtins.BaseException) JsonPointerException builtins.object EndOfList JsonPointer class EndOfList(builtins.object) | EndOfList(list_) | | Result of accessing element "-" of a list | | Methods defined here: | | __init__(self, list_) | Initialize self. See help(type(self)) for accurate signature. | | __repr__(self) | Return repr(self). | | ---------------------------------------------------------------------- | Data descriptors defined here: | | __dict__ | dictionary for instance variables (if defined) | | __weakref__ | list of weak references to the object (if defined) class JsonPointer(builtins.object) | JsonPointer(pointer) | | A JSON Pointer that can reference parts of an JSON document | | Methods defined here: | | __contains__(self, item) | Returns True if self contains the given ptr | | __eq__(self, other) | Compares a pointer to another object | | Pointers can be compared by comparing their strings (or splitted | strings), because no two different parts can point to the same | structure in an object (eg no different number representations) | | __hash__(self) | Return hash(self). | | __init__(self, pointer) | Initialize self. See help(type(self)) for accurate signature. | | contains(self, ptr) | Returns True if self contains the given ptr | | get = resolve(self, doc, default=<object object at 0x7f76b811c9a0>) | | get_part(self, doc, part) | Returns the next step in the correct type | | resolve(self, doc, default=<object object at 0x7f76b811c9a0>) | Resolves the pointer against doc and returns the referenced object | | set(self, doc, value, inplace=True) | Resolve the pointer against the doc and replace the target with value. | | to_last(self, doc) | Resolves ptr until the last step, returns (sub-doc, last-step) | | walk(self, doc, part) | Walks one step in doc and returns the referenced part | | ---------------------------------------------------------------------- | Class methods defined here: | | from_parts(parts) from builtins.type | Constructs a JsonPointer from a list of (unescaped) paths | | >>> JsonPointer.from_parts(['a', '~', '/', 0]).path == '/a/~0/~1/0' | True | | ---------------------------------------------------------------------- | Readonly properties defined here: | | path | Returns the string representation of the pointer | | >>> ptr = JsonPointer('/~0/0/~1').path == '/~0/0/~1' | | ---------------------------------------------------------------------- | Data descriptors defined here: | | __dict__ | dictionary for instance variables (if defined) | | __weakref__ | list of weak references to the object (if defined) class JsonPointerException(builtins.Exception) | Method resolution order: | JsonPointerException | builtins.Exception | builtins.BaseException | builtins.object | | Data descriptors defined here: | | __weakref__ | list of weak references to the object (if defined) | | ---------------------------------------------------------------------- | Methods inherited from builtins.Exception: | | __init__(self, /, *args, **kwargs) | Initialize self. See help(type(self)) for accurate signature. | | ---------------------------------------------------------------------- | Static methods inherited from builtins.Exception: | | __new__(*args, **kwargs) from builtins.type | Create and return a new object. See help(type) for accurate signature. | | ---------------------------------------------------------------------- | Methods inherited from builtins.BaseException: | | __delattr__(self, name, /) | Implement delattr(self, name). | | __getattribute__(self, name, /) | Return getattr(self, name). | | __reduce__(...) | Helper for pickle. | | __repr__(self, /) | Return repr(self). | | __setattr__(self, name, value, /) | Implement setattr(self, name, value). | | __setstate__(...) | | __str__(self, /) | Return str(self). | | with_traceback(...) | Exception.with_traceback(tb) -- | set self.__traceback__ to tb and return self. | | ---------------------------------------------------------------------- | Data descriptors inherited from builtins.BaseException: | | __cause__ | exception cause | | __context__ | exception context | | __dict__ | | __suppress_context__ | | __traceback__ | | args FUNCTIONS escape(s) pairwise(iterable) Transforms a list to a list of tuples of adjacent items s -> (s0,s1), (s1,s2), (s2, s3), ... >>> list(pairwise([])) [] >>> list(pairwise([1])) [] >>> list(pairwise([1, 2, 3, 4])) [(1, 2), (2, 3), (3, 4)] resolve_pointer(doc, pointer, default=<object object at 0x7f76b811c9a0>) Resolves pointer against doc and returns the referenced object >>> obj = {'foo': {'anArray': [ {'prop': 44}], 'another prop': {'baz': 'A string' }}, 'a%20b': 1, 'c d': 2} >>> resolve_pointer(obj, '') == obj True >>> resolve_pointer(obj, '/foo') == obj['foo'] True >>> resolve_pointer(obj, '/foo/another prop') == obj['foo']['another prop'] True >>> resolve_pointer(obj, '/foo/another prop/baz') == obj['foo']['another prop']['baz'] True >>> resolve_pointer(obj, '/foo/anArray/0') == obj['foo']['anArray'][0] True >>> resolve_pointer(obj, '/some/path', None) == None True >>> resolve_pointer(obj, '/a b', None) == None True >>> resolve_pointer(obj, '/a%20b') == 1 True >>> resolve_pointer(obj, '/c d') == 2 True >>> resolve_pointer(obj, '/c%20d', None) == None True set_pointer(doc, pointer, value, inplace=True) Resolves pointer against doc and sets the value of the target within doc. With inplace set to true, doc is modified as long as pointer is not the root. >>> obj = {'foo': {'anArray': [ {'prop': 44}], 'another prop': {'baz': 'A string' }}} >>> set_pointer(obj, '/foo/anArray/0/prop', 55) == {'foo': {'another prop': {'baz': 'A string'}, 'anArray': [{'prop': 55}]}} True >>> set_pointer(obj, '/foo/yet another prop', 'added prop') == {'foo': {'another prop': {'baz': 'A string'}, 'yet another prop': 'added prop', 'anArray': [{'prop': 55}]}} True >>> obj = {'foo': {}} >>> set_pointer(obj, '/foo/a%20b', 'x') == {'foo': {'a%20b': 'x' }} True tee(iterable, n=2, /) Returns a tuple of n independent iterators. unescape(s) DATA __license__ = 'Modified BSD License' __website__ = 'https://github.com/stefankoegl/python-json-pointer' unicode_literals = _Feature((2, 6, 0, 'alpha', 2), (3, 0, 0, 'alpha', ... VERSION 2.0 AUTHOR Stefan Kögl <stefan AT skoegl.net> FILE /usr/lib/python3/dist-packages/jsonpointer.py
Generated by phpMan Author: Che Dong Under GNU General Public License
2026-06-02 05:13 @216.73.216.198 CrawledBy Mozilla/5.0 AppleWebKit/537.36 (KHTML, like Gecko; compatible; ClaudeBot/1.0; +claudebot@anthropic.com)