There are cases in which we have to receive a boolean value in params to fill up an object. I have came through an idea of doing this, following utility method will help you doing this:
def str2bool(value):
"""
convert string to bool
"""
if value:
return value.lower() in ("true",)
else: