rapidata 2.25.0__py3-none-any.whl → 2.26.0__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.

Potentially problematic release.


This version of rapidata might be problematic. Click here for more details.

rapidata/__init__.py CHANGED
@@ -1,4 +1,4 @@
1
- __version__ = "2.25.0"
1
+ __version__ = "2.26.0"
2
2
 
3
3
  from .rapidata_client import (
4
4
  RapidataClient,
@@ -8,3 +8,34 @@ class RapidataFilter:
8
8
  @abstractmethod
9
9
  def _to_model(self) -> Any:
10
10
  pass
11
+
12
+ def __or__(self, other):
13
+ """Enable the | operator to create OrFilter combinations."""
14
+ if not isinstance(other, RapidataFilter):
15
+ return NotImplemented
16
+
17
+ from rapidata.rapidata_client.filter.or_filter import OrFilter
18
+
19
+ # If self is already an OrFilter, extend its filters list
20
+ if isinstance(self, OrFilter):
21
+ if isinstance(other, OrFilter):
22
+ return OrFilter(self.filters + other.filters)
23
+ else:
24
+ return OrFilter(self.filters + [other])
25
+ # If other is an OrFilter, prepend self to its filters
26
+ elif isinstance(other, OrFilter):
27
+ return OrFilter([self] + other.filters)
28
+ # Neither is an OrFilter, create a new one
29
+ else:
30
+ return OrFilter([self, other])
31
+
32
+ def __invert__(self):
33
+ """Enable the ~ operator to create NotFilter negations."""
34
+ from rapidata.rapidata_client.filter.not_filter import NotFilter
35
+
36
+ # If self is already a NotFilter, return the original filter (double negation)
37
+ if isinstance(self, NotFilter):
38
+ return self.filter
39
+ # Create a new NotFilter
40
+ else:
41
+ return NotFilter(self)
@@ -33,6 +33,17 @@ class RapidataFilters:
33
33
  ```
34
34
 
35
35
  This ensures the order is only shown to users in the US and Germany whose phones are set to English.
36
+
37
+ Info:
38
+ The or and not filter support the | and ~ operators respectively.
39
+ The and is given by the elements in the list.
40
+
41
+ ```python
42
+ from rapidata import AgeFilter, LanguageFilter, CountryFilter
43
+ filters=[~AgeFilter([AgeGroup.UNDER_18]), CountryFilter(["US"]) | LanguageFilter(["en"])]
44
+ ```
45
+
46
+ This would return users who are not under 18 years old and are from the US or whose phones are set to English.
36
47
  """
37
48
  user_score = UserScoreFilter
38
49
  age = AgeFilter
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.3
2
2
  Name: rapidata
3
- Version: 2.25.0
3
+ Version: 2.26.0
4
4
  Summary: Rapidata package containing the Rapidata Python Client to interact with the Rapidata Web API in an easy way.
5
5
  License: Apache-2.0
6
6
  Author: Rapidata AG
@@ -1,4 +1,4 @@
1
- rapidata/__init__.py,sha256=h35IV8W3cyvTJCT58i-ci0E6ywwLn_GhAOxorAHTgs4,803
1
+ rapidata/__init__.py,sha256=-VgZCDa6OZStviIU7xxYoZBzjVfW72BWMJt0uNsOdkE,803
2
2
  rapidata/api_client/__init__.py,sha256=ueQCSv2aouXRHG6n2VdmXKMWq8_nguUeoA9oV9L8PQ4,27456
3
3
  rapidata/api_client/api/__init__.py,sha256=kxo-WoJb_QrJccktYJgKVVc674eT-scwggMvMZ3Spj8,1211
4
4
  rapidata/api_client/api/campaign_api.py,sha256=1ajX0hSnA4O5GacJLIGkAgorPlNDRVaEZY029Pkutl4,71353
@@ -442,7 +442,7 @@ rapidata/rapidata_client/country_codes/country_codes.py,sha256=ePHqeb7y9DWQZAndd
442
442
  rapidata/rapidata_client/demographic/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
443
443
  rapidata/rapidata_client/demographic/demographic_manager.py,sha256=RE4r6NNAXinNAlRMgAcG4te4pF4whv81xbyAW2V9XMM,1192
444
444
  rapidata/rapidata_client/filter/__init__.py,sha256=SqxlEotA_O1Lgw3Um6VPBE2P5Hw7OUVZRSBbsv1GJbI,514
445
- rapidata/rapidata_client/filter/_base_filter.py,sha256=ytiSyeb9dvNZf93zwgb4PRDzf9ebsAu4wHBn4x49Re0,195
445
+ rapidata/rapidata_client/filter/_base_filter.py,sha256=EytjAqeDX_x3D5WoFwwtr8L2ok5-Ga-JEvkRnkuBQbw,1433
446
446
  rapidata/rapidata_client/filter/age_filter.py,sha256=oRjGY65gE_X8oa0D0XRyvKAb4_Z6XOOaGTWykRSfLFA,739
447
447
  rapidata/rapidata_client/filter/campaign_filter.py,sha256=6ZT11-gub8349QcRwuHt8AcBY18F7BdLRZ2Ch_vjLyU,735
448
448
  rapidata/rapidata_client/filter/country_filter.py,sha256=JqCzxePRizXQbN4YzwLmrx9ozKgw0ra6N_enEq36imI,948
@@ -455,7 +455,7 @@ rapidata/rapidata_client/filter/models/gender.py,sha256=aXg6Kql2BIy8d5d1lCVi1axM
455
455
  rapidata/rapidata_client/filter/new_user_filter.py,sha256=qU7d6cSslGEO_N1tYPS4Ru3cGbQYH2_I5dJPNPHvtCM,369
456
456
  rapidata/rapidata_client/filter/not_filter.py,sha256=I7crEyOCs53uS0VI48s9EqC6PAFfV9EZG3upwFBJwZo,1189
457
457
  rapidata/rapidata_client/filter/or_filter.py,sha256=u6vkXMTG_j15SbY3bkbnXbxJMDgEsH5rdoFLbuoLQmo,1345
458
- rapidata/rapidata_client/filter/rapidata_filters.py,sha256=HaH5QEpSU-0URjoivCU452FMZ0HqGPD2qqbfSDIIqB0,1444
458
+ rapidata/rapidata_client/filter/rapidata_filters.py,sha256=mx_r6rqEtm6pEe8d0hCEamk2nyplzZ9Hp-AlH98IhRU,1910
459
459
  rapidata/rapidata_client/filter/response_count_filter.py,sha256=sDv9Dvy0FbnIQRSAxFGrUf9SIMISTNxnlAQcrFKBjXE,1989
460
460
  rapidata/rapidata_client/filter/user_score_filter.py,sha256=2C78zkWm5TnfkxGbV1ER2xB7s9ynpacaibzyRZKG8Cc,1566
461
461
  rapidata/rapidata_client/logging/__init__.py,sha256=WXXytdvJxZyE84tIFt4DGFqkqjmyyRdWBjET3RCbOVY,101
@@ -524,7 +524,7 @@ rapidata/service/__init__.py,sha256=s9bS1AJZaWIhLtJX_ZA40_CK39rAAkwdAmymTMbeWl4,
524
524
  rapidata/service/credential_manager.py,sha256=FAH9PJreDAw3G9cJ_iwzvz99s9RnFDrxxV0BHb2VYAI,8698
525
525
  rapidata/service/local_file_service.py,sha256=pgorvlWcx52Uh3cEG6VrdMK_t__7dacQ_5AnfY14BW8,877
526
526
  rapidata/service/openapi_service.py,sha256=J07TB4P3cz9KCU7k_fwuMQwGXlq_nJx_m1_xHbZoCg0,4867
527
- rapidata-2.25.0.dist-info/LICENSE,sha256=xx0jnfkXJvxRnG63LTGOxlggYnIysveWIZ6H3PNdCrQ,11357
528
- rapidata-2.25.0.dist-info/METADATA,sha256=nVc2cYGcY7Ql3y1PB1RiMEnIi9PLVXsdJBtYi5OvEmQ,1268
529
- rapidata-2.25.0.dist-info/WHEEL,sha256=b4K_helf-jlQoXBBETfwnf4B04YC67LOev0jo4fX5m8,88
530
- rapidata-2.25.0.dist-info/RECORD,,
527
+ rapidata-2.26.0.dist-info/LICENSE,sha256=xx0jnfkXJvxRnG63LTGOxlggYnIysveWIZ6H3PNdCrQ,11357
528
+ rapidata-2.26.0.dist-info/METADATA,sha256=LCq_MJWKADL3XBFDHUaTNu8pFfCR79H3XaCEbXz08_w,1268
529
+ rapidata-2.26.0.dist-info/WHEEL,sha256=b4K_helf-jlQoXBBETfwnf4B04YC67LOev0jo4fX5m8,88
530
+ rapidata-2.26.0.dist-info/RECORD,,