python-sdk-local 0.0.42__tar.gz → 0.0.44__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.42 → python-sdk-local-0.0.44}/PKG-INFO +1 -1
- {python-sdk-local-0.0.42 → python-sdk-local-0.0.44}/python_sdk_local.egg-info/PKG-INFO +1 -1
- {python-sdk-local-0.0.42 → python-sdk-local-0.0.44}/python_sdk_local.egg-info/SOURCES.txt +2 -1
- {python-sdk-local-0.0.42 → python-sdk-local-0.0.44}/sdk/src/mini_logger.py +33 -0
- {python-sdk-local-0.0.42 → python-sdk-local-0.0.44}/sdk/src/utilities.py +0 -11
- python-sdk-local-0.0.44/sdk/src/validate.py +13 -0
- {python-sdk-local-0.0.42 → python-sdk-local-0.0.44}/setup.py +1 -1
- {python-sdk-local-0.0.42 → python-sdk-local-0.0.44}/README.md +0 -0
- {python-sdk-local-0.0.42 → python-sdk-local-0.0.44}/pyproject.toml +0 -0
- {python-sdk-local-0.0.42 → python-sdk-local-0.0.44}/python_sdk_local.egg-info/dependency_links.txt +0 -0
- {python-sdk-local-0.0.42 → python-sdk-local-0.0.44}/python_sdk_local.egg-info/top_level.txt +0 -0
- {python-sdk-local-0.0.42 → python-sdk-local-0.0.44}/sdk/__init__.py +0 -0
- {python-sdk-local-0.0.42 → python-sdk-local-0.0.44}/sdk/src/__init__.py +0 -0
- {python-sdk-local-0.0.42 → python-sdk-local-0.0.44}/sdk/src/constants.py +0 -0
- {python-sdk-local-0.0.42 → python-sdk-local-0.0.44}/sdk/src/item.py +0 -0
- {python-sdk-local-0.0.42 → python-sdk-local-0.0.44}/sdk/src/our_object.py +0 -0
- {python-sdk-local-0.0.42 → python-sdk-local-0.0.44}/setup.cfg +0 -0
|
@@ -4,6 +4,9 @@ from datetime import datetime
|
|
|
4
4
|
|
|
5
5
|
class MiniLogger:
|
|
6
6
|
|
|
7
|
+
# TODO Can we so one generic function call by all
|
|
8
|
+
# TODO Shall we user the Python logging package?
|
|
9
|
+
|
|
7
10
|
@staticmethod
|
|
8
11
|
def start(message: str = "", object: dict = None):
|
|
9
12
|
"""
|
|
@@ -44,6 +47,20 @@ class MiniLogger:
|
|
|
44
47
|
else:
|
|
45
48
|
print(f"{datetime.now()} - INFO {message} - {str(object)}")
|
|
46
49
|
|
|
50
|
+
@staticmethod
|
|
51
|
+
def warning(message: str = "", object: dict = None):
|
|
52
|
+
"""
|
|
53
|
+
Print a log message with the current time.
|
|
54
|
+
|
|
55
|
+
Parameters:
|
|
56
|
+
message (str): The message to be printed.
|
|
57
|
+
object (dict): The object to be printed.
|
|
58
|
+
"""
|
|
59
|
+
if object is None:
|
|
60
|
+
print(f"{datetime.now()} - WARNING - {message}")
|
|
61
|
+
else:
|
|
62
|
+
print(f"{datetime.now()} - WARNING {message} - {str(object)}")
|
|
63
|
+
|
|
47
64
|
@staticmethod
|
|
48
65
|
def error(message: str = "", object: dict = None):
|
|
49
66
|
"""
|
|
@@ -59,3 +76,19 @@ class MiniLogger:
|
|
|
59
76
|
else:
|
|
60
77
|
print(
|
|
61
78
|
f"{datetime.now()} - ERROR - {message} - {str(object)}", file=sys.stderr)
|
|
79
|
+
|
|
80
|
+
@staticmethod
|
|
81
|
+
def exception(message: str = "", object: dict = None):
|
|
82
|
+
"""
|
|
83
|
+
Print a log error message with the current time.
|
|
84
|
+
|
|
85
|
+
Parameters:
|
|
86
|
+
message (str): The message to be printed.
|
|
87
|
+
object (dict): The object to be printed.
|
|
88
|
+
"""
|
|
89
|
+
if object is None:
|
|
90
|
+
print(f"{datetime.now()} - EXCEPTION - {message}",
|
|
91
|
+
file=sys.stderr)
|
|
92
|
+
else:
|
|
93
|
+
print(
|
|
94
|
+
f"{datetime.now()} - EXCEPTION- {message} - {str(object)}", file=sys.stderr)
|
|
@@ -247,14 +247,3 @@ def create_http_headers(jwt_token: str):
|
|
|
247
247
|
'Authorization': f'Bearer {jwt_token}',
|
|
248
248
|
}
|
|
249
249
|
return http_header
|
|
250
|
-
|
|
251
|
-
def validate_enviroment_variables():
|
|
252
|
-
if(os.getenv("ENVIRONMENT_NAME") is None):
|
|
253
|
-
raise Exception("logger-local-python-package LoggerLocal.py please add Environment Variable called ENVIRONMENT_NAME=local or play1 (instead of ENVIRONMENT)")
|
|
254
|
-
if(os.getenv("PRODUCT_USER_IDENTIFIER") is None):
|
|
255
|
-
raise Exception("logger-local-python-package LoggerLocal.py please add Environment Variable called PRODUCT_USER_IDENTIFIER (instead of PRODUCT_USERNAME)")
|
|
256
|
-
if(os.getenv("PRODUCT_PASSWORD") is None):
|
|
257
|
-
raise Exception("logger-local-python-package LoggerLocal.py please add Environment Variable called PRODUCT_PASSWORD")
|
|
258
|
-
if(os.getenv("LOGZIO_TOKEN") is None):
|
|
259
|
-
raise Exception("logger-local-python-package LoggerLocal.py please add Environment Variable called LOGZIO_TOKEN=cXNHuVkkffkilnkKzZlWExECRlSKqopE")
|
|
260
|
-
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import os
|
|
2
|
+
|
|
3
|
+
def validate_enviroment_variables():
|
|
4
|
+
if(os.getenv("ENVIRONMENT_NAME") is None):
|
|
5
|
+
raise Exception("logger-local-python-package LoggerLocal.py please add Environment Variable called ENVIRONMENT_NAME=local or play1 (instead of ENVIRONMENT)")
|
|
6
|
+
if(os.getenv("PRODUCT_USER_IDENTIFIER") is None):
|
|
7
|
+
raise Exception("logger-local-python-package LoggerLocal.py please add Environment Variable called PRODUCT_USER_IDENTIFIER (instead of PRODUCT_USERNAME)")
|
|
8
|
+
if(os.getenv("PRODUCT_PASSWORD") is None):
|
|
9
|
+
raise Exception("logger-local-python-package LoggerLocal.py please add Environment Variable called PRODUCT_PASSWORD")
|
|
10
|
+
if(os.getenv("LOGZIO_TOKEN") is None):
|
|
11
|
+
raise Exception("logger-local-python-package LoggerLocal.py please add Environment Variable called LOGZIO_TOKEN=cXNHuVkkffkilnkKzZlWExECRlSKqopE")
|
|
12
|
+
|
|
13
|
+
|
|
@@ -3,7 +3,7 @@ import setuptools
|
|
|
3
3
|
# python -m build needs pyproject.toml or setup.py
|
|
4
4
|
setuptools.setup(
|
|
5
5
|
name='python-sdk-local',
|
|
6
|
-
version='0.0.
|
|
6
|
+
version='0.0.44', # https://pypi.org/project/python-sdk-local/
|
|
7
7
|
author="Circles",
|
|
8
8
|
author_email="info@circles.life",
|
|
9
9
|
description="PyPI Package for Circles Python SDK Local Python",
|
|
File without changes
|
|
File without changes
|
{python-sdk-local-0.0.42 → python-sdk-local-0.0.44}/python_sdk_local.egg-info/dependency_links.txt
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
|