python-sdk-remote 0.0.226b4491__tar.gz → 0.0.227b4397__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_remote-0.0.226b4491 → python_sdk_remote-0.0.227b4397}/PKG-INFO +1 -1
- {python_sdk_remote-0.0.226b4491 → python_sdk_remote-0.0.227b4397}/pyproject.toml +1 -1
- {python_sdk_remote-0.0.226b4491 → python_sdk_remote-0.0.227b4397}/python_sdk_remote/src/http_response.py +18 -3
- python_sdk_remote-0.0.227b4397/python_sdk_remote/src/validate_environment.py +9 -0
- {python_sdk_remote-0.0.226b4491 → python_sdk_remote-0.0.227b4397}/python_sdk_remote.egg-info/PKG-INFO +1 -1
- {python_sdk_remote-0.0.226b4491 → python_sdk_remote-0.0.227b4397}/setup.py +1 -1
- python_sdk_remote-0.0.226b4491/python_sdk_remote/src/validate_environment.py +0 -48
- {python_sdk_remote-0.0.226b4491 → python_sdk_remote-0.0.227b4397}/README.md +0 -0
- {python_sdk_remote-0.0.226b4491 → python_sdk_remote-0.0.227b4397}/python_sdk_remote/src/__init__.py +0 -0
- {python_sdk_remote-0.0.226b4491 → python_sdk_remote-0.0.227b4397}/python_sdk_remote/src/constants.py +0 -0
- {python_sdk_remote-0.0.226b4491 → python_sdk_remote-0.0.227b4397}/python_sdk_remote/src/constants_src_mini_logger_and_logger.py +0 -0
- {python_sdk_remote-0.0.226b4491 → python_sdk_remote-0.0.227b4397}/python_sdk_remote/src/datetime_range.py +0 -0
- {python_sdk_remote-0.0.226b4491 → python_sdk_remote-0.0.227b4397}/python_sdk_remote/src/dot_env_files.py +0 -0
- {python_sdk_remote-0.0.226b4491 → python_sdk_remote-0.0.227b4397}/python_sdk_remote/src/environment.py +0 -0
- {python_sdk_remote-0.0.226b4491 → python_sdk_remote-0.0.227b4397}/python_sdk_remote/src/environment_variable_exception.py +0 -0
- {python_sdk_remote-0.0.226b4491 → python_sdk_remote-0.0.227b4397}/python_sdk_remote/src/filename.py +0 -0
- {python_sdk_remote-0.0.226b4491 → python_sdk_remote-0.0.227b4397}/python_sdk_remote/src/filesystem.py +0 -0
- {python_sdk_remote-0.0.226b4491 → python_sdk_remote-0.0.227b4397}/python_sdk_remote/src/generic_crud.py +0 -0
- {python_sdk_remote-0.0.226b4491 → python_sdk_remote-0.0.227b4397}/python_sdk_remote/src/is_test_data.py +0 -0
- {python_sdk_remote-0.0.226b4491 → python_sdk_remote-0.0.227b4397}/python_sdk_remote/src/item.py +0 -0
- {python_sdk_remote-0.0.226b4491 → python_sdk_remote-0.0.227b4397}/python_sdk_remote/src/masking.py +0 -0
- {python_sdk_remote-0.0.226b4491 → python_sdk_remote-0.0.227b4397}/python_sdk_remote/src/mini_logger.py +0 -0
- {python_sdk_remote-0.0.226b4491 → python_sdk_remote-0.0.227b4397}/python_sdk_remote/src/our_environment_variable.py +0 -0
- {python_sdk_remote-0.0.226b4491 → python_sdk_remote-0.0.227b4397}/python_sdk_remote/src/our_environment_variable_exception.py +0 -0
- {python_sdk_remote-0.0.226b4491 → python_sdk_remote-0.0.227b4397}/python_sdk_remote/src/our_obfuscation.py +0 -0
- {python_sdk_remote-0.0.226b4491 → python_sdk_remote-0.0.227b4397}/python_sdk_remote/src/our_object.py +0 -0
- {python_sdk_remote-0.0.226b4491 → python_sdk_remote-0.0.227b4397}/python_sdk_remote/src/our_objects.py +0 -0
- {python_sdk_remote-0.0.226b4491 → python_sdk_remote-0.0.227b4397}/python_sdk_remote/src/our_objects_local.py +0 -0
- {python_sdk_remote-0.0.226b4491 → python_sdk_remote-0.0.227b4397}/python_sdk_remote/src/our_objects_remote.py +0 -0
- {python_sdk_remote-0.0.226b4491 → python_sdk_remote-0.0.227b4397}/python_sdk_remote/src/our_request.py +0 -0
- {python_sdk_remote-0.0.226b4491 → python_sdk_remote-0.0.227b4397}/python_sdk_remote/src/our_request_old.py +0 -0
- {python_sdk_remote-0.0.226b4491 → python_sdk_remote-0.0.227b4397}/python_sdk_remote/src/personal_repo.py +0 -0
- {python_sdk_remote-0.0.226b4491 → python_sdk_remote-0.0.227b4397}/python_sdk_remote/src/unified_json.py +0 -0
- {python_sdk_remote-0.0.226b4491 → python_sdk_remote-0.0.227b4397}/python_sdk_remote/src/username.py +0 -0
- {python_sdk_remote-0.0.226b4491 → python_sdk_remote-0.0.227b4397}/python_sdk_remote/src/utilities.py +0 -0
- {python_sdk_remote-0.0.226b4491 → python_sdk_remote-0.0.227b4397}/python_sdk_remote/src/valid_json_versions.py +0 -0
- {python_sdk_remote-0.0.226b4491 → python_sdk_remote-0.0.227b4397}/python_sdk_remote/src/version.py +0 -0
- {python_sdk_remote-0.0.226b4491 → python_sdk_remote-0.0.227b4397}/python_sdk_remote.egg-info/SOURCES.txt +0 -0
- {python_sdk_remote-0.0.226b4491 → python_sdk_remote-0.0.227b4397}/python_sdk_remote.egg-info/dependency_links.txt +0 -0
- {python_sdk_remote-0.0.226b4491 → python_sdk_remote-0.0.227b4397}/python_sdk_remote.egg-info/requires.txt +0 -0
- {python_sdk_remote-0.0.226b4491 → python_sdk_remote-0.0.227b4397}/python_sdk_remote.egg-info/top_level.txt +0 -0
- {python_sdk_remote-0.0.226b4491 → python_sdk_remote-0.0.227b4397}/setup.cfg +0 -0
|
@@ -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.227b4397" # https://pypi.org/project/python-sdk-local
|
|
8
8
|
description = "python-sdk-local Python Package"
|
|
9
9
|
readme = "README.md"
|
|
10
10
|
authors = [
|
|
@@ -3,6 +3,7 @@ from functools import wraps
|
|
|
3
3
|
from http import HTTPStatus
|
|
4
4
|
from typing import Any, Optional, overload
|
|
5
5
|
|
|
6
|
+
from .environment import get_environment_name
|
|
6
7
|
from .mini_logger import MiniLogger as logger
|
|
7
8
|
from .utilities import camel_to_snake, snake_to_camel, to_dict, to_json
|
|
8
9
|
|
|
@@ -22,7 +23,7 @@ def create_internal_server_error_http_response(error_message: str = "Internal Se
|
|
|
22
23
|
error_message: Custom error message (default: "Internal Server Error")
|
|
23
24
|
|
|
24
25
|
Returns:
|
|
25
|
-
dict: HTTP response with the
|
|
26
|
+
dict: HTTP response with the HTTPStatus.INTERNAL_SERVER_ERROR status code
|
|
26
27
|
"""
|
|
27
28
|
logger.start(object={"error_message": error_message})
|
|
28
29
|
internal_server_error_response = {
|
|
@@ -36,13 +37,13 @@ def create_internal_server_error_http_response(error_message: str = "Internal Se
|
|
|
36
37
|
|
|
37
38
|
def create_ok_http_response_simple(body: Any) -> dict:
|
|
38
39
|
"""
|
|
39
|
-
Create a simple
|
|
40
|
+
Create a simple HTTPStatus.OK response (alias for create_ok_http_response).
|
|
40
41
|
|
|
41
42
|
Args:
|
|
42
43
|
body: Response body data
|
|
43
44
|
|
|
44
45
|
Returns:
|
|
45
|
-
dict: HTTP response with the OK
|
|
46
|
+
dict: HTTP response with the HTTPStatus.OK status code
|
|
46
47
|
"""
|
|
47
48
|
return create_ok_http_response(body)
|
|
48
49
|
|
|
@@ -295,6 +296,20 @@ def create_ok_http_response(body: Any) -> dict:
|
|
|
295
296
|
return ok_http_response
|
|
296
297
|
|
|
297
298
|
|
|
299
|
+
# TODO How can we customize the response, i.e., to add a dict as a parameter
|
|
300
|
+
def create_health_check_http_response(service_name: str, package_version: str) -> dict:
|
|
301
|
+
"""Generic GET /health response for every service."""
|
|
302
|
+
logger.start(object={"service_name": service_name, "package_version": package_version})
|
|
303
|
+
health_check_http_response = create_ok_http_response({
|
|
304
|
+
"status": "healthy",
|
|
305
|
+
"serviceName": service_name,
|
|
306
|
+
"packageVersion": package_version,
|
|
307
|
+
"environmentName": get_environment_name(),
|
|
308
|
+
})
|
|
309
|
+
logger.end(object={"health_check_http_response": health_check_http_response})
|
|
310
|
+
return health_check_http_response
|
|
311
|
+
|
|
312
|
+
|
|
298
313
|
def create_http_body(body: Any) -> str:
|
|
299
314
|
"""
|
|
300
315
|
Create HTTP response body as JSON string.
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
# deleted as the validation is done in utilities.our_get_env
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
# Implementation note: Align with https://github.com/circles-zone/typescript-sdk-remote-typescript-package/edit/dev/typescript-sdk/src/utils/index.ts validateTenantEnvironmentVariables() # noqa501
|
|
5
|
+
def validate_environment_variables():
|
|
6
|
+
"""This is done for cross variables validation, as single variables are validated by our_get_env.
|
|
7
|
+
This should be called only once."""
|
|
8
|
+
|
|
9
|
+
pass # No cross validation needed yet
|
|
@@ -8,7 +8,7 @@ package_dir = PACKAGE_NAME.replace("-", "_")
|
|
|
8
8
|
setuptools.setup(
|
|
9
9
|
license='MIT',
|
|
10
10
|
name=PACKAGE_NAME,
|
|
11
|
-
version="0.0.
|
|
11
|
+
version="0.0.227b4397", # https://pypi.org/project/python-sdk-remote#history
|
|
12
12
|
author="Circles",
|
|
13
13
|
author_email="info@circlez.ai",
|
|
14
14
|
description="PyPI Package for Circles Python SDK Local Python",
|
|
@@ -1,48 +0,0 @@
|
|
|
1
|
-
# deleted as the validation is done in utilities.our_get_env
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
# Implementation note: Align with https://github.com/circles-zone/typescript-sdk-remote-typescript-package/edit/dev/typescript-sdk/src/utils/index.ts validateTenantEnvironmentVariables() # noqa501
|
|
5
|
-
def validate_environment_variables():
|
|
6
|
-
"""This is done for cross variables validation, as single variables are validated by our_get_env.
|
|
7
|
-
This should be called only once."""
|
|
8
|
-
|
|
9
|
-
pass # No cross validation needed yet
|
|
10
|
-
|
|
11
|
-
# Implementation note: Delete the following code when no longer needed
|
|
12
|
-
|
|
13
|
-
# validate_brand_name()
|
|
14
|
-
# validate_environment_name()
|
|
15
|
-
# if(os.getenv("PRODUCT_USER_IDENTIFIER") is None):
|
|
16
|
-
# raise Exception("logger-local-python-package LoggerLocal.py please add Environment Variable called "
|
|
17
|
-
# "PRODUCT_USER_IDENTIFIER (instead of PRODUCT_USERNAME)")
|
|
18
|
-
# removed by Idan because it dont has to be in every project
|
|
19
|
-
# if(os.getenv("PRODUCT_PASSWORD") is None):
|
|
20
|
-
# raise Exception("logger-local-python-package LoggerLocal.py please add Environment Variable called PRODUCT_PASSWORD")
|
|
21
|
-
# validate_logzio_token()
|
|
22
|
-
# validate_google_port_for_authentication()
|
|
23
|
-
#
|
|
24
|
-
#
|
|
25
|
-
# def validate_environment_name():
|
|
26
|
-
# if ENVIRONMENT_NAME is None:
|
|
27
|
-
# raise Exception("logger-local-python-package LoggerLocal.py please add Environment Variable called "
|
|
28
|
-
# "ENVIRONMENT_NAME=local or play1 (instead of ENVIRONMENT)")
|
|
29
|
-
#
|
|
30
|
-
#
|
|
31
|
-
# def validate_brand_name():
|
|
32
|
-
# if BRAND_NAME is None:
|
|
33
|
-
# raise Exception(
|
|
34
|
-
# "logger-local-python-package LoggerLocal.py please add Environment Variable called BRAND_NAME=Circlez")
|
|
35
|
-
#
|
|
36
|
-
#
|
|
37
|
-
# def validate_logzio_token():
|
|
38
|
-
# if LOGZIO_TOKEN is None:
|
|
39
|
-
# raise Exception("logger-local-python-package LoggerLocal.py please add Environment Variable called"
|
|
40
|
-
# " LOGZIO_TOKEN=cXNHuVkkffkilnkKzZlWExECRlSKqopE")
|
|
41
|
-
#
|
|
42
|
-
#
|
|
43
|
-
# def validate_google_port_for_authentication():
|
|
44
|
-
# if GOOGLE_PORT_FOR_AUTHENTICATION is None:
|
|
45
|
-
# # The port is 54219 because the authentication url is http://localhost:54219/
|
|
46
|
-
# raise Exception("please add Environment Variable"
|
|
47
|
-
# " PORT_FOR_AUTHENTICATION=54219 because"
|
|
48
|
-
# " the authentication url is http://localhost:54219/")
|
|
File without changes
|
{python_sdk_remote-0.0.226b4491 → python_sdk_remote-0.0.227b4397}/python_sdk_remote/src/__init__.py
RENAMED
|
File without changes
|
{python_sdk_remote-0.0.226b4491 → python_sdk_remote-0.0.227b4397}/python_sdk_remote/src/constants.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{python_sdk_remote-0.0.226b4491 → python_sdk_remote-0.0.227b4397}/python_sdk_remote/src/filename.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{python_sdk_remote-0.0.226b4491 → python_sdk_remote-0.0.227b4397}/python_sdk_remote/src/item.py
RENAMED
|
File without changes
|
{python_sdk_remote-0.0.226b4491 → python_sdk_remote-0.0.227b4397}/python_sdk_remote/src/masking.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
|
{python_sdk_remote-0.0.226b4491 → python_sdk_remote-0.0.227b4397}/python_sdk_remote/src/username.py
RENAMED
|
File without changes
|
{python_sdk_remote-0.0.226b4491 → python_sdk_remote-0.0.227b4397}/python_sdk_remote/src/utilities.py
RENAMED
|
File without changes
|
|
File without changes
|
{python_sdk_remote-0.0.226b4491 → python_sdk_remote-0.0.227b4397}/python_sdk_remote/src/version.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|