module_to_dict
Convert a module namespace to a Python dictionary.
def module_to_dict(
module: module,
omittable: callable = lambda k: k.startswith("_") or not k.isupper()
) - > dict
Convert a module namespace to a Python dictionary.
Parameters
| Name | Type | Description |
|---|---|---|
| module | module | The Python module object whose namespace attributes will be extracted. |
| omittable | callable = lambda k: k.startswith("_") or not k.isupper() | A predicate function that takes an attribute name and returns True if the attribute should be excluded from the resulting dictionary. |
Returns
| Type | Description |
|---|---|
dict | A dictionary mapping attribute names to their string representations (via repr), containing only the non-omitted members of the module. |