stems.compat module

External library compatibility

stems.compat.requires_module(module)[source]

Decorator to dependency check at function import time

Parameters

module (str) – Module required for the function

Returns

Returns decorated function if dependency is importable, otherwise returns a dummy-function that will immediately raise an ImportError

Return type

callable