diff --git a/src/caoscrawler/transformer_functions.py b/src/caoscrawler/transformer_functions.py index 5746cb0a91957c7363c935d260dcc7477aa1481b..35da68f55d606d8200844023a407dc3b4e34cd25 100644 --- a/src/caoscrawler/transformer_functions.py +++ b/src/caoscrawler/transformer_functions.py @@ -28,6 +28,9 @@ from typing import Any def ifelse(in_value: Any, in_parameters: dict): + """returns the first argument if it does NOT match the reg exp of 'match' stored in the second + argument, other wise the value of 'then' stored in the second argument is returned. + """ if "match" not in in_parameters or "then" not in in_parameters: raise RuntimeError("Mandatory parameters missing.") if re.match(in_parameters["match"], in_value) is not None: @@ -36,6 +39,9 @@ def ifelse(in_value: Any, in_parameters: dict): def split(in_value: Any, in_parameters: dict): + """calls the string 'split' function on the first argument and uses the value of the key + 'marker' stored in the second argument + """ if "marker" not in in_parameters: raise RuntimeError("Mandatory parameter missing.") if not isinstance(in_value, str):