Filter helpers
liquid2.filter.bool_arg
Return True if value is liquid truthy, or False otherwise.
liquid2.filter.decimal_arg
Return val as an int or decimal, or default is casting fails.
liquid2.filter.int_arg
Return val as an int, or default if val can't be cast to an int.
liquid2.filter.mapping_arg
Make sure value is a mapping type.
RAISES | DESCRIPTION |
---|---|
LiquidTypeError
|
If value can't be coerced to a mapping. |
liquid2.filter.math_filter
Raise a LiquidTypeError
if the filter value can not be cast to a number.
liquid2.filter.num_arg
Return val as an int or float, or default if casting fails.
liquid2.filter.sequence_filter
Coerce the left value to sequence.
This is intended to mimic the semantics of the reference implementation's
InputIterator
class.
liquid2.filter.string_filter
A filter function decorator that converts the first argument to a string.
liquid2.filter.with_context
Ensure the wrapped callable is passed a context
keyword argument.