distutils import distutils strtobool from distutils.util import strtobool bool('False') # True bool('') # False strtobool('False') # False