Returns a dict of object names and values in a module, while skipping private/internal objects Args: module (ModuleType): Module to extract the objects from. Returns: dict: Dictionary of object names and corresponding values
(module)
| 937 | |
| 938 | |
| 939 | def get_objects_from_module(module): |
| 940 | """ |
| 941 | Returns a dict of object names and values in a module, while skipping private/internal objects |
| 942 | |
| 943 | Args: |
| 944 | module (ModuleType): |
| 945 | Module to extract the objects from. |
| 946 | |
| 947 | Returns: |
| 948 | dict: Dictionary of object names and corresponding values |
| 949 | """ |
| 950 | |
| 951 | objects = {} |
| 952 | for name in dir(module): |
| 953 | if name.startswith("_"): |
| 954 | continue |
| 955 | objects[name] = getattr(module, name) |
| 956 | |
| 957 | return objects |
| 958 | |
| 959 | |
| 960 | class OptionalDependencyNotAvailable(BaseException): |
no outgoing calls
no test coverage detected
searching dependent graphs…