baybe.utils.boolean.strtobool

baybe.utils.boolean.strtobool(val: str)[source]

Convert a string representation of truth to True or False.

Adapted from distutils. True values are y, yes, t, true, on, and 1. False values are n, no, f, false, off, and 0. Raises a ValueError if val is anything else.

Parameters:

val (str) – String to be checked.

Return type:

bool

Returns:

The bool value of the corresponding string representation.

Raises:

ValueError – If val cannot be evaluated to a suitable boolean value.