Skip to content

liquid.filters.standard

module

liquid.filters.standard

Provides standard liquid filters

Classes
Functions
  • append(base, suffix) Append a suffix to a string</>
  • attr(base, prop) Similar as __getattr__() but also works like `getitem()</>
  • ceil(base) Get the ceil of a number</>
  • compact(base) Remove empties from a list</>
  • default(base, deft, allow_false) Return the deft value if base is not set.Otherwise, return base </>
  • divided_by(base, dvdby) Implementation of / or //</>
  • escape_once(base) Escapse html characters only once of the string</>
  • floor(base) Get the floor of a number</>
  • liquid_date(base, fmt) Format a date/datetime</>
  • liquid_map(base, prop) Map a property to a list of objects</>
  • liquid_slice(base, start, length) Slice a list</>
  • minus(base, sep) Implementation of -</>
  • modulo(base, sep) Implementation of %</>
  • newline_to_br(base) Replace newline with <br /></>
  • plus(base, sep) Implementation of +</>
  • prepend(base, prefix) Prepend a prefix to a string</>
  • regex_replace(base, regex, replace, case_sensitive, count) (str) Replace matching regex pattern</>
  • remove(base, string) Remove a substring from a string</>
  • remove_first(base, string) Remove the first substring from a string</>
  • replace_first(base, old, new) Replace the first substring with new string</>
  • sort(base) Get the sorted list</>
  • sort_natural(base) Get the sorted list in a case-insensitive manner</>
  • split(base, sep) Split a string into a listIf the sep is empty, return the list of characters </>
  • strip_html(base) Strip html tags from a string</>
  • strip_newlines(base) Strip newlines from a string</>
  • times(base, sep) Implementation of *</>
  • truncate(base, length, ellipsis) Truncate a string</>
  • truncatewords(base, length, ellipsis) Truncate a string by words</>
  • uniq(base) Get the unique elements from a list</>
  • url_decode(base) Url-decode a string</>
  • url_encode(base) Url-encode a string</>
  • where(base, prop, value) Query a list of objects with a given property value</>
class

liquid.filters.standard.DateTime(dt, fmt)

Date time allows plus/minus operation

Methods
method

__str__() → str

How it is rendered

class

liquid.filters.standard.EmptyDrop()

The EmptyDrop class borrowed from liquid

function

liquid.filters.standard.split(base, sep)

Split a string into a listIf the sep is empty, return the list of characters

function

liquid.filters.standard.append(base, suffix)

Append a suffix to a string

function

liquid.filters.standard.prepend(base, prefix)

Prepend a prefix to a string

function

liquid.filters.standard.times(base, sep)

Implementation of *

function

liquid.filters.standard.minus(base, sep)

Implementation of -

function

liquid.filters.standard.plus(base, sep)

Implementation of +

function

liquid.filters.standard.modulo(base, sep)

Implementation of %

function

liquid.filters.standard.ceil(base)

Get the ceil of a number

function

liquid.filters.standard.floor(base)

Get the floor of a number

function

liquid.filters.standard.liquid_date(base, fmt)

Format a date/datetime

function

liquid.filters.standard.default(base, deft, allow_false=False)

Return the deft value if base is not set.Otherwise, return base

function

liquid.filters.standard.divided_by(base, dvdby)

Implementation of / or //

function

liquid.filters.standard.escape_once(base)

Escapse html characters only once of the string

function

liquid.filters.standard.newline_to_br(base)

Replace newline with <br />

function

liquid.filters.standard.remove(base, string)

Remove a substring from a string

function

liquid.filters.standard.remove_first(base, string)

Remove the first substring from a string

function

liquid.filters.standard.replace_first(base, old, new)

Replace the first substring with new string

function

liquid.filters.standard.sort(base)

Get the sorted list

function

liquid.filters.standard.sort_natural(base)

Get the sorted list in a case-insensitive manner

function

liquid.filters.standard.liquid_slice(base, start, length=1)

Slice a list

function

liquid.filters.standard.strip_html(base)

Strip html tags from a string

function

liquid.filters.standard.strip_newlines(base)

Strip newlines from a string

function

liquid.filters.standard.truncate(base, length, ellipsis='...')

Truncate a string

function

liquid.filters.standard.truncatewords(base, length, ellipsis='...')

Truncate a string by words

function

liquid.filters.standard.uniq(base)

Get the unique elements from a list

function

liquid.filters.standard.url_decode(base)

Url-decode a string

function

liquid.filters.standard.url_encode(base)

Url-encode a string

function

liquid.filters.standard.where(base, prop, value)

Query a list of objects with a given property value

function

liquid.filters.standard.liquid_map(base, prop)

Map a property to a list of objects

function

liquid.filters.standard.attr(base, prop)

Similar as __getattr__() but also works like `getitem()

function

liquid.filters.standard.compact(base)

Remove empties from a list

function

liquid.filters.standard.regex_replace(base, regex, replace='', case_sensitive=False, count=0) → str

Replace matching regex pattern