csv_object_reader.filter module

Filter Objects

class csv_object_reader.filter.Filter(field, value=None, invert=False, missing_is_pass=False)[source]

Bases: object

Basic Filter, uses == to compare values.

Parameters:
  • field – name of field to filter on
  • value – required value of the specified field, if None checks that the field exists
  • invert – invert the results of the filter. Ignored if value is None.
  • missing_is_pass – if True and field is not present, pass this entry instead of failing it (the default). Ignored if value is None.
test(entry)[source]

Test the provided entry against this filer.

Parameters:entry – entry to test against the filter.
Returns:True if the entry passes the filter, otherwise False.
class csv_object_reader.filter.RegexFilter(field, value=None, invert=False, missing_is_pass=False)[source]

Bases: csv_object_reader.filter.Filter

Filter which uses regex match to compare values.