optional_import¶
-
hcrystalball.utils.
optional_import
(module_path, class_name, caller_namespace)[source]¶ Imports optional dependencies.
Imports class from module if importable, otherwise creates dummy class with the same name as requested class. Dummy class fails on init with ModuleNotFound error for the missing dependencies.