python-sdk-local 0.0.154__tar.gz → 0.0.155b3375__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 (21) hide show
  1. {python_sdk_local-0.0.154 → python_sdk_local-0.0.155b3375}/PKG-INFO +1 -2
  2. python_sdk_local-0.0.155b3375/README.md +17 -0
  3. {python_sdk_local-0.0.154 → python_sdk_local-0.0.155b3375}/pyproject.toml +1 -1
  4. {python_sdk_local-0.0.154 → python_sdk_local-0.0.155b3375}/python_sdk_local/src/constants.py +2 -2
  5. {python_sdk_local-0.0.154 → python_sdk_local-0.0.155b3375}/python_sdk_local/src/http_response.py +2 -3
  6. {python_sdk_local-0.0.154 → python_sdk_local-0.0.155b3375}/python_sdk_local/src/our_object.py +3 -1
  7. {python_sdk_local-0.0.154 → python_sdk_local-0.0.155b3375}/python_sdk_local/src/service_response.py +2 -1
  8. {python_sdk_local-0.0.154 → python_sdk_local-0.0.155b3375}/python_sdk_local/src/utilities.py +3 -3
  9. {python_sdk_local-0.0.154 → python_sdk_local-0.0.155b3375}/python_sdk_local.egg-info/PKG-INFO +1 -2
  10. {python_sdk_local-0.0.154 → python_sdk_local-0.0.155b3375}/setup.py +1 -2
  11. python_sdk_local-0.0.154/README.md +0 -11
  12. {python_sdk_local-0.0.154 → python_sdk_local-0.0.155b3375}/python_sdk_local/src/__init__.py +0 -0
  13. {python_sdk_local-0.0.154 → python_sdk_local-0.0.155b3375}/python_sdk_local/src/item.py +0 -0
  14. {python_sdk_local-0.0.154 → python_sdk_local-0.0.155b3375}/python_sdk_local/src/unified_json.py +0 -0
  15. {python_sdk_local-0.0.154 → python_sdk_local-0.0.155b3375}/python_sdk_local/src/valid_json_versions.py +0 -0
  16. {python_sdk_local-0.0.154 → python_sdk_local-0.0.155b3375}/python_sdk_local/src/validate_environment.py +0 -0
  17. {python_sdk_local-0.0.154 → python_sdk_local-0.0.155b3375}/python_sdk_local.egg-info/SOURCES.txt +0 -0
  18. {python_sdk_local-0.0.154 → python_sdk_local-0.0.155b3375}/python_sdk_local.egg-info/dependency_links.txt +0 -0
  19. {python_sdk_local-0.0.154 → python_sdk_local-0.0.155b3375}/python_sdk_local.egg-info/requires.txt +0 -0
  20. {python_sdk_local-0.0.154 → python_sdk_local-0.0.155b3375}/python_sdk_local.egg-info/top_level.txt +0 -0
  21. {python_sdk_local-0.0.154 → python_sdk_local-0.0.155b3375}/setup.cfg +0 -0
@@ -1,12 +1,11 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: python-sdk-local
3
- Version: 0.0.154
3
+ Version: 0.0.155b3375
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
7
7
  Author-email: info@circlez.ai
8
8
  Classifier: Programming Language :: Python :: 3
9
- Classifier: License :: Other/Proprietary License
10
9
  Classifier: Operating System :: OS Independent
11
10
  Description-Content-Type: text/markdown
12
11
  Requires-Dist: requests
@@ -0,0 +1,17 @@
1
+ # TODO: rewrite with more example
2
+
3
+ In serverless, use this decorator:
4
+ ```py
5
+ from python_sdk_local.http_response import handler_decorator
6
+ from logger_local.Logger import Logger
7
+ logger = Logger.create_logger(object=your_logger_object)
8
+ @handler_decorator(logger=logger)
9
+ def my_handler(request_parameters: dict) -> dict:
10
+ # here you can use both camelCase and snake_case keys from request_parameters
11
+ ```
12
+
13
+ TODO vertical_code_chanhes.ps1 PoweShell script to replace 'is_test_data: bool = false' with something like 'data_type: DataType = PROD_DATA'. Run the Script from makec_py.ps1<br>
14
+
15
+ TODO move for example our_object.py to python-sdk-remote but keep it backward compatible and call logger.depreceted()<br>
16
+
17
+ TODO move all code that doesn't need the datbase to python-sdk-remote (sql2code should stay in python-sdk-local)
@@ -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.78" # 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 = [
@@ -7,7 +7,7 @@ OBJECT_TO_INSERT_CODE = {
7
7
  'component_id': PYTHON_SDK_REMOTE_COMPONENT_ID,
8
8
  'component_name': PYTHON_SDK_REMOTE_COMPONENT_NAME,
9
9
  'component_category': LoggerComponentEnum.ComponentCategory.Code.value,
10
- 'developer_email': 'sahar.g@circ.zone'
10
+ 'developer_email_address': 'sahar.g@circ.zone'
11
11
  }
12
12
 
