Jinja
Output text using a jinja template.
Makes use of a Jinja template to create a description, title, or summary based on your data.
info
Jinja templates do not allow variables with spaces. This wrangle automatically replaces spaces in column headers with underscores, so use underscores instead of spaces when referencing columns in the template.
Parameters
| Name | Description | Accepted Values | Default | Required |
|---|---|---|---|---|
| I/O | ||||
output | Name of the column to be output to. | array | — | Yes |
input | Specify a name of column containing a dictionary of elements to be used in jinja template. Otherwise, the column headers will be used as keys. | string, null | null | No |
| Options | ||||
template | A dictionary which defines the template/location as well as the form which the template is input. If any keys use a space, they must be replaced with an underscore. Note: spaces within column names are replaced by underscores (_). | object | — | Yes |
| Conditions | ||||
if | Condition that determines whether the wrangle runs as a whole. Recipe variables may be referenced with ${variable}. | string | — | No |
where | Filter rows before applying the wrangle using SQL-like criteria, such as column1 = 123 OR column2 = 'abc'. | string | — | No |
where_params | Values used with where for parameterized criteria. Uses SQLite placeholder syntax such as ? or :name. | array, object | — | No |
Examples
wrangles:
- create.jinja:
output: Description
template:
string: |
This is a {{ Brand }} {{ Item_Type }} that is {{ Size }}
| Size | Brand | Item Type |
|---|---|---|
| 10mm | SKF | ball bearing |
| 15mm | Timken | bearing seal |
| Description |
|---|
| This is a SKF ball bearing that is 10mm |
| This is a Timken bearing seal that is 15mm |
Using | in YAML denotes a multi-line string that preserves line breaks. Use > for a multi-line string when line breaks should not be preserved.
Access
| Requirement | Value |
|---|---|
| AI-powered | No |
| Requires WrangleWorks account | No |
| Requires subscription | No |
| Requires external API key | No |
Technical details
| Field | Value |
|---|---|
| Catalog ID | 18 |
| Catalog key | create.jinja |
| Recipe key | create.jinja |
| Catalog status | active |
| Lifecycle status | active |
| Recipe Writer eligible | Yes |
| Namespace | create |
| Documentation group | create |
| Aliases | None |
| Runtime symbol | wrangles.recipe_wrangles.create.jinja |
| Legacy UUID | 10fc6709-16d4-4eab-8f56-6cb5d170ea66 |
Sources