Skip to content

Filters

formatting...

Grizzly native templating filters that can be used to manipulate variable values where they are used.

b64decode(value)

Base64 decode string value.

Example

Given value of variable "input_value" is "Zm9vYmFy"
Then log message "input_value: {{ input_value | b64decode }}"

Arguments

Name Type Description Default
value str

value to base64 encode

required

b64encode(value)

Base64 encode string value.

Example

Given value of variable "input_value" is "foobar"
Then log message "input_value (base64): {{ input_value | b64encode }}"

Arguments

Name Type Description Default
value str

value to base64 encode

required

fromtestdata(value)

Convert testdata object to a dictionary.

Nested testdata is a namedtuple object, e.g. AtomicCsvReader.test, where column values are accessed with AtomicCsvReader.test.header1. If anything should be done for the whole row/item it must be converted to a dictionary.

Example

Given value of variable "AtomicCsvReader.test" is "test.csv"

Then log message "test={{ AtomicCsvReader.test | fromtestdata | stringify }}"

Arguments

Name Type Description Default
value NamedTuple

testdata objekt

required

literal_eval(value)

Evaluate python objects serialized as strings.

Returns the string as the actual python object.

Example

Given value of variable "value" is "{'hello': 'world'}"
Then log message "value: {{ value | literal_eval }}"

Arguments

Name Type Description Default
value str

string representation of python object

required

stringify(value)

Convert python object to JSON string.

Convert any (valid) python object to a JSON string.

Example

Given value of variable "AtomicCsvReader.test" is "test.csv"

Then log message "test={{ AtomicCsvReader.test | fromtestdata | stringify }}"

Arguments

Name Type Description Default
value JsonSerializable

value to convert to JSON string

required