Rapidata filters
RapidataFilters #
RapidataFilters Classes
These filters can be added to the order to specifically target a certain group of users.
Note that adding multiple filters to the same order will result in a logical AND operation between the filters.
Warning
This might significantly slow down the number of responses you receive.
Attributes:
Name | Type | Description |
---|---|---|
user_score |
UserScoreFilter
|
Filters for users with a specific user score. |
age |
AgeFilter
|
Filters for users with a specific age. |
country |
CountryFilter
|
Filters for users with a specific country. |
gender |
GenderFilter
|
Filters for users with a specific gender. |
language |
LanguageFilter
|
Filters for users with a specific language. |
not_filter |
NotFilter
|
Inverts the filter. |
or_filter |
OrFilter
|
Combines multiple filters with a logical OR operation. |
Example
from rapidata import CountryFilter, LanguageFilter
filters=[CountryFilter(["US", "DE"]), LanguageFilter(["en"])]
This ensures the order is only shown to users in the US and Germany whose phones are set to English.
Info
The or and not filter support the | and ~ operators respectively. The and is given by the elements in the list.
from rapidata import AgeFilter, LanguageFilter, CountryFilter
filters=[~AgeFilter([AgeGroup.UNDER_18]), CountryFilter(["US"]) | LanguageFilter(["en"])]
This would return users who are not under 18 years old and are from the US or whose phones are set to English.