glide.filter module

A home for common filter nodes

Nodes:

  • Filter

  • DictKeyFilter

  • AttributeFilter

class glide.filter.AttributeFilter(name, _log=False, _debug=False, **default_context)[source]

Bases: glide.core.Node

A node that pushes a specific attribute of an object

run(data, attribute)[source]

Given an object, extract and push an attribute

Parameters
  • data – The object to pull the attribute from

  • attribute – The attribute to read from the object

class glide.filter.DictKeyFilter(name, _log=False, _debug=False, **default_context)[source]

Bases: glide.core.Node

A node that pushes a specific value from a dict-like object

run(data, key)[source]

Given a dict-like object, extract and push a key

Parameters
  • data (dict-like) – The dict-like object to extract the value from

  • key (hashable) – The key to extract from data

class glide.filter.Filter(name, _log=False, _debug=False, **default_context)[source]

Bases: glide.core.Node

A node that only pushes if some condition is met

run(data, func, **kwargs)[source]

Subclasses will override this method to implement core node logic