get_direct_submodules
FunctionSource
v_1: list[module] = get_direct_submodules(module: ModuleType, filtered_by_all: bool = True)
Get the submodules/subpackages directly defined in a package.
Arguments
Requires
| Name | Type | Required | |
|---|---|---|---|
module | ModuleType | The package to be analyzed. The submodules/subpackages are detected in it. | |
filtered_by_all | bool | A flag. If specified, will prefer the __all__ value defined in the module when searching members. In this case, any value not in the __all__ list will be ignored. |
Returns
| Name | Type | |
|---|---|---|
v_1 | list[module] | A list of module objects that are direct submodules/subpackages of the given module. If the module is imported from somewhere else, it will not be included. |