coco_pipe.report.engine

Manages the Jinja2 environment and template loading for the report module.

Attributes

Functions

_create_env(→ jinja2.Environment)

Create and configure the Jinja2 environment.

get_env(→ jinja2.Environment)

Get or create the global Jinja2 environment.

render_template(→ str)

Render a specific template with the provided context.

Module Contents

coco_pipe.report.engine.MODULE_DIR
coco_pipe.report.engine.TEMPLATE_DIR
coco_pipe.report.engine._create_env() jinja2.Environment[source]

Create and configure the Jinja2 environment.

coco_pipe.report.engine._ENV: jinja2.Environment | None = None
coco_pipe.report.engine.get_env() jinja2.Environment[source]

Get or create the global Jinja2 environment.

coco_pipe.report.engine.render_template(template_name: str, **context: Any) str[source]

Render a specific template with the provided context.

Parameters:
  • template_name (str) – Name of the template file in coco_pipe/report/templates/.

  • **context (dict) – Variables to pass to the template.

Returns:

Rendered HTML string.

Return type:

str