def str2bool(v): return str(v).lower() in ("yes", "true", "t", "1")
bool(string) # returns true or false