core.config.template_loader

Custom YAML loader with template and include support for jobmon logging configuration.

Classes

TemplateLoader

Custom YAML loader that supports !include and !template directives.

Functions

include_constructor(→ Any)

Include another YAML file.

template_constructor(→ Any)

Reference a template from the templates directory.

load_all_templates(→ Dict[str, Any])

Load all template files from the templates directory.

load_logconfig_with_templates(→ Dict[str, Any])

Load a logconfig file with template support.

load_yaml_with_templates(→ Dict[str, Any])

Convenience function to load any YAML file with template support.

get_core_templates_path(→ str)

Get the absolute path to core templates using package resources.

Module Contents

class core.config.template_loader.TemplateLoader(stream: Any)[source]

Bases: yaml.SafeLoader

Custom YAML loader that supports !include and !template directives.

_root[source]
_templates: Dict[str, Any] | None = None[source]
core.config.template_loader.include_constructor(loader: TemplateLoader, node: yaml.nodes.ScalarNode) Any[source]

Include another YAML file.

core.config.template_loader.template_constructor(loader: TemplateLoader, node: yaml.nodes.ScalarNode) Any[source]

Reference a template from the templates directory.

core.config.template_loader.load_all_templates(config_root: str) Dict[str, Any][source]

Load all template files from the templates directory.

core.config.template_loader.load_logconfig_with_templates(config_path: str) Dict[str, Any][source]

Load a logconfig file with template support.

Supports: - !include path/to/file.yaml - !template template_name - YAML merge operators (<<)

Parameters:

config_path – Path to the main logconfig file

Returns:

Fully resolved configuration dictionary

core.config.template_loader.load_yaml_with_templates(file_path: str) Dict[str, Any][source]

Convenience function to load any YAML file with template support.

core.config.template_loader.get_core_templates_path() str[source]

Get the absolute path to core templates using package resources.