reach_commons 0.14.98__tar.gz → 0.15.0__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.
Files changed (31) hide show
  1. {reach_commons-0.14.98 → reach_commons-0.15.0}/PKG-INFO +1 -1
  2. {reach_commons-0.14.98 → reach_commons-0.15.0}/pyproject.toml +1 -1
  3. {reach_commons-0.14.98 → reach_commons-0.15.0}/reach_commons/reach_base_model.py +8 -1
  4. {reach_commons-0.14.98 → reach_commons-0.15.0}/reach_commons/utils.py +5 -0
  5. {reach_commons-0.14.98 → reach_commons-0.15.0}/README.md +0 -0
  6. {reach_commons-0.14.98 → reach_commons-0.15.0}/reach_commons/__init__.py +0 -0
  7. {reach_commons-0.14.98 → reach_commons-0.15.0}/reach_commons/app_logging/__init__.py +0 -0
  8. {reach_commons-0.14.98 → reach_commons-0.15.0}/reach_commons/app_logging/http_logger.py +0 -0
  9. {reach_commons-0.14.98 → reach_commons-0.15.0}/reach_commons/app_logging/log_deprecated_endpoints.py +0 -0
  10. {reach_commons-0.14.98 → reach_commons-0.15.0}/reach_commons/app_logging/logger.py +0 -0
  11. {reach_commons-0.14.98 → reach_commons-0.15.0}/reach_commons/app_logging/logging_config.py +0 -0
  12. {reach_commons-0.14.98 → reach_commons-0.15.0}/reach_commons/clients/__init__.py +0 -0
  13. {reach_commons-0.14.98 → reach_commons-0.15.0}/reach_commons/clients/event_processor.py +0 -0
  14. {reach_commons-0.14.98 → reach_commons-0.15.0}/reach_commons/clients/hubspot.py +0 -0
  15. {reach_commons-0.14.98 → reach_commons-0.15.0}/reach_commons/clients/outscraper.py +0 -0
  16. {reach_commons-0.14.98 → reach_commons-0.15.0}/reach_commons/clients/reach_data_bridge.py +0 -0
  17. {reach_commons-0.14.98 → reach_commons-0.15.0}/reach_commons/clients/reach_ops_api.py +0 -0
  18. {reach_commons-0.14.98 → reach_commons-0.15.0}/reach_commons/mongo/__init__.py +0 -0
  19. {reach_commons-0.14.98 → reach_commons-0.15.0}/reach_commons/mongo/customer_persistence.py +0 -0
  20. {reach_commons-0.14.98 → reach_commons-0.15.0}/reach_commons/mongo/customer_persistence_async.py +0 -0
  21. {reach_commons-0.14.98 → reach_commons-0.15.0}/reach_commons/mongo/validation/__init__.py +0 -0
  22. {reach_commons-0.14.98 → reach_commons-0.15.0}/reach_commons/reach_aws/__init__.py +0 -0
  23. {reach_commons-0.14.98 → reach_commons-0.15.0}/reach_commons/reach_aws/commons.py +0 -0
  24. {reach_commons-0.14.98 → reach_commons-0.15.0}/reach_commons/reach_aws/dynamo_db.py +0 -0
  25. {reach_commons-0.14.98 → reach_commons-0.15.0}/reach_commons/reach_aws/exceptions.py +0 -0
  26. {reach_commons-0.14.98 → reach_commons-0.15.0}/reach_commons/reach_aws/firehose.py +0 -0
  27. {reach_commons-0.14.98 → reach_commons-0.15.0}/reach_commons/reach_aws/kms.py +0 -0
  28. {reach_commons-0.14.98 → reach_commons-0.15.0}/reach_commons/reach_aws/s3.py +0 -0
  29. {reach_commons-0.14.98 → reach_commons-0.15.0}/reach_commons/reach_aws/sqs.py +0 -0
  30. {reach_commons-0.14.98 → reach_commons-0.15.0}/reach_commons/redis_manager.py +0 -0
  31. {reach_commons-0.14.98 → reach_commons-0.15.0}/reach_commons/validations.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: reach_commons
3
- Version: 0.14.98
3
+ Version: 0.15.0
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
@@ -1,7 +1,7 @@
1
1
  # isort .; black .; poetry build; poetry publish
2
2
  [tool.poetry]
3
3
  name = "reach_commons"
4
- version = "0.14.98"
4
+ version = "0.15.0"
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,4 @@
1
- from datetime import date, datetime, time
1
+ from datetime import date, datetime, time, timezone
2
2
  from typing import Any
3
3
 
4
4
  from bson import ObjectId
@@ -7,6 +7,13 @@ from pydantic.v1 import validator
7
7
  from pydantic_core import core_schema
8
8
 
9
9
 
10
+ class ReachTimezoneModel(BaseModel):
11
+ class Config:
12
+ json_encoders = {
13
+ datetime: lambda v: v.astimezone(timezone.utc).isoformat(timespec="seconds")
14
+ }
15
+
16
+
10
17
  class ReachBaseModel(BaseModel):
11
18
  def model_dump(self, *args, **kwargs):
12
19
  original_dict = super().model_dump(*args, **kwargs)
@@ -3,6 +3,7 @@ import datetime
3
3
  import decimal
4
4
  import functools
5
5
  import json
6
+ import re
6
7
  import warnings
7
8
  import xml.etree.ElementTree as ET
8
9
  from functools import reduce
@@ -233,3 +234,7 @@ def is_valid_email(v):
233
234
 
234
235
  regex = r"^\b[A-Za-z0-9._%+-]+@[A-Za-z0-9.-]+\.[A-Z|a-z]{2,}\b"
235
236
  return re.match(regex, v)
237
+
238
+
239
+ def clean_phone_number(phone_number):
240
+ return re.sub(r"\D", "", phone_number)