smpl_util.util

Simplified general utilities.

Functions

find_nearest(array, value)

Return the element in array closest to value

find_nearest_index(array, value)

Returns the index of the element in array closest to value

get(key, ddict[, default])

Returns dict[key] if this exists else default.

has(key, ddict)

Checks if the key is in the dict and not None.

rename(old, new[, warning])

Annotation to replace the name of a function argument.

times(s, n)

Concats string s n times.

true(key, ddict)

Checks if the key is in the dict and not None and True.

withify([prefix, sufix, override])

Decorator to add with_ methods to a class.