pydoc.ispackage()

pydoc.ispackage(path)[source]

Guess whether a path refers to a package directory.