Python JSONPath2 Expressions Module

Expressions used in jsonpath module.

The operator expression module.

class jsonpath2.expressions.operator.AndVariadicOperatorExpression(*args, **kwargs)[source]

The boolean ‘and’ operator expression.

__init__(*args, **kwargs)[source]

Call the super with the ‘and’ boolean method.

_abc_impl = <_abc_data object>
class jsonpath2.expressions.operator.BinaryOperatorExpression(token: str, callback: Callable[[object, object], bool], left_node_or_value: Union[jsonpath2.node.Node, object], right_node_or_value: Union[jsonpath2.node.Node, object])[source]

Binary operator expression.

__init__(token: str, callback: Callable[[object, object], bool], left_node_or_value: Union[jsonpath2.node.Node, object], right_node_or_value: Union[jsonpath2.node.Node, object])[source]

Constructor save the left right and token.

_abc_impl = <_abc_data object>
evaluate(root_value: object, current_value: object) → bool[source]

Evaluate the left and right values given the token.

class jsonpath2.expressions.operator.ContainsBinaryOperatorExpression(*args, **kwargs)[source]

Expression to handle in.

__init__(*args, **kwargs)[source]

Construct the binary operator with appropriate method.

_abc_impl = <_abc_data object>
class jsonpath2.expressions.operator.EqualBinaryOperatorExpression(*args, **kwargs)[source]

Binary Equal operator expression.

__init__(*args, **kwargs)[source]

Constructor with the right function.

_abc_impl = <_abc_data object>
class jsonpath2.expressions.operator.GreaterThanBinaryOperatorExpression(*args, **kwargs)[source]

Expression to handle greater than.

__init__(*args, **kwargs)[source]

Construct the binary operator with appropriate method.

_abc_impl = <_abc_data object>
class jsonpath2.expressions.operator.GreaterThanOrEqualToBinaryOperatorExpression(*args, **kwargs)[source]

Expression to handle greater than or equal.

__init__(*args, **kwargs)[source]

Construct the binary operator with appropriate method.

_abc_impl = <_abc_data object>
class jsonpath2.expressions.operator.LessThanBinaryOperatorExpression(*args, **kwargs)[source]

Expression to handle less than.

__init__(*args, **kwargs)[source]

Construct the binary operator with appropriate method.

_abc_impl = <_abc_data object>
class jsonpath2.expressions.operator.LessThanOrEqualToBinaryOperatorExpression(*args, **kwargs)[source]

Expression to handle less than or equal.

__init__(*args, **kwargs)[source]

Construct the binary operator with appropriate method.

_abc_impl = <_abc_data object>
class jsonpath2.expressions.operator.NotEqualBinaryOperatorExpression(*args, **kwargs)[source]

Binary Equal operator expression.

__init__(*args, **kwargs)[source]

Constructor with the right function.

_abc_impl = <_abc_data object>
class jsonpath2.expressions.operator.NotUnaryOperatorExpression(*args, **kwargs)[source]

Unary class to handle the ‘not’ expression.

__init__(*args, **kwargs)[source]

Call the unary operator expression with the right method.

_abc_impl = <_abc_data object>
class jsonpath2.expressions.operator.OperatorExpression[source]

Basic operator expression object.

_abc_impl = <_abc_data object>
evaluate(root_value: object, current_value: object) → bool[source]

Abstract method to evaluate the expression.

class jsonpath2.expressions.operator.OrVariadicOperatorExpression(*args, **kwargs)[source]

The boolean ‘or’ operator expression.

__init__(*args, **kwargs)[source]

Call the super with the ‘or’ boolean method.

_abc_impl = <_abc_data object>
class jsonpath2.expressions.operator.UnaryOperatorExpression(token: str, callback: Callable[[bool], bool], expression: jsonpath2.expression.Expression)[source]

Unary operator expression base class.

__init__(token: str, callback: Callable[[bool], bool], expression: jsonpath2.expression.Expression)[source]

Save the callback operator the token and expression.

_abc_impl = <_abc_data object>
evaluate(root_value: object, current_value: object) → bool[source]

Evaluate the unary expression.

class jsonpath2.expressions.operator.VariadicOperatorExpression(token: str, callback: Callable[[List[bool]], bool], expressions: List[jsonpath2.expression.Expression] = None)[source]

Base class to handle boolean expressions of variadic type.

__init__(token: str, callback: Callable[[List[bool]], bool], expressions: List[jsonpath2.expression.Expression] = None)[source]

Save the operator token, callback and the list of expressions.

_abc_impl = <_abc_data object>
evaluate(root_value: object, current_value: object) → bool[source]

Evaluate the expressions against the boolean callback.

Some expression module.

class jsonpath2.expressions.some.SomeExpression(next_node_or_value: Union[jsonpath2.node.Node, object])[source]

The some expression class.

__init__(next_node_or_value: Union[jsonpath2.node.Node, object])[source]

Save the next node.

_abc_impl = <_abc_data object>
evaluate(root_value: object, current_value: object) → bool[source]

Evaluate the next node.