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