13
13
  OBJECT_TO_INSERT_TEST = {
@@ -15,5 +15,5 @@ OBJECT_TO_INSERT_TEST = {
15
15
  'component_name': PYTHON_SDK_REMOTE_COMPONENT_NAME,
16
16
  'component_category': LoggerComponentEnum.ComponentCategory.Unit_Test.value,
17
17
  'testing_framework': LoggerComponentEnum.testingFramework.pytest.value,
18
- 'developer_email': 'sahar.g@circ.zone'
18
+ 'developer_email_address': 'sahar.g@circ.zone'
19
19
  }
@@ -1,8 +1,7 @@
1
- # TODO If we have the exact same file in pytnon-sdk-remote, we we can delete this file from python-sdk-local
2
1
  import traceback
3
2
  from functools import wraps
4
3
  from http import HTTPStatus
5
- from typing import Any
4
+ from typing import Any, Callable
6
5
  # TODO: use logger_local everywhere with meta loggers & remove logger start/end
7
6
  from python_sdk_remote.mini_logger import MiniLogger as logger
8
7
  from user_context_remote.user_context import UserContext
@@ -58,7 +57,7 @@ def handler_decorator(logger, is_validate_user_jwt: bool = True):
58
57
  def my_handler(request_parameters: dict) -> dict:
59
58
  return {"message": "Hello, World!"}"""
60
59
 
61
- def decorator(handler: callable) -> callable:
60
+ def decorator(handler: Callable) -> Callable:
62
61
  @wraps(handler)
63
62
  def wrapper(event, context):
64
63
  handler_response = None
@@ -7,6 +7,8 @@ from python_sdk_remote.mini_logger import MiniLogger as logger
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
9
  # TODO Why we removed the metaclass=ABCMetaLogger?
10
+ # TODO OurObject should allow any alias/display_as to OurObject intereted classes (same in Python and Typescript)<br>
11
+ # TODO OurObject should provide name field in English to OurObject intereted classes (same in Python and Typescript)<brL
10
12
  # class OurObject(ABC, metaclass=ABCMetaLogger):
11
13
  class OurObject(ABC):
12
14
  def __init__(self, **kwargs):
@@ -25,7 +27,7 @@ class OurObject(ABC):
25
27
  """Returns the value of the attribute with the given name"""
26
28
  GET_METHOD_NAME = 'get'
27
29
  logger.start(GET_METHOD_NAME, object={'attr_name': attr_name})
28
- arguments = getattr(self, 'kwargs', None)
30
+ arguments = getattr(self, 'kwargs', {})
29
31
  value = arguments.get(attr_name, None)
30
32
  logger.end(GET_METHOD_NAME, object={'attr_name': attr_name})
31
33
  return value
@@ -1,4 +1,5 @@
1
1
  import copy
2
+ from typing import Optional
2
3
 
3
4
 
4
5
  # TODO: move to python-sdk
@@ -12,7 +13,7 @@ class ServiceResponse:
12
13
  message_internal: dict,
13
14
  message_external: dict,
14
15
  is_success: bool = False,
15
- data: dict = None,
16
+ data: Optional[dict] = None,
16
17
  ):
17
18
  """
18
19
  Initializes the ServiceResponse instance.
@@ -37,7 +37,7 @@ def append_if_not_exist(lst: list, item: object) -> None:
37
37
  lst.append(item)
38
38
 
39
39
 
40
- def to_dict(data: dict | None) -> dict:
40
+ def to_dict(data: dict | str | None) -> dict:
41
41
  if data is None:
42
42
  return {}
43
43
  if isinstance(data, dict):
@@ -45,7 +45,7 @@ def to_dict(data: dict | None) -> dict:
45
45
  return json.loads(data)
46
46
 
47
47
 
48
- def to_json(data: dict | None) -> json:
48
+ def to_json(data: dict | None) -> str:
49
49
  if data is None:
50
50
  data = {}
51
51
  if isinstance(data, dict):
@@ -310,7 +310,7 @@ def generate_otp():
310
310
  return otp
311
311
 
312
312
 
313
- def get_current_datetime_string(datetime_format: str = DEFAULT_DATETIME_FORMAT, tz: timezone = None) -> str:
313
+ def get_current_datetime_string(datetime_format: str = DEFAULT_DATETIME_FORMAT, tz: timezone | None = None) -> str:
314
314
  current_datetime_string = datetime.now(tz).strftime(datetime_format)
315
315
  return current_datetime_string
316
316
 
@@ -1,12 +1,11 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: python-sdk-local
3
- Version: 0.0.154
3
+ Version: 0.0.155b3375
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
7
7
  Author-email: info@circlez.ai
8
8
  Classifier: Programming Language :: Python :: 3
9
- Classifier: License :: Other/Proprietary License
10
9
  Classifier: Operating System :: OS Independent
11
10
  Description-Content-Type: text/markdown
12
11
  Requires-Dist: requests
@@ -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.154', # https://pypi.org/project/python-sdk-local/
10
+ version='0.0.155b3375', # https://pypi.org/project/python-sdk-local#history
11
11
  author="Circles",
12
12
  author_email="info@circlez.ai",
13
13
  description="PyPI Package for Circles Python SDK Local Python",
@@ -19,7 +19,6 @@ setuptools.setup(
19
19
  package_data={package_dir: ['*.py']},
20
20
  classifiers=[
21
21
  "Programming Language :: Python :: 3",
22
- "License :: Other/Proprietary License",
23
22
  "Operating System :: OS Independent",
24
23
  ],
25
24
  install_requires=[
@@ -1,11 +0,0 @@
1
- # TODO: rewrite with more example
2
-
3
- In serverless, use this decorator:
4
- ```py
5
- from python_sdk_local.http_response import handler_decorator
6
- from logger_local.Logger import Logger
7
- logger = Logger.create_logger(object=your_logger_object)
8
- @handler_decorator(logger=logger)
9
- def my_handler(request_parameters: dict) -> dict:
10
- # here you can use both camelCase and snake_case keys from request_parameters
11
- ```