filters

class pikos.filters.on_value.OnValue(field, *args)[source]

Bases: object

A record filter that returns True if record has a specific value.

field = str

The field to check for change.

values

A list of values to use for the filtering.

Note

This filter only works with nametuple like records.

__init__(field, *args)[source]

Initialize the filter class.

Parameters:
  • field (str) – The field to check for change
  • *args – A list of values to look for.
__call__(record)[source]

Check for the value in the field.


class pikos.filters.on_change.OnChange(field)[source]

Bases: object

A record filter that checks if the record field has changed.

A copy of the field value is stored in the object and compared against new values. On value changed the object returns True.

field = str

The field to check for change.

previous

Holds the value of the field.

Note

  • Filters and recorders can be shared between monitors. The filter however is not aware of ownership so use with care when sharing the same instance.
  • This filter only works with nametuple like records.
__init__(field)[source]

Initialize the filter class.

Parameters:field (str) – The field to check for change
__call__(record)[source]

Check if the field in the new record has changed.