2023-03-08 23:39:33 +00:00
|
|
|
from benedict.exceptions import ExtrasRequireModuleNotFoundError
|
|
|
|
|
|
|
|
__all__ = [
|
2023-06-17 20:30:03 +00:00
|
|
|
"require_parse",
|
2023-03-08 23:39:33 +00:00
|
|
|
"require_s3",
|
|
|
|
"require_toml",
|
|
|
|
"require_xls",
|
|
|
|
"require_xml",
|
|
|
|
"require_yaml",
|
|
|
|
]
|
|
|
|
|
|
|
|
|
2023-06-17 20:30:03 +00:00
|
|
|
def _require_optional_dependencies(*, target, installed):
|
2023-03-08 23:39:33 +00:00
|
|
|
if not installed:
|
|
|
|
raise ExtrasRequireModuleNotFoundError(target=target)
|
|
|
|
|
|
|
|
|
2023-06-17 20:30:03 +00:00
|
|
|
def require_parse(*, installed):
|
|
|
|
_require_optional_dependencies(target="parse", installed=installed)
|
|
|
|
|
|
|
|
|
2023-03-08 23:39:33 +00:00
|
|
|
def require_s3(*, installed):
|
2023-06-17 20:30:03 +00:00
|
|
|
_require_optional_dependencies(target="s3", installed=installed)
|
2023-03-08 23:39:33 +00:00
|
|
|
|
|
|
|
|
|
|
|
def require_toml(*, installed):
|
2023-06-17 20:30:03 +00:00
|
|
|
_require_optional_dependencies(target="toml", installed=installed)
|
2023-03-08 23:39:33 +00:00
|
|
|
|
|
|
|
|
|
|
|
def require_xls(*, installed):
|
2023-06-17 20:30:03 +00:00
|
|
|
_require_optional_dependencies(target="xls", installed=installed)
|
2023-03-08 23:39:33 +00:00
|
|
|
|
|
|
|
|
|
|
|
def require_xml(*, installed):
|
2023-06-17 20:30:03 +00:00
|
|
|
_require_optional_dependencies(target="xml", installed=installed)
|
2023-03-08 23:39:33 +00:00
|
|
|
|
|
|
|
|
|
|
|
def require_yaml(*, installed):
|
2023-06-17 20:30:03 +00:00
|
|
|
_require_optional_dependencies(target="yaml", installed=installed)
|