Template

class ducktape.template.TemplateRenderer[source]

Bases: object

render(path, **kwargs)[source]

Render a template loaded from a file. template files referenced in file f should be in a sibling directory of f called “templates”.

Parameters:
  • path – path, relative to the search paths, to the template file
  • kwargs – optional override parameters
Returns:

the rendered template

render_template(template, **kwargs)[source]

Render a template using the context of the current object, optionally with overrides.

Parameters:
  • template – the template to render, a Template or a str
  • kwargs – optional override parameters
Returns:

the rendered template