caoscrawler.transformer_functions module

Definition of default transformer functions.

See https://docs.indiscale.com/caosdb-crawler/converters.html#transform-functions for more information.

caoscrawler.transformer_functions.submatch(in_value: Any, in_parameters: dict)

Substitute the variable if it matches the regexp stored in “match”.

Returns the “in” value if it does NOT match the reg exp of ‘match’. Otherwise (if it matches) the value of ‘then’ stored in the second argument is returned.

caoscrawler.transformer_functions.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

caoscrawler.transformer_functions.replace(in_value: Any, in_parameters: dict)

calls the string ‘replace’ function on the first argument and uses the value of the keys ‘remove’ and ‘insert’ stored in the second argument

caoscrawler.transformer_functions.date_parse(in_value: str, params: dict) str

Transform text so that it is formatted in a way that LinkAhead can understand it.

Parameters:

date_format (-) – A format string using the datetime specificaton: https://docs.python.org/3/library/datetime.html#strftime-and-strptime-format-codes

caoscrawler.transformer_functions.datetime_parse(in_value: str, params: dict) str

Transform text so that it is formatted in a way that LinkAhead can understand it.

Parameters:

datetime_format (-) – A format string using the datetime specificaton: https://docs.python.org/3/library/datetime.html#strftime-and-strptime-format-codes

caoscrawler.transformer_functions.cast_to_int(in_value: Any, params: dict) int

Cast the in_value to int.

Parameters:

parameters. (No)

caoscrawler.transformer_functions.cast_to_float(in_value: Any, params: dict) float

Cast the in_value to float.

Parameters:

parameters. (No)

caoscrawler.transformer_functions.cast_to_bool(in_value: Any, params: dict) bool

Cast the in_value to bool.

This is done by comparing in_value to “True”. Only “true”, “True”, “False” and “false” are accepted as possible values. All other input values raise an error.

Parameters:

parameters. (No)

caoscrawler.transformer_functions.cast_to_str(in_value: Any, params: dict) str

Cast the in_value to str.

Parameters:

parameters. (No)