reach_commons 0.17.9__tar.gz → 0.18.1__tar.gz
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.
- {reach_commons-0.17.9 → reach_commons-0.18.1}/PKG-INFO +1 -1
- {reach_commons-0.17.9 → reach_commons-0.18.1}/pyproject.toml +1 -1
- {reach_commons-0.17.9 → reach_commons-0.18.1}/reach_commons/reach_base_model.py +3 -0
- {reach_commons-0.17.9 → reach_commons-0.18.1}/reach_commons/redis_manager.py +2 -2
- {reach_commons-0.17.9 → reach_commons-0.18.1}/README.md +0 -0
- {reach_commons-0.17.9 → reach_commons-0.18.1}/reach_commons/__init__.py +0 -0
- {reach_commons-0.17.9 → reach_commons-0.18.1}/reach_commons/app_logging/__init__.py +0 -0
- {reach_commons-0.17.9 → reach_commons-0.18.1}/reach_commons/app_logging/http_logger.py +0 -0
- {reach_commons-0.17.9 → reach_commons-0.18.1}/reach_commons/app_logging/log_deprecated_endpoints.py +0 -0
- {reach_commons-0.17.9 → reach_commons-0.18.1}/reach_commons/app_logging/logger.py +0 -0
- {reach_commons-0.17.9 → reach_commons-0.18.1}/reach_commons/app_logging/logging_config.py +0 -0
- {reach_commons-0.17.9 → reach_commons-0.18.1}/reach_commons/clients/__init__.py +0 -0
- {reach_commons-0.17.9 → reach_commons-0.18.1}/reach_commons/clients/event_processor.py +0 -0
- {reach_commons-0.17.9 → reach_commons-0.18.1}/reach_commons/clients/hubspot.py +0 -0
- {reach_commons-0.17.9 → reach_commons-0.18.1}/reach_commons/clients/outscraper.py +0 -0
- {reach_commons-0.17.9 → reach_commons-0.18.1}/reach_commons/clients/reach_data_bridge.py +0 -0
- {reach_commons-0.17.9 → reach_commons-0.18.1}/reach_commons/clients/reach_ops_api.py +0 -0
- {reach_commons-0.17.9 → reach_commons-0.18.1}/reach_commons/mongo/__init__.py +0 -0
- {reach_commons-0.17.9 → reach_commons-0.18.1}/reach_commons/mongo/customer_persistence.py +0 -0
- {reach_commons-0.17.9 → reach_commons-0.18.1}/reach_commons/mongo/customer_persistence_async.py +0 -0
- {reach_commons-0.17.9 → reach_commons-0.18.1}/reach_commons/mongo/validation/__init__.py +0 -0
- {reach_commons-0.17.9 → reach_commons-0.18.1}/reach_commons/reach_aws/__init__.py +0 -0
- {reach_commons-0.17.9 → reach_commons-0.18.1}/reach_commons/reach_aws/commons.py +0 -0
- {reach_commons-0.17.9 → reach_commons-0.18.1}/reach_commons/reach_aws/dynamo_db.py +0 -0
- {reach_commons-0.17.9 → reach_commons-0.18.1}/reach_commons/reach_aws/exceptions.py +0 -0
- {reach_commons-0.17.9 → reach_commons-0.18.1}/reach_commons/reach_aws/firehose.py +0 -0
- {reach_commons-0.17.9 → reach_commons-0.18.1}/reach_commons/reach_aws/kms.py +0 -0
- {reach_commons-0.17.9 → reach_commons-0.18.1}/reach_commons/reach_aws/s3.py +0 -0
- {reach_commons-0.17.9 → reach_commons-0.18.1}/reach_commons/reach_aws/sqs.py +0 -0
- {reach_commons-0.17.9 → reach_commons-0.18.1}/reach_commons/sms_smart_encoding.py +0 -0
- {reach_commons-0.17.9 → reach_commons-0.18.1}/reach_commons/utils.py +0 -0
- {reach_commons-0.17.9 → reach_commons-0.18.1}/reach_commons/validations.py +0 -0
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
# isort .; black .; poetry build; poetry publish
|
|
2
2
|
[tool.poetry]
|
|
3
3
|
name = "reach_commons"
|
|
4
|
-
version = "0.
|
|
4
|
+
version = "0.18.1"
|
|
5
5
|
description = "Reach Commons is a versatile utility library designed to streamline and enhance development workflows within the Reach ecosystem."
|
|
6
6
|
authors = ["Wilson Moraes <wmoraes@getreach.ai>"]
|
|
7
7
|
license = "MIT"
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
from datetime import date, datetime, time, timezone
|
|
2
|
+
from enum import Enum
|
|
2
3
|
from typing import Any
|
|
3
4
|
|
|
4
5
|
from bson import ObjectId
|
|
@@ -27,6 +28,8 @@ class ReachBaseModel(BaseModel):
|
|
|
27
28
|
return value.isoformat()
|
|
28
29
|
elif isinstance(value, time):
|
|
29
30
|
return value.strftime("%H:%M:%S")
|
|
31
|
+
elif isinstance(value, Enum):
|
|
32
|
+
return value.value
|
|
30
33
|
elif isinstance(value, dict):
|
|
31
34
|
return {k: convert_value(v) for k, v in value.items()}
|
|
32
35
|
elif isinstance(value, list):
|
|
@@ -71,12 +71,12 @@ class RedisManager:
|
|
|
71
71
|
"""
|
|
72
72
|
return self.redis_connection.set(name=name, value=value, nx=nx, ex=ex)
|
|
73
73
|
|
|
74
|
-
def add_if_absent(self, key,
|
|
74
|
+
def add_if_absent(self, key, expire_seconds=300):
|
|
75
75
|
"""
|
|
76
76
|
Insert the key only if it does not exist.
|
|
77
77
|
Returns True if the key was inserted, False otherwise.
|
|
78
78
|
"""
|
|
79
79
|
result = self.redis_connection.set(
|
|
80
|
-
name=key, value=
|
|
80
|
+
name=key, value="1", ex=expire_seconds, nx=True
|
|
81
81
|
)
|
|
82
82
|
return result is True
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{reach_commons-0.17.9 → reach_commons-0.18.1}/reach_commons/app_logging/log_deprecated_endpoints.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{reach_commons-0.17.9 → reach_commons-0.18.1}/reach_commons/mongo/customer_persistence_async.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|