- str2bool(value)¶
Parse a string into a boolean value.
The function recognizes the following strings, case insensitively:
True
False
“True”
“False”
“T”
“F”
“1”
“0”
“Yes”
“No”
“Y”
“N”
- Parameters:
value (
str) – The boolean string value to parse.- Raises:
ValueError – If the string is not a valid (recognized) boolean value.
- Return type:
bool- Returns:
The boolean value based on the string content.