tcex.tcex_data_filter module

Data Filter Module

class tcex.tcex_data_filter.DataFilter(tcex, data)[source]

Bases: object

Filter Single Level List of Dictionaries (JSON Object)

_build_indexes()[source]

Build indexes from data for fast filtering of data.

Building indexes of data when possible. This is only supported when dealing with a List of Dictionaries with String values.

filter_data(field, filter_value, filter_operator, field_converter=None)[source]

Filter the data given the provided.

Parameters:
  • field (string) – The field to filter on.
  • filter_value (string | list) – The value to match.
  • filter_operator (string) – The operator for comparison.
  • field_converter (method) – A method used to convert the field before comparison.
Returns:

List of matching data objects

Return type:

(set)

operator

Supported Filter Operators

  • EQ - Equal To
  • NE - Not Equal To
  • GT - Greater Than
  • GE - Greater Than or Equal To
  • LT - Less Than
  • LE - Less Than or Equal To
  • SW - Starts With
  • IN - In String or Array
  • NI - Not in String or Array
static results(data)[source]

Results

class tcex.tcex_data_filter.DataObj(data)[source]

Bases: object

Data Object

__str__()[source]

The data as a string

data

The data value