from typing import Type


def _dtype(name: str) -> Type:
    """Convert string to a type

    Only ``str``, ``int``, ``bool``, and ``float`` are supported. 

    Parameters
    ----------
    name
        A string representing the type
    """

    if name == 'str':
        return str
    elif name == 'int':
        return int
    elif name == 'bool':
        return bool
    elif name == 'float':
        return float
    else:
        errmsg = 'name must be "str", "int",' +\
                 ' "bool", or "float"'        
        raise ValueError(errmsg)