project_config.plugins.jmespath module

JMESPath expressions plugin.

exception project_config.plugins.jmespath.InvalidOperator(operator: str)[source]

Bases: jmespath.exceptions.JMESPathError

exception project_config.plugins.jmespath.JMESPathError(message: str)[source]

Bases: project_config.exceptions.ProjectConfigException

Class to wrap all JMESPath errors of the plugin.

message: str
class project_config.plugins.jmespath.JMESPathPlugin[source]

Bases: object

static JMESPathsMatch(value: List[List[str]], tree: project_config.tree.Tree, rule: project_config.types.Rule) Iterator[Tuple[str, Any]][source]
static ifJMESPathsMatch(value: Dict[str, List[List[str]]], tree: project_config.tree.Tree, rule: project_config.types.Rule) Iterator[Tuple[str, Any]][source]
class project_config.plugins.jmespath.JMESPathProjectConfigFunctions[source]

Bases: jmespath.functions.Functions

JMESPath class to include custom functions.

FUNCTION_TABLE = {'abs': {'function': <function Functions._func_abs>, 'signature': ({'types': ['number']},)}, 'avg': {'function': <function Functions._func_avg>, 'signature': ({'types': ['array-number']},)}, 'ceil': {'function': <function Functions._func_ceil>, 'signature': ({'types': ['number']},)}, 'contains': {'function': <function Functions._func_contains>, 'signature': ({'types': ['array', 'string']}, {'types': []})}, 'ends_with': {'function': <function Functions._func_ends_with>, 'signature': ({'types': ['string']}, {'types': ['string']})}, 'floor': {'function': <function Functions._func_floor>, 'signature': ({'types': ['number']},)}, 'join': {'function': <function Functions._func_join>, 'signature': ({'types': ['string']}, {'types': ['array-string']})}, 'keys': {'function': <function Functions._func_keys>, 'signature': ({'types': ['object']},)}, 'length': {'function': <function Functions._func_length>, 'signature': ({'types': ['string', 'array', 'object']},)}, 'map': {'function': <function Functions._func_map>, 'signature': ({'types': ['expref']}, {'types': ['array']})}, 'max': {'function': <function Functions._func_max>, 'signature': ({'types': ['array-number', 'array-string']},)}, 'max_by': {'function': <function Functions._func_max_by>, 'signature': ({'types': ['array']}, {'types': ['expref']})}, 'merge': {'function': <function Functions._func_merge>, 'signature': ({'types': ['object'], 'variadic': True},)}, 'min': {'function': <function Functions._func_min>, 'signature': ({'types': ['array-number', 'array-string']},)}, 'min_by': {'function': <function Functions._func_min_by>, 'signature': ({'types': ['array']}, {'types': ['expref']})}, 'not_null': {'function': <function Functions._func_not_null>, 'signature': ({'types': [], 'variadic': True},)}, 'op': {'function': <function JMESPathProjectConfigFunctions._func_op>, 'signature': ({'types': ['boolean', 'array', 'object', 'null', 'string', 'number', 'expref']}, {'types': ['string']}, {'types': ['boolean', 'array', 'object', 'null', 'string', 'number', 'expref']})}, 'regex_match': {'function': <function JMESPathProjectConfigFunctions._func_regex_match>, 'signature': ({'types': ['string']}, {'types': ['string']})}, 'regex_matchall': {'function': <function JMESPathProjectConfigFunctions._func_regex_matchall>, 'signature': ({'types': ['string']}, {'types': ['array', 'object']})}, 'regex_search': {'function': <function JMESPathProjectConfigFunctions._func_regex_search>, 'signature': ({'types': ['string']}, {'types': ['string']})}, 'reverse': {'function': <function Functions._func_reverse>, 'signature': ({'types': ['array', 'string']},)}, 'sort': {'function': <function Functions._func_sort>, 'signature': ({'types': ['array-string', 'array-number']},)}, 'sort_by': {'function': <function Functions._func_sort_by>, 'signature': ({'types': ['array']}, {'types': ['expref']})}, 'starts_with': {'function': <function Functions._func_starts_with>, 'signature': ({'types': ['string']}, {'types': ['string']})}, 'sum': {'function': <function Functions._func_sum>, 'signature': ({'types': ['array-number']},)}, 'to_array': {'function': <function Functions._func_to_array>, 'signature': ({'types': []},)}, 'to_number': {'function': <function Functions._func_to_number>, 'signature': ({'types': []},)}, 'to_string': {'function': <function Functions._func_to_string>, 'signature': ({'types': []},)}, 'type': {'function': <function Functions._func_type>, 'signature': ({'types': []},)}, 'values': {'function': <function Functions._func_values>, 'signature': ({'types': ['object']},)}}
_func_op(a: float, operator: str, b: float) bool[source]
_func_regex_match(regex: str, value: str) bool[source]
_func_regex_matchall(regex: str, container: str) bool[source]
project_config.plugins.jmespath._compile_JMESPath(expression: str, expected_value: Any) jmespath.parser.ParsedResult[source]
project_config.plugins.jmespath._compile_JMESPath_expression(expression: str) jmespath.parser.ParsedResult[source]
project_config.plugins.jmespath._evaluate_JMESPath(compiled_expression: jmespath.parser.ParsedResult, expected_value: Any, instance: Dict[str, Any]) Any[source]