python-sdk-local 0.0.143__tar.gz → 0.0.145__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 (20) hide show
  1. {python_sdk_local-0.0.143 → python_sdk_local-0.0.145}/PKG-INFO +1 -1
  2. {python_sdk_local-0.0.143 → python_sdk_local-0.0.145}/pyproject.toml +1 -1
  3. {python_sdk_local-0.0.143 → python_sdk_local-0.0.145}/python_sdk_local/src/http_response.py +1 -0
  4. {python_sdk_local-0.0.143 → python_sdk_local-0.0.145}/python_sdk_local/src/our_object.py +1 -0
  5. python_sdk_local-0.0.145/python_sdk_local/src/service_response.py +55 -0
  6. {python_sdk_local-0.0.143 → python_sdk_local-0.0.145}/python_sdk_local.egg-info/PKG-INFO +1 -1
  7. {python_sdk_local-0.0.143 → python_sdk_local-0.0.145}/python_sdk_local.egg-info/SOURCES.txt +1 -0
  8. {python_sdk_local-0.0.143 → python_sdk_local-0.0.145}/setup.py +1 -1
  9. {python_sdk_local-0.0.143 → python_sdk_local-0.0.145}/README.md +0 -0
  10. {python_sdk_local-0.0.143 → python_sdk_local-0.0.145}/python_sdk_local/src/__init__.py +0 -0
  11. {python_sdk_local-0.0.143 → python_sdk_local-0.0.145}/python_sdk_local/src/constants.py +0 -0
  12. {python_sdk_local-0.0.143 → python_sdk_local-0.0.145}/python_sdk_local/src/item.py +0 -0
  13. {python_sdk_local-0.0.143 → python_sdk_local-0.0.145}/python_sdk_local/src/unified_json.py +0 -0
  14. {python_sdk_local-0.0.143 → python_sdk_local-0.0.145}/python_sdk_local/src/utilities.py +0 -0
  15. {python_sdk_local-0.0.143 → python_sdk_local-0.0.145}/python_sdk_local/src/valid_json_versions.py +0 -0
  16. {python_sdk_local-0.0.143 → python_sdk_local-0.0.145}/python_sdk_local/src/validate_environment.py +0 -0
  17. {python_sdk_local-0.0.143 → python_sdk_local-0.0.145}/python_sdk_local.egg-info/dependency_links.txt +0 -0
  18. {python_sdk_local-0.0.143 → python_sdk_local-0.0.145}/python_sdk_local.egg-info/requires.txt +0 -0
  19. {python_sdk_local-0.0.143 → python_sdk_local-0.0.145}/python_sdk_local.egg-info/top_level.txt +0 -0
  20. {python_sdk_local-0.0.143 → python_sdk_local-0.0.145}/setup.cfg +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: python-sdk-local
3
- Version: 0.0.143
3
+ Version: 0.0.145
4
4
  Summary: PyPI Package for Circles Python SDK Local Python
5
5
  Home-page: https://github.com/circles-zone/python-sdk-local-python-package
6
6
  Author: Circles
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
4
4
 
5
5
  [tool.poetry]
6
6
  name = "python-sdk-local"
7
- version = "0.0.76" # https://pypi.org/project/python-sdk-local
7
+ version = "0.0.77" # https://pypi.org/project/python-sdk-local
8
8
  description = "python-sdk-local Python Package"
9
9
  readme = "README.md"
10
10
  authors = [
@@ -46,6 +46,7 @@ def get_request_parameters_from_event(event: dict) -> dict:
46
46
 
47
47
  # TODO: move everything related to serverless to another file
48
48
  # TODO: test
49
+ # TODO Do we use is_validate_user_jwt? Where? Is it mandatory/neede?
49
50
  def handler_decorator(logger, is_validate_user_jwt: bool = True):
50
51
  """Decorator for AWS Lambda handler functions. It wraps the handler function with logging and error handling.
51
52
  Usage:
@@ -6,6 +6,7 @@ from python_sdk_remote.mini_logger import MiniLogger as logger
6
6
 
7
7
 
8
8
  # TODO Where are we using it? Shall we extend the usage of OurObject as the father of all our entities?
9
+ # TODO Why we removed the metaclass=ABCMetaLogger?
9
10
  # class OurObject(ABC, metaclass=ABCMetaLogger):
10
11
  class OurObject(ABC):
11
12
  def __init__(self, **kwargs):
@@ -0,0 +1,55 @@
1
+ import copy
2
+
3
+
4
+ # TODO: move to python-sdk
5
+ class ServiceResponse:
6
+ """
7
+ A class to represent a service response.
8
+ """
9
+
10
+ def __init__(
11
+ self,
12
+ message_internal: dict,
13
+ message_external: dict,
14
+ is_success: bool = False,
15
+ data: dict = None,
16
+ ):
17
+ """
18
+ Initializes the ServiceResponse instance.
19
+
20
+ :param status_code: HTTP status code of the response.
21
+ :param message: Message describing the response.
22
+ :param data: Optional data to be included in the response.
23
+ """
24
+ # self.status_code = status_code
25
+
26
+ self.message = copy.deepcopy(message_internal)
27
+ self.message_internal_english = message_internal
28
+ # self.message_external_ml = {"en": message_external, "he": message_external}
29
+
30
+ if isinstance(message_external, dict) and (
31
+ "en" in message_external or "he" in message_external
32
+ ):
33
+ self.message_external_ml = message_external
34
+ else:
35
+ # Original behavior for string input
36
+ self.message_external_ml = {"en": message_external, "he": message_external}
37
+
38
+ self.is_success = is_success
39
+ self.data = copy.deepcopy(data) if data else {}
40
+
41
+ def to_http_response(self) -> dict:
42
+ """
43
+ Converts the ServiceResponse instance to a dictionary format suitable for HTTP response.
44
+
45
+ :return: A dictionary representation of the ServiceResponse instance.
46
+ """
47
+ http_response = {
48
+ # "statusCode": self.status_code,
49
+ "message": self.message,
50
+ "messageInternal": self.message_internal_english,
51
+ "messageExternalMl": self.message_external_ml,
52
+ "isSuccess": self.is_success,
53
+ "data": self.data if self.data else {},
54
+ }
55
+ return http_response
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: python-sdk-local
3
- Version: 0.0.143
3
+ Version: 0.0.145
4
4
  Summary: PyPI Package for Circles Python SDK Local Python
5
5
  Home-page: https://github.com/circles-zone/python-sdk-local-python-package
6
6
  Author: Circles
@@ -11,6 +11,7 @@ python_sdk_local/src/constants.py
11
11
  python_sdk_local/src/http_response.py
12
12
  python_sdk_local/src/item.py
13
13
  python_sdk_local/src/our_object.py
14
+ python_sdk_local/src/service_response.py
14
15
  python_sdk_local/src/unified_json.py
15
16
  python_sdk_local/src/utilities.py
16
17
  python_sdk_local/src/valid_json_versions.py
@@ -7,7 +7,7 @@ package_dir = PACKAGE_NAME.replace("-", "_")
7
7
  # python -m build needs pyproject.toml or setup.py
8
8
  setuptools.setup(
9
9
  name=PACKAGE_NAME,
10
- version='0.0.143', # https://pypi.org/project/python-sdk-local/
10
+ version='0.0.145', # https://pypi.org/project/python-sdk-local/
11
11
  author="Circles",
12
12
  author_email="info@circlez.ai",
13
13
  description="PyPI Package for Circles Python SDK Local Python",