python-sdk-local 0.0.139__tar.gz → 0.0.140__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.
- {python_sdk_local-0.0.139 → python_sdk_local-0.0.140}/PKG-INFO +10 -2
- {python_sdk_local-0.0.139 → python_sdk_local-0.0.140}/pyproject.toml +1 -1
- {python_sdk_local-0.0.139 → python_sdk_local-0.0.140}/python_sdk_local/src/http_response.py +9 -7
- {python_sdk_local-0.0.139 → python_sdk_local-0.0.140}/python_sdk_local/src/our_object.py +2 -0
- {python_sdk_local-0.0.139 → python_sdk_local-0.0.140}/python_sdk_local/src/unified_json.py +3 -1
- {python_sdk_local-0.0.139 → python_sdk_local-0.0.140}/python_sdk_local.egg-info/PKG-INFO +10 -2
- {python_sdk_local-0.0.139 → python_sdk_local-0.0.140}/setup.py +1 -1
- {python_sdk_local-0.0.139 → python_sdk_local-0.0.140}/README.md +0 -0
- {python_sdk_local-0.0.139 → python_sdk_local-0.0.140}/python_sdk_local/src/__init__.py +0 -0
- {python_sdk_local-0.0.139 → python_sdk_local-0.0.140}/python_sdk_local/src/constants.py +0 -0
- {python_sdk_local-0.0.139 → python_sdk_local-0.0.140}/python_sdk_local/src/item.py +0 -0
- {python_sdk_local-0.0.139 → python_sdk_local-0.0.140}/python_sdk_local/src/utilities.py +0 -0
- {python_sdk_local-0.0.139 → python_sdk_local-0.0.140}/python_sdk_local/src/valid_json_versions.py +0 -0
- {python_sdk_local-0.0.139 → python_sdk_local-0.0.140}/python_sdk_local/src/validate_environment.py +0 -0
- {python_sdk_local-0.0.139 → python_sdk_local-0.0.140}/python_sdk_local.egg-info/SOURCES.txt +0 -0
- {python_sdk_local-0.0.139 → python_sdk_local-0.0.140}/python_sdk_local.egg-info/dependency_links.txt +0 -0
- {python_sdk_local-0.0.139 → python_sdk_local-0.0.140}/python_sdk_local.egg-info/requires.txt +0 -0
- {python_sdk_local-0.0.139 → python_sdk_local-0.0.140}/python_sdk_local.egg-info/top_level.txt +0 -0
- {python_sdk_local-0.0.139 → python_sdk_local-0.0.140}/setup.cfg +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
Metadata-Version: 2.
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
2
|
Name: python-sdk-local
|
|
3
|
-
Version: 0.0.
|
|
3
|
+
Version: 0.0.140
|
|
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
|
|
@@ -14,5 +14,13 @@ Requires-Dist: python-dotenv
|
|
|
14
14
|
Requires-Dist: pyjwt
|
|
15
15
|
Requires-Dist: python-sdk-remote
|
|
16
16
|
Requires-Dist: user-context-remote
|
|
17
|
+
Dynamic: author
|
|
18
|
+
Dynamic: author-email
|
|
19
|
+
Dynamic: classifier
|
|
20
|
+
Dynamic: description
|
|
21
|
+
Dynamic: description-content-type
|
|
22
|
+
Dynamic: home-page
|
|
23
|
+
Dynamic: requires-dist
|
|
24
|
+
Dynamic: summary
|
|
17
25
|
|
|
18
26
|
This is a package for sharing common functions used in different repositories
|
|
@@ -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.
|
|
7
|
+
version = "0.0.75" # https://pypi.org/project/python-sdk-local
|
|
8
8
|
description = "python-sdk-local Python Package"
|
|
9
9
|
readme = "README.md"
|
|
10
10
|
authors = [
|
|
@@ -13,7 +13,7 @@ AUTHORIZATION_KEY = 'Authorization'
|
|
|
13
13
|
AUTHORIZATION_PREFIX = 'Bearer '
|
|
14
14
|
|
|
15
15
|
|
|
16
|
-
# TODO Align those methods with typescript-sdk https://github.com/circles-zone/typescript-sdk-remote-typescript-package/blob/dev/typescript-sdk/src/utils/index.ts
|
|
16
|
+
# TODO Align those methods with typescript-sdk https://github.com/circles-zone/typescript-sdk-remote-typescript-package/blob/dev/typescript-sdk/src/utils/index.ts # noqa
|
|
17
17
|
# TODO Shall we create also createInternalServerErrorHttpResponse(), createOkHttpResponse() like we have in TypeScript?
|
|
18
18
|
|
|
19
19
|
def get_payload_dict_from_event(event: dict) -> dict:
|
|
@@ -46,7 +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
|
-
def handler_decorator(logger):
|
|
49
|
+
def handler_decorator(logger, is_validate_user_jwt: bool = True):
|
|
50
50
|
"""Decorator for AWS Lambda handler functions. It wraps the handler function with logging and error handling.
|
|
51
51
|
Usage:
|
|
52
52
|
from python_sdk_local.http_response import handler_decorator
|
|
@@ -62,11 +62,13 @@ def handler_decorator(logger):
|
|
|
62
62
|
try:
|
|
63
63
|
logger.start(object={"event": event, "context": context})
|
|
64
64
|
request_parameters = get_request_parameters_from_event(event)
|
|
65
|
-
|
|
66
|
-
if
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
65
|
+
|
|
66
|
+
if is_validate_user_jwt:
|
|
67
|
+
user_jwt = get_user_jwt_from_event(event)
|
|
68
|
+
if user_jwt:
|
|
69
|
+
request_parameters["user_context"] = UserContext.login_using_user_jwt(user_jwt)
|
|
70
|
+
else:
|
|
71
|
+
logger.warning("No user_jwt provided")
|
|
70
72
|
body_result = handler(request_parameters)
|
|
71
73
|
handler_response = create_ok_http_response(body_result)
|
|
72
74
|
except Exception as e:
|
|
@@ -1,10 +1,12 @@
|
|
|
1
1
|
import json
|
|
2
2
|
from abc import ABC, abstractmethod
|
|
3
|
+
# from logger_local.MetaLogger import ABCMetaLogger
|
|
3
4
|
|
|
4
5
|
from python_sdk_remote.mini_logger import MiniLogger as logger
|
|
5
6
|
|
|
6
7
|
|
|
7
8
|
# TODO Where are we using it? Shall we extend the usage of OurObject as the father of all our entities?
|
|
9
|
+
# class OurObject(ABC, metaclass=ABCMetaLogger):
|
|
8
10
|
class OurObject(ABC):
|
|
9
11
|
def __init__(self, **kwargs):
|
|
10
12
|
INIT_METHOD_NAME = '__init__'
|
|
@@ -1,8 +1,10 @@
|
|
|
1
1
|
from .valid_json_versions import valid_json_versions
|
|
2
|
+
from logger_local.MetaLogger import MetaLogger
|
|
2
3
|
|
|
3
4
|
|
|
5
|
+
#
|
|
4
6
|
# TODO Shall we merge it with the machine-learning-unified-json?
|
|
5
|
-
class UnifiedJson:
|
|
7
|
+
class UnifiedJson(metaclass=MetaLogger):
|
|
6
8
|
def __init__(self, data: dict, json_version: str):
|
|
7
9
|
if json_version not in valid_json_versions:
|
|
8
10
|
raise Exception(
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
Metadata-Version: 2.
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
2
|
Name: python-sdk-local
|
|
3
|
-
Version: 0.0.
|
|
3
|
+
Version: 0.0.140
|
|
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
|
|
@@ -14,5 +14,13 @@ Requires-Dist: python-dotenv
|
|
|
14
14
|
Requires-Dist: pyjwt
|
|
15
15
|
Requires-Dist: python-sdk-remote
|
|
16
16
|
Requires-Dist: user-context-remote
|
|
17
|
+
Dynamic: author
|
|
18
|
+
Dynamic: author-email
|
|
19
|
+
Dynamic: classifier
|
|
20
|
+
Dynamic: description
|
|
21
|
+
Dynamic: description-content-type
|
|
22
|
+
Dynamic: home-page
|
|
23
|
+
Dynamic: requires-dist
|
|
24
|
+
Dynamic: summary
|
|
17
25
|
|
|
18
26
|
This is a package for sharing common functions used in different repositories
|
|
@@ -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.
|
|
10
|
+
version='0.0.140', # 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",
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{python_sdk_local-0.0.139 → python_sdk_local-0.0.140}/python_sdk_local/src/valid_json_versions.py
RENAMED
|
File without changes
|
{python_sdk_local-0.0.139 → python_sdk_local-0.0.140}/python_sdk_local/src/validate_environment.py
RENAMED
|
File without changes
|
|
File without changes
|
{python_sdk_local-0.0.139 → python_sdk_local-0.0.140}/python_sdk_local.egg-info/dependency_links.txt
RENAMED
|
File without changes
|
{python_sdk_local-0.0.139 → python_sdk_local-0.0.140}/python_sdk_local.egg-info/requires.txt
RENAMED
|
File without changes
|
{python_sdk_local-0.0.139 → python_sdk_local-0.0.140}/python_sdk_local.egg-info/top_level.txt
RENAMED
|
File without changes
|
|
File without changes
|