Python JSONPath2 Subscripts Module

Subscripts module contains the various subscripting classes.

Array Index subscript of the parse tree.

class jsonpath2.subscripts.arrayindex.ArrayIndexSubscript(index: int)[source]

Array index subscript object.

__init__(index: int)[source]

Save the index of the subscript.

_abc_impl = <_abc_data object>
match(root_value: object, current_value: object) → Generator[jsonpath2.node.MatchData, None, None][source]

Match the root value against the current value.

Array slicing module.

class jsonpath2.subscripts.arrayslice.ArraySliceSubscript(start: int = None, end: int = None, step: int = None)[source]

Array slice class for the parse tree.

__init__(start: int = None, end: int = None, step: int = None)[source]

Save the start end and step in the array slice.

_abc_impl = <_abc_data object>
match(root_value: object, current_value: object) → Generator[jsonpath2.node.MatchData, None, None][source]

Match an array slice between values.

Callable subscript.

class jsonpath2.subscripts.callable.CallableSubscript(*args)[source]

Callable subscript object.

__init__(*args)[source]

Initialize the callable subscript object.

_abc_impl = <_abc_data object>
match(root_value: object, current_value: object) → Generator[jsonpath2.node.MatchData, None, None][source]

Match the root value against the current value.

class jsonpath2.subscripts.callable.CharAtCallableSubscript(*args)[source]

charAt(int) callable subscript object.

_abc_impl = <_abc_data object>
class jsonpath2.subscripts.callable.EntriesCallableSubscript(*args)[source]

entries() callable subscript object.

_abc_impl = <_abc_data object>
class jsonpath2.subscripts.callable.KeysCallableSubscript(*args)[source]

keys() callable subscript object.

_abc_impl = <_abc_data object>
class jsonpath2.subscripts.callable.LengthCallableSubscript(*args)[source]

length() callable subscript object.

_abc_impl = <_abc_data object>
class jsonpath2.subscripts.callable.SubstringCallableSubscript(*args)[source]

substring(int[, int]) callable subscript object.

_abc_impl = <_abc_data object>
class jsonpath2.subscripts.callable.ValuesCallableSubscript(*args)[source]

values() callable subscript object.

_abc_impl = <_abc_data object>

Filter parse tree.

class jsonpath2.subscripts.filter.FilterSubscript(expression: jsonpath2.expression.Expression)[source]

Filter subscript in the parse tree.

__init__(expression: jsonpath2.expression.Expression)[source]

Save the filter expression.

_abc_impl = <_abc_data object>
match(root_value: object, current_value: object) → Generator[jsonpath2.node.MatchData, None, None][source]

Match the filter subscript against the current value.

Node.

class jsonpath2.subscripts.node.NodeSubscript(next_node: jsonpath2.node.Node)[source]

Node subscript in the parse tree.

__init__(next_node: jsonpath2.node.Node)[source]

Save the node subscript.

_abc_impl = <_abc_data object>
match(root_value: object, current_value: object) → Generator[jsonpath2.node.MatchData, None, None][source]

Match the node subscript against the current value.

Object index subscript module.

class jsonpath2.subscripts.objectindex.ObjectIndexSubscript(index: str)[source]

Object index subscript part of the jsonpath parse tree.

__init__(index: str)[source]

Save the string index into the json object.

_abc_impl = <_abc_data object>
match(root_value: object, current_value: object) → Generator[jsonpath2.node.MatchData, None, None][source]

Match the current value against the root value.

Wild cart subscript module.

class jsonpath2.subscripts.wildcard.WildcardSubscript[source]

Wild card subscript part of the parse tree.

_abc_impl = <_abc_data object>
match(root_value: object, current_value: object) → Generator[jsonpath2.node.MatchData, None, None][source]

Match the root value against the current value.