def convert_to(value: str, cls):
    """
    Attempt to convert a value to a specified type

    :param value: string to convert from
    :param cls: class to convert to
    :return: converted value or ``None``
    """
    try:
        return cls(value)
    except (ValueError, TypeError):
        return None