std_module¶
Standard library module detection utilities.
This module provides :func:is_std_module to determine whether a module
belongs to the Python standard library, using :data:sys.stdlib_module_names
(Python 3.10+).
is_std_module(modname)
cached
¶
Check whether a module belongs to the Python standard library.
Modules without an origin (built-in) are considered stdlib.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
modname
|
The module name to check (dotted paths use the root module). |
required |
Returns:
| Type | Description |
|---|---|
|
True if the module is a stdlib module, False otherwise. |
Example
std_module.is_std_module('os') # True
std_module.is_std_module('numpy') # False
Source code in py_misc_utils/std_module.py
14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 | |