get_template_attribute
Loads a macro (or variable) a template exports. This can be used to invoke a macro from within Python code.
def get_template_attribute(
template_name: str,
attribute: str
) - > t.Any
Loads a macro (or variable) a template exports. This can be used to invoke a macro from within Python code.
Parameters
| Name | Type | Description |
|---|---|---|
| template_name | str | The name of the template to load the attribute from. |
| attribute | str | The name of the variable or macro to access within the template. |
Returns
| Type | Description |
|---|---|
t.Any | The loaded macro or variable from the template. |