reach_commons 0.17.5__py3-none-any.whl → 0.17.7__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.
@@ -70,3 +70,13 @@ class RedisManager:
70
70
  - bool: True if the key was set successfully, False otherwise (especially when nx=True and key already exists).
71
71
  """
72
72
  return self.redis_connection.set(name=name, value=value, nx=nx, ex=ex)
73
+
74
+ def add_if_absent(self, key, value, expire_seconds=300):
75
+ """
76
+ Insert the key only if it does not exist.
77
+ Returns True if the key was inserted, False otherwise.
78
+ """
79
+ result = self.redis_connection.set(
80
+ name=key, value=value, ex=expire_seconds, nx=True
81
+ )
82
+ return result is True
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: reach_commons
3
- Version: 0.17.5
3
+ Version: 0.17.7
4
4
  Summary: Reach Commons is a versatile utility library designed to streamline and enhance development workflows within the Reach ecosystem.
5
5
  License: MIT
6
6
  Author: Wilson Moraes
@@ -15,7 +15,7 @@ Classifier: Programming Language :: Python :: 3.10
15
15
  Classifier: Programming Language :: Python :: 3.11
16
16
  Classifier: Programming Language :: Python :: 3.12
17
17
  Requires-Dist: curlify (==3.0.0)
18
- Requires-Dist: fastapi (==0.115.5)
18
+ Requires-Dist: fastapi (>=0.115.5,<0.116.0)
19
19
  Requires-Dist: pydantic (==2.9.2)
20
20
  Requires-Dist: setuptools (==70.0.0)
21
21
  Requires-Dist: twine (==4.0.2)
@@ -23,10 +23,10 @@ reach_commons/reach_aws/kms.py,sha256=HDJ3lnKm6Jah2asizUDtQErlVSjrcV9lOfBPHzUVgu
23
23
  reach_commons/reach_aws/s3.py,sha256=2MLlDNFx0SROJBpE_KjJefyrB7lMqTlrYuRhSZx4iKs,3945
24
24
  reach_commons/reach_aws/sqs.py,sha256=LKQ42vRJko2HTE8gO_lRvftnstIMI3DeFZakvLUM0BQ,15864
25
25
  reach_commons/reach_base_model.py,sha256=uMmDGjwKTZ3h7f8Pfvc99FCsAt5eZNlUJnLLbB5EqGY,2907
26
- reach_commons/redis_manager.py,sha256=tK-kBw1fO1f-phsxGI-7W_MEtHQsRz7JY9LEN8OBcNY,2600
26
+ reach_commons/redis_manager.py,sha256=59zlSR-xjCWeJgKDLh8d_G3XoTbrDdAaQ_EIYR4aGpI,2955
27
27
  reach_commons/sms_smart_encoding.py,sha256=92y0RmZ0l4ONHpC9qeO5KfViSNq64yE2rc7lhNDSZqE,1241
28
28
  reach_commons/utils.py,sha256=dMgKIGqTgoSItuBI8oz81gKtW3qi21Jkljv9leS_V88,8475
29
29
  reach_commons/validations.py,sha256=jc78boM62S9Z0Ip_nV1z7I983gGpW2Y7vOCQtmia8OU,964
30
- reach_commons-0.17.5.dist-info/METADATA,sha256=L4zciPWQ520LzYohHWfGt2DZusz-_E4FRzn8LCij25g,1860
31
- reach_commons-0.17.5.dist-info/WHEEL,sha256=FMvqSimYX_P7y0a7UY-_Mc83r5zkBZsCYPm7Lr0Bsq4,88
32
- reach_commons-0.17.5.dist-info/RECORD,,
30
+ reach_commons-0.17.7.dist-info/METADATA,sha256=m8wfX8OZYPd5y7fHs1jGVXCrjvIH5rnDWdDgOpJ9opQ,1869
31
+ reach_commons-0.17.7.dist-info/WHEEL,sha256=FMvqSimYX_P7y0a7UY-_Mc83r5zkBZsCYPm7Lr0Bsq4,88
32
+ reach_commons-0.17.7.dist-info/RECORD,,