snakeoil.python_namespaces module¶
- snakeoil.python_namespaces.get_submodules_of(root: ModuleType, /, dont_import: Callable[[str], bool] | Container[str] | None = None, ignore_import_failures: Callable[[str], bool] | Container[str] | bool = False, include_root=False) Iterable[ModuleType][source]¶
Visit all submodules of the target via walking the underlying filesystem
This currently cannot work against a frozen python exe (for example), nor source only contained within an egg; it currently just walks the FS. :param root: the module to trace :param dont_import: do not try importing anything in this sequence or dont_import(qualname)
boolean result. Defaults to no filter
- Parameters:
ignore_import_failures – filter of what modules are known to potentially raise an ImportError, and to tolerate those if it occurs. Defaults to tolerating none.
- snakeoil.python_namespaces.import_submodules_of(target: ModuleType, **kwargs) None[source]¶
load all modules of the given namespace.
See get_submodules_of for the kwargs options.