openclean.function.eval.datatype module

Predicates that test whether a given value (or list of values) matches a given data type constraint.

class openclean.function.eval.datatype.Bool(columns, default_value=None, raise_error=False)

Bases: openclean.function.eval.base.Eval

Convert a given value to bool.

class openclean.function.eval.datatype.Datetime(columns, default_value=None, raise_error=False)

Bases: openclean.function.eval.base.Eval

Convert a given value to datetime. Raises an error if the given value cannot be converted to datetime and the raise error flag is True. If the flag is False, a given default value will be returned for thoses values that cannot be converted to datetime.

class openclean.function.eval.datatype.Float(columns, default_value=None, raise_error=False)

Bases: openclean.function.eval.base.Eval

Convert a given value to float. Raises an error if the given value cannot be converted to float and the raise error flag is True. If the flag is False, a given default value will be returned for thoses values that cannot be converted to float.

class openclean.function.eval.datatype.Int(columns, default_value=None, raise_error=False)

Bases: openclean.function.eval.base.Eval

Convert a given value to integer. Raises an error if the given value cannot be converted to integer and the raise error flag is True. If the flag is False, a given default value will be returned for thoses values that cannot be converted to integer.

class openclean.function.eval.datatype.IsDatetime(columns, formats=None, typecast=True)

Bases: openclean.function.eval.base.Eval

Boolean predicate that tests whether a given value or list of values from a data frame row are of type date or can be converted to a date. For value lists the for all flag determines whether all values have to be dates or at least one.

class openclean.function.eval.datatype.IsFloat(columns, typecast=True)

Bases: openclean.function.eval.base.Eval

Boolean predicate that tests whether a given value or list of values from a data frame row are of type float or can be converted to a float value. For value lists the for all flag determines whether all values have to be floats or at least one.

class openclean.function.eval.datatype.IsInt(columns, typecast=True)

Bases: openclean.function.eval.base.Eval

Boolean predicate that tests whether a given value or list of values from a data frame row are of type integer or can be converted to an integer. For value lists the for all flag determines whether all values have to be integer or at least one.

class openclean.function.eval.datatype.IsNaN(columns)

Bases: openclean.function.eval.base.Eval

Boolean predicate that tests whether a given value or list of values from a data frame row are of the special type NaN (not a number).

class openclean.function.eval.datatype.Str(columns)

Bases: openclean.function.eval.base.Eval

Convert a given value to string.