data.filter package

Submodules

data.filter.exceptions module

Defines exceptions that can occur when interacting with data filters

exception data.filter.exceptions.InvalidDataFilter(name, description)

Bases: util.exceptions.ValidationException

Exception indicating that the data filter is invalid

data.filter.filter module

Defines the class for filtering data

class data.filter.filter.DataFilter(filter_list=None, all=True)

Bases: object

Represents a filter that either accepts or denies a set of data values

add_filter(filter_dict)

Adds a filter definition

Parameters:filter_dict (dict) – data filter to add

:raises recipe.definition.exceptions.InvalidDataFilter: If the filter is invalid

is_data_accepted(data)

Indicates whether the given data passes the filter or not

Parameters:data (data.data.data.Data) – The data to check against the filter
Returns:True if the data is accepted, False if the data is denied
Return type:bool
is_filter_equal(data_filter)

Indicates whether the given data filter is equal to this filter or not

Parameters:data_filter (data.filter.filter.DataFilter) – The data filter
Returns:True if the data filter is equal to this one, False otherwise
Return type:bool
validate(interface)

Validates this data filter against the given interface

Parameters:interface (data.interface.interface.Interface) – The interface describing the data that will be passed to the filter
Returns:A list of warnings discovered during validation
Return type:list()

:raises data.filter.exceptions.InvalidDataFilter: If the data filter is invalid

static validate_filter(filter_dict)

Validates a data filter dictionary

Parameters:filter_dict (dict) – data filter to validate

:raises recipe.definition.exceptions.InvalidDataFilter: If the filter is invalid

Returns:Validated filter if the tests pass
Return type:dict

Module contents