def kb(units):
    """Boltzmann constant

    Parameters
    ----------
        units : str
            Units for kb. Supported units

            ======  =========================  ==============
            Unit    Description                Value
            ======  =========================  ==============
            J/K     Joule per kelvin           1.38064852e-23
            kJ/K    Kilojoule per kelvin       1.38064852e-26
            eV/K    Electron volt per kelvin   8.6173303e-5
            cal/K   Calorie per kelvin         3.2976230e-24
            kcal/K  Kilocalorie per kelvin     3.2976230e-27
            Eh/K    Hartree per kelvin         3.1668105e-6
            Ha/K    Hartree per kelvin         3.1668105e-6
            ======  =========================  ==============

    Returns
    -------
        kb : float
            Boltzmann constant in appropriate units
    Raises
    ------
        KeyError
            If units is not supported.
    """
    kb_dict = {
        'J/K': 1.38064852e-23,
        'kJ/K': 1.38064852e-26,
        'eV/K': 8.6173303e-5,
        'cal/K': 3.2976230e-24,
        'kcal/K': 3.2976230e-27,
        'Eh/K': 3.1668105e-06,
        'Ha/K': 3.1668105e-06,
    }
    try:
        return kb_dict[units]
    except KeyError:
        err_msg = ('Invalid unit for kb: {}. Use help(pmutt.constants.kb) for '
                   'accepted units.'.format(units))
        raise KeyError(err_msg)