project_config.plugins.jmespath module
JMESPath expressions plugin.
- exception project_config.plugins.jmespath.JMESPathError(message: str)[source]
Bases:
project_config.exceptions.ProjectConfigException
Class to wrap all JMESPath errors of the plugin.
- class project_config.plugins.jmespath.JMESPathPlugin[source]
Bases:
object
- static JMESPathsMatch(value: List[List[Any]], 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']},)}, 'capitalize': {'function': <function _create_simple_transform_function_for_string.<locals>.<lambda>>, 'signature': ({'types': ['string']},)}, 'casefold': {'function': <function _create_simple_transform_function_for_string.<locals>.<lambda>>, 'signature': ({'types': ['string']},)}, 'ceil': {'function': <function Functions._func_ceil>, 'signature': ({'types': ['number']},)}, 'center': {'function': <function JMESPathProjectConfigFunctions._func_center>, 'signature': ({'types': ['string']}, {'types': ['number'], 'variadic': True})}, 'contains': {'function': <function Functions._func_contains>, 'signature': ({'types': ['array', 'string']}, {'types': []})}, 'count': {'function': <function JMESPathProjectConfigFunctions._func_count>, 'signature': ({'types': ['string', 'array']}, {'types': [], 'variadic': True})}, 'ends_with': {'function': <function Functions._func_ends_with>, 'signature': ({'types': ['string']}, {'types': ['string']})}, 'enumerate': {'function': <function JMESPathProjectConfigFunctions._func_enumerate>, 'signature': ({'types': ['string', 'array', 'object']},)}, 'find': {'function': <function _create_find_function_for_string_or_array.<locals>._wrapper>, 'signature': ({'types': ['string', 'array'], 'variadic': True},)}, 'floor': {'function': <function Functions._func_floor>, 'signature': ({'types': ['number']},)}, 'format': {'function': <function JMESPathProjectConfigFunctions._func_format>, 'signature': ({'types': [], 'variadic': True},)}, 'from_items': {'function': <function JMESPathProjectConfigFunctions._func_from_items>, 'signature': ({'types': ['array']},)}, 'isalnum': {'function': <function _create_is_function_for_string.<locals>.<lambda>>, 'signature': ({'types': ['string']},)}, 'isalpha': {'function': <function _create_is_function_for_string.<locals>.<lambda>>, 'signature': ({'types': ['string']},)}, 'isascii': {'function': <function _create_is_function_for_string.<locals>.<lambda>>, 'signature': ({'types': ['string']},)}, 'isdecimal': {'function': <function _create_is_function_for_string.<locals>.<lambda>>, 'signature': ({'types': ['string']},)}, 'isdigit': {'function': <function _create_is_function_for_string.<locals>.<lambda>>, 'signature': ({'types': ['string']},)}, 'isidentifier': {'function': <function _create_is_function_for_string.<locals>.<lambda>>, 'signature': ({'types': ['string']},)}, 'islower': {'function': <function _create_is_function_for_string.<locals>.<lambda>>, 'signature': ({'types': ['string']},)}, 'isnumeric': {'function': <function _create_is_function_for_string.<locals>.<lambda>>, 'signature': ({'types': ['string']},)}, 'isprintable': {'function': <function _create_is_function_for_string.<locals>.<lambda>>, 'signature': ({'types': ['string']},)}, 'isspace': {'function': <function _create_is_function_for_string.<locals>.<lambda>>, 'signature': ({'types': ['string']},)}, 'istitle': {'function': <function _create_is_function_for_string.<locals>.<lambda>>, 'signature': ({'types': ['string']},)}, 'isupper': {'function': <function _create_is_function_for_string.<locals>.<lambda>>, 'signature': ({'types': ['string']},)}, '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']},)}, 'ljust': {'function': <function _create_just_function_for_string.<locals>.<lambda>>, 'signature': ({'types': ['string']}, {'types': ['number'], 'variadic': True})}, 'lower': {'function': <function _create_simple_transform_function_for_string.<locals>.<lambda>>, 'signature': ({'types': ['string']},)}, 'lstrip': {'function': <function _create_strip_function_for_string.<locals>.<lambda>>, 'signature': ({'types': ['string'], 'variadic': True},)}, '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': []}, {'types': ['string']}, {'types': []})}, 'partition': {'function': <function _create_partition_function_for_string.<locals>.<lambda>>, 'signature': ({'types': ['string']}, {'types': ['string']})}, 'range': {'function': <function JMESPathProjectConfigFunctions._func_range>, 'signature': ({'types': ['number'], 'variadic': True},)}, 'regex_match': {'function': <function JMESPathProjectConfigFunctions._func_regex_match>, 'signature': ({'types': ['string']}, {'types': ['string'], 'variadic': True})}, 'regex_matchall': {'function': <function JMESPathProjectConfigFunctions._func_regex_matchall>, 'signature': ({'types': ['string']}, {'types': ['array-string', 'object']})}, 'regex_search': {'function': <function JMESPathProjectConfigFunctions._func_regex_search>, 'signature': ({'types': ['string']}, {'types': ['string'], 'variadic': True})}, 'regex_sub': {'function': <function JMESPathProjectConfigFunctions._func_regex_sub>, 'signature': ({'types': ['string']}, {'types': ['string']}, {'types': ['string'], 'variadic': True})}, 'removeprefix': {'function': <function _create_removeaffix_function_for_string.<locals>.<lambda>>, 'signature': ({'types': ['string']}, {'types': ['string']})}, 'removesuffix': {'function': <function _create_removeaffix_function_for_string.<locals>.<lambda>>, 'signature': ({'types': ['string']}, {'types': ['string']})}, 'reverse': {'function': <function Functions._func_reverse>, 'signature': ({'types': ['array', 'string']},)}, 'rfind': {'function': <function _create_find_function_for_string_or_array.<locals>._wrapper>, 'signature': ({'types': ['string', 'array'], 'variadic': True},)}, 'rjust': {'function': <function _create_just_function_for_string.<locals>.<lambda>>, 'signature': ({'types': ['string']}, {'types': ['number'], 'variadic': True})}, 'round': {'function': <function JMESPathProjectConfigFunctions._func_round>, 'signature': ({'types': ['number'], 'variadic': True},)}, 'rpartition': {'function': <function _create_partition_function_for_string.<locals>.<lambda>>, 'signature': ({'types': ['string']}, {'types': ['string']})}, 'rsplit': {'function': <function _create_split_function_for_string.<locals>.<lambda>>, 'signature': ({'types': ['string'], 'variadic': True},)}, 'rstrip': {'function': <function _create_strip_function_for_string.<locals>.<lambda>>, 'signature': ({'types': ['string'], 'variadic': True},)}, 'shlex_join': {'function': <function JMESPathProjectConfigFunctions._func_shlex_join>, 'signature': ({'types': ['array-string']},)}, 'shlex_split': {'function': <function JMESPathProjectConfigFunctions._func_shlex_split>, 'signature': ({'types': ['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']})}, 'split': {'function': <function _create_split_function_for_string.<locals>.<lambda>>, 'signature': ({'types': ['string'], 'variadic': True},)}, 'splitlines': {'function': <function JMESPathProjectConfigFunctions._func_splitlines>, 'signature': ({'types': ['string'], 'variadic': True},)}, 'starts_with': {'function': <function Functions._func_starts_with>, 'signature': ({'types': ['string']}, {'types': ['string']})}, 'strip': {'function': <function _create_strip_function_for_string.<locals>.<lambda>>, 'signature': ({'types': ['string'], 'variadic': True},)}, 'sum': {'function': <function Functions._func_sum>, 'signature': ({'types': ['array-number']},)}, 'swapcase': {'function': <function _create_simple_transform_function_for_string.<locals>.<lambda>>, 'signature': ({'types': ['string']},)}, 'title': {'function': <function _create_simple_transform_function_for_string.<locals>.<lambda>>, 'signature': ({'types': ['string']},)}, 'to_array': {'function': <function Functions._func_to_array>, 'signature': ({'types': []},)}, 'to_items': {'function': <function JMESPathProjectConfigFunctions._func_to_items>, 'signature': ({'types': ['object']},)}, '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': []},)}, 'upper': {'function': <function _create_simple_transform_function_for_string.<locals>.<lambda>>, 'signature': ({'types': ['string']},)}, 'values': {'function': <function Functions._func_values>, 'signature': ({'types': ['object']},)}, 'zfill': {'function': <function JMESPathProjectConfigFunctions._func_zfill>, 'signature': ({'types': ['string']}, {'types': ['number']})}}
- _func_capitalize(value)
- _func_casefold(value)
- _func_isalnum(value)
- _func_isalpha(value)
- _func_isascii(value)
- _func_isdecimal(value)
- _func_isdigit(value)
- _func_isidentifier(value)
- _func_islower(value)
- _func_isnumeric(value)
- _func_isprintable(value)
- _func_isspace(value)
- _func_istitle(value)
- _func_isupper(value)
- _func_ljust(value, width, *args)
- _func_lower(value)
- _func_lstrip(value, *args)
- _func_partition(value, sep)
- _func_removeprefix(value, affix)
- _func_removesuffix(value, affix)
- _func_rjust(value, width, *args)
- _func_rpartition(value, sep)
- _func_rsplit(value, *args)
- _func_rstrip(value, *args)
- _func_split(value, *args)
- _func_strip(value, *args)
- _func_swapcase(value)
- _func_title(value)
- _func_upper(value)
- project_config.plugins.jmespath._compile_JMESPath_expression(expression: str) jmespath.parser.ParsedResult [source]
- project_config.plugins.jmespath._compile_JMESPath_expression_or_error(expression: str) jmespath.parser.ParsedResult [source]
- project_config.plugins.jmespath._compile_JMESPath_or_expected_value_error(expression: str, expected_value: Any) jmespath.parser.ParsedResult [source]
- project_config.plugins.jmespath._compile_JMESPath_or_expected_value_from_other_file_error(expression: str, expected_value_file: str, expected_value_expression: str) jmespath.parser.ParsedResult [source]
- project_config.plugins.jmespath._create_find_function_for_string_or_array(func_prefix: str) Callable[[type, Union[List[Any], str], Any, Any], int] [source]
- project_config.plugins.jmespath._create_is_function_for_string(func_suffix: str) Callable[[type, str], bool] [source]
- project_config.plugins.jmespath._create_just_function_for_string(func_prefix: str) Callable[[type, str, int, Any], str] [source]
- project_config.plugins.jmespath._create_partition_function_for_string(func_prefix: str) Callable[[type, str, str], List[str]] [source]
- project_config.plugins.jmespath._create_removeaffix_function_for_string(func_suffix: str) Callable[[type, str, str], str] [source]
- project_config.plugins.jmespath._create_simple_transform_function_for_string(func_name: str) Callable[[type, str], str] [source]
- project_config.plugins.jmespath._create_split_function_for_string(func_prefix: str) Callable[[type, str, Any], List[str]] [source]
- project_config.plugins.jmespath._create_strip_function_for_string(func_prefix: str) Callable[[type, str], str] [source]
- project_config.plugins.jmespath._evaluate_JMESPath(compiled_expression: jmespath.parser.ParsedResult, instance: Any) Any [source]