string_to_bool

lab_utils.custom_logging.string_to_bool(s: str)bool[source]

Parses a variety of strings (e.g. ‘true’ or ‘1’) to a boolean.

Parameters

s (str) – The string to parse

Returns

True if s is one of:

  • ’true’

  • ’1’

  • ’t’

  • ’y’

  • ’yes’

  • ’on’

Return type

bool