def str_to_bool(val):
    """
    cast a string to a bool

    Parameters:
        val: the string to cast

    Returns:
        (casted_val, success)
        casted val: the casted value if successful, or None
        success: bool if casting was successful
    """
    if val == 'True':
        return (True, True)
    elif val == 'False':
        return (False, True)
    else:
        return (None, False)