dev.modules#

Module names.

Module Contents#

Functions#

get_package_dir

Get the directory of a package given the top-level module.

get_module_name

Get an unqualified module name.

get_qualified_module_name

Get a fully-qualified module name.

API#

dev.modules.get_package_dir(
package: types.ModuleType,
) pathlib.Path#

Get the directory of a package given the top-level module.

dev.modules.get_module_name(
module: types.ModuleType | importlib.machinery.ModuleSpec | pathlib.Path | str,
) str#

Get an unqualified module name.

Example: get_module_name(__spec__ or __file__).

dev.modules.get_qualified_module_name(
module: types.ModuleType | importlib.machinery.ModuleSpec,
) str#

Get a fully-qualified module name.

Example: get_module_name(__spec__ or __file__).