Return a list of all public objects within the given module Parameters ---------- module : str The module to parse for public objects Returns ------- list[str] A list of object names that exist within the given module Example ------- >>> __all_
(module: str)
| 326 | |
| 327 | |
| 328 | def get_module_objects(module: str) -> list[str]: |
| 329 | """ Return a list of all public objects within the given module |
| 330 | |
| 331 | Parameters |
| 332 | ---------- |
| 333 | module : str |
| 334 | The module to parse for public objects |
| 335 | |
| 336 | Returns |
| 337 | ------- |
| 338 | list[str] |
| 339 | A list of object names that exist within the given module |
| 340 | |
| 341 | Example |
| 342 | ------- |
| 343 | >>> __all__ = get_module_objects(__name__) |
| 344 | ["foo", "bar", "baz"] |
| 345 | """ |
| 346 | return [name_ for name_, obj in inspect.getmembers(sys.modules[module]) |
| 347 | if getattr(obj, "__module__", None) == module |
| 348 | and not name_.startswith("_")] |
| 349 | |
| 350 | |
| 351 | def convert_to_secs(*args: int) -> int: |
no outgoing calls