inspect.ismodule()

inspect.ismodule(object)[source]

Return true if the object is a module.

Module objects provide these attributes:
__doc__ documentation string __file__ filename (missing for built-in modules)