StringFunction

class aliases.string_function.StringFunction

An Abstract Base Class to represent a function that maps strings to strings

__call__(x)

Call this StringFunction

This function will dispatch to one of the implementations depending on the type of the input argument

Parameters:

x (Union[str, pd.Series, pl.Series, pl.Expr]) – Input String Argument

Return type:

Union[str, pd.Series, pl.Series, pl.Expr]

abstract handle_builtin_str(x)

Implementation of the function for Python builtin strings

Return type:

str

abstract handle_pandas_series(s)

Implementation of the function for Pandas Series with string values

Return type:

pd.Series

abstract handle_polars_expr(e)

Implementation of the function for Polars Expr

Return type:

pl.Expr

abstract handle_polars_series(s)

Implementation of the function for Polars Series with string values

Return type:

pl.Series