cookiecutter_python package¶
Subpackages¶
- cookiecutter_python.backend package
- Subpackages
- cookiecutter_python.backend.error_handling package
- cookiecutter_python.backend.generator package
- cookiecutter_python.backend.hosting_services package
- Submodules
- cookiecutter_python.backend.hosting_services.check_engine module
- cookiecutter_python.backend.hosting_services.check_service module
- cookiecutter_python.backend.hosting_services.check_web_hosting_service module
- cookiecutter_python.backend.hosting_services.checker module
- cookiecutter_python.backend.hosting_services.checkers module
- cookiecutter_python.backend.hosting_services.exceptions module
- cookiecutter_python.backend.hosting_services.extract_name module
- cookiecutter_python.backend.hosting_services.handle_hosting_service_check module
- cookiecutter_python.backend.hosting_services.handler module
- cookiecutter_python.backend.hosting_services.value_extractor module
- cookiecutter_python.backend.hosting_services.web_hosting_service module
- Module contents
- cookiecutter_python.backend.sanitization package
- Submodules
- cookiecutter_python.backend.check_server_result module
- cookiecutter_python.backend.gen_docs_common module
- cookiecutter_python.backend.helpers module
- cookiecutter_python.backend.load_config module
- cookiecutter_python.backend.main module
- cookiecutter_python.backend.post_main module
- cookiecutter_python.backend.pre_main module
- cookiecutter_python.backend.proxy module
- cookiecutter_python.backend.request module
- cookiecutter_python.backend.user_config_proxy module
- Module contents
- Subpackages
- cookiecutter_python.handle package
- cookiecutter_python.hooks package
Submodules¶
cookiecutter_python.cli module¶
Main cookiecutter_python CLI.
cookiecutter_python.cli_handlers module¶
cookiecutter_python.exceptions module¶
cookiecutter_python.utils module¶
- cookiecutter_python.utils.load(interface: Type[T], module: str | None = None) → List[Type[T]][source]¶
Dynamically import all class objects that implement the given interface.
The classes (class objects) are discovered and imported in the namespace, by searching within each module found inside the input ‘dire’ (path) directory.
Each class object is an attribute found in a module’s namespace. We classify an attribute as a (correct) “class to import”, if the following python boolean expression evaluates to True:
isclass(attribute) and issubclass(attribute, interface)
If ‘dire’ is not given then we consider the modules that are inside the same directory as the one where the module of the invoking code resides.
- Parameters:
interface (Type[T]) – the type (ie class) that the imported classes should ‘inherit’ (subclass) from
module (str) – module containing the modules to inspect. Defaults to the same module (directory) as the one where the module of the invoking code resides.