hydraclick
==========

.. py:module:: hydraclick


Submodules
----------

.. toctree::
   :maxdepth: 1

   /autoapi/hydraclick/__main__/index
   /autoapi/hydraclick/core/index
   /autoapi/hydraclick/display_config/index
   /autoapi/hydraclick/options/index
   /autoapi/hydraclick/run/index
   /autoapi/hydraclick/terminal_effects/index
   /autoapi/hydraclick/version/index


Functions
---------

.. autoapisummary::

   hydraclick.set_terminal_effect
   hydraclick.hydra_command


Package Contents
----------------

.. py:function:: set_terminal_effect(terminal_effect)

   Set a terminal effect animation for displaying help in Click commands.

   This function applies a patch to the Click `parse_args` and `get_help_option`
   methods, so the help message is displayed with the specified terminal effect.

   :param terminal_effect: A callable that renders the terminal effect.
   :type terminal_effect: Callable

   .. rubric:: Example

   >>> set_terminal_effect(display_terminal_effect)


.. py:function:: hydra_command(config_path = None, config_name = 'config', version_base = None, as_kwargs = False, preprocess_config = None, print_config = True, resolve = True, use_flogging = True, terminal_effect = omegaconf.MISSING, **flogging_kwargs)

   Integrate Hydra's configuration management capabilities with a Click-based CLI.

   :param config_path: The path to the configuration directory.             If not specified, the default directory is used.
   :type config_path: str | Path | None, optional
   :param config_name: The name of the configuration file             (without the `.yaml` or `.yml` extension). Defaults to `"config"`.
   :type config_name: str | None, optional
   :param version_base: The base version of the configuration.             Defaults to `None`.
   :type version_base: str | None, optional
   :param as_kwargs: The mode in which to run the function.             If `True`, the function is run with the configuration as keyword arguments. In             this case the configuration is converted to a dictionary before passing it to the             function. Defaults to `False`.
   :type as_kwargs: bool, optional
   :param preprocess_config: A function to             preprocess the configuration before passing it to the main function.             Defaults to `None`.
   :type preprocess_config: Callable[[DictConfig], DictConfig] | None, optional
   :param print_config: Whether to print the configuration before             running the function. Defaults to `True`.
   :type print_config: bool, optional
   :param resolve: Whether to resolve the configuration before running             the function. Defaults to `True`.
   :type resolve: bool, optional
   :param use_flogging: Whether to use the `flogging` library for structured             logging. Defaults to `True`.
   :type use_flogging: bool, optional
   :param terminal_effect: The terminal effect function to use when             rendering the command help.
   :type terminal_effect: Callable | None, optional
   :param \*\*flogging_kwargs: Additional keyword arguments to pass to the             `flogging.setup` function.
   :type \*\*flogging_kwargs: Any, optional

   :returns: A Click-compatible command function that can be used as a CLI command.
   :rtype: Callable

   .. rubric:: Notes

   - The `command_api` function uses several Hydra and Click decorators to provide             a rich CLI experience.
   - If `use_flogging` is enabled but the `flogging` library is not available,             a warning is logged, and `flogging` is disabled.
   - The `preprocess_config` function, if provided, allows for custom preprocessing of the             configuration before it is passed to the main function.


