pkgutil

Utilities to support packages.

Functions

extend_path(path, name) Extend a package’s path.
find_loader(fullname) Find a PEP 302 “loader” object for fullname
get_data(package, resource) Get a resource from a package.
get_importer(path_item) Retrieve a PEP 302 importer for the given path item
get_loader(module_or_name) Get a PEP 302 “loader” object for module_or_name
iter_importer_modules(*args, **kw)
iter_importers([fullname]) Yield PEP 302 importers for the given module name
iter_modules([path, prefix]) Yields (module_loader, name, ispkg) for all submodules on path, or, if path is None, all top-level modules on sys.path.
iter_zipimport_modules(importer[, prefix])
read_code(stream)
simplegeneric(func) Make a trivial single-dispatch generic function
walk_packages([path, prefix, onerror]) Yields (module_loader, name, ispkg) for all modules recursively on path, or, if path is None, all accessible modules.

Classes

ImpImporter([path]) PEP 302 Importer that wraps Python’s “classic” import algorithm
ImpLoader(fullname, file, filename, etc) PEP 302 Loader that wraps Python’s “classic” import algorithm
ModuleType alias of module
zipimporter Create a new zipimporter instance.