python-sdk-remote 0.0.141__tar.gz → 0.0.143__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.
Potentially problematic release.
This version of python-sdk-remote might be problematic. Click here for more details.
- {python_sdk_remote-0.0.141 → python_sdk_remote-0.0.143}/PKG-INFO +1 -1
- python_sdk_remote-0.0.143/python_sdk_remote/src/is_test_data.py +4 -0
- {python_sdk_remote-0.0.141 → python_sdk_remote-0.0.143}/python_sdk_remote/src/our_object.py +25 -2
- {python_sdk_remote-0.0.141 → python_sdk_remote-0.0.143}/python_sdk_remote.egg-info/PKG-INFO +1 -1
- {python_sdk_remote-0.0.141 → python_sdk_remote-0.0.143}/python_sdk_remote.egg-info/SOURCES.txt +1 -0
- {python_sdk_remote-0.0.141 → python_sdk_remote-0.0.143}/setup.py +1 -1
- {python_sdk_remote-0.0.141 → python_sdk_remote-0.0.143}/README.md +0 -0
- {python_sdk_remote-0.0.141 → python_sdk_remote-0.0.143}/pyproject.toml +0 -0
- {python_sdk_remote-0.0.141 → python_sdk_remote-0.0.143}/python_sdk_remote/src/__init__.py +0 -0
- {python_sdk_remote-0.0.141 → python_sdk_remote-0.0.143}/python_sdk_remote/src/constants.py +0 -0
- {python_sdk_remote-0.0.141 → python_sdk_remote-0.0.143}/python_sdk_remote/src/http_response.py +0 -0
- {python_sdk_remote-0.0.141 → python_sdk_remote-0.0.143}/python_sdk_remote/src/item.py +0 -0
- {python_sdk_remote-0.0.141 → python_sdk_remote-0.0.143}/python_sdk_remote/src/mini_logger.py +0 -0
- {python_sdk_remote-0.0.141 → python_sdk_remote-0.0.143}/python_sdk_remote/src/unified_json.py +0 -0
- {python_sdk_remote-0.0.141 → python_sdk_remote-0.0.143}/python_sdk_remote/src/utilities.py +0 -0
- {python_sdk_remote-0.0.141 → python_sdk_remote-0.0.143}/python_sdk_remote/src/valid_json_versions.py +0 -0
- {python_sdk_remote-0.0.141 → python_sdk_remote-0.0.143}/python_sdk_remote/src/validate_environment.py +0 -0
- {python_sdk_remote-0.0.141 → python_sdk_remote-0.0.143}/python_sdk_remote.egg-info/dependency_links.txt +0 -0
- {python_sdk_remote-0.0.141 → python_sdk_remote-0.0.143}/python_sdk_remote.egg-info/requires.txt +0 -0
- {python_sdk_remote-0.0.141 → python_sdk_remote-0.0.143}/python_sdk_remote.egg-info/top_level.txt +0 -0
- {python_sdk_remote-0.0.141 → python_sdk_remote-0.0.143}/setup.cfg +0 -0
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import json
|
|
2
2
|
from abc import ABC # , abstractmethod
|
|
3
|
+
from datetime import datetime
|
|
3
4
|
|
|
4
5
|
from .mini_logger import MiniLogger as logger
|
|
5
6
|
|
|
@@ -76,8 +77,28 @@ class OurObject(ABC):
|
|
|
76
77
|
return getattr(self, 'kwargs', None)
|
|
77
78
|
|
|
78
79
|
def to_json(self) -> str:
|
|
80
|
+
"""This is backwards compatible with the previous implementation"""
|
|
81
|
+
to_json_result = self.to_json_str()
|
|
82
|
+
return to_json_result
|
|
83
|
+
|
|
84
|
+
def to_json_dict(self) -> str:
|
|
85
|
+
"""Returns a json string representation of this object"""
|
|
86
|
+
json_str = self.to_json_str()
|
|
87
|
+
json_dict = json.loads(json_str)
|
|
88
|
+
|
|
89
|
+
return json_dict
|
|
90
|
+
|
|
91
|
+
def to_json_str(self) -> str:
|
|
79
92
|
"""Returns a json string representation of this object"""
|
|
80
|
-
|
|
93
|
+
to_json_str_result = json.dumps(self.__dict__, default=self._serialize)
|
|
94
|
+
return to_json_str_result
|
|
95
|
+
|
|
96
|
+
@staticmethod
|
|
97
|
+
def _serialize(obj):
|
|
98
|
+
"""Custom serialization function for unsupported types. Used by json.dumps"""
|
|
99
|
+
if isinstance(obj, datetime):
|
|
100
|
+
return obj.isoformat() # Converts datetime to ISO 8601 string
|
|
101
|
+
raise TypeError(f"Type {type(obj)} not serializable")
|
|
81
102
|
|
|
82
103
|
def from_json(self, json_string: str) -> 'OurObject':
|
|
83
104
|
"""Returns an instance of the class from a json string"""
|
|
@@ -103,7 +124,9 @@ class OurObject(ABC):
|
|
|
103
124
|
return self.entity_name + ": " + str(self.__dict__)
|
|
104
125
|
|
|
105
126
|
def __repr__(self):
|
|
106
|
-
|
|
127
|
+
# TODO make sure both of them is not None
|
|
128
|
+
repr_result = self.entity_name + ": " + str(self.__dict__)
|
|
129
|
+
return repr_result
|
|
107
130
|
|
|
108
131
|
def to_dict(self):
|
|
109
132
|
return self.__dict__
|
{python_sdk_remote-0.0.141 → python_sdk_remote-0.0.143}/python_sdk_remote.egg-info/SOURCES.txt
RENAMED
|
@@ -9,6 +9,7 @@ python_sdk_remote.egg-info/top_level.txt
|
|
|
9
9
|
python_sdk_remote/src/__init__.py
|
|
10
10
|
python_sdk_remote/src/constants.py
|
|
11
11
|
python_sdk_remote/src/http_response.py
|
|
12
|
+
python_sdk_remote/src/is_test_data.py
|
|
12
13
|
python_sdk_remote/src/item.py
|
|
13
14
|
python_sdk_remote/src/mini_logger.py
|
|
14
15
|
python_sdk_remote/src/our_object.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.
|
|
10
|
+
version='0.0.143', # https://pypi.org/project/python-sdk-remote/
|
|
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
|
{python_sdk_remote-0.0.141 → python_sdk_remote-0.0.143}/python_sdk_remote/src/http_response.py
RENAMED
|
File without changes
|
|
File without changes
|
{python_sdk_remote-0.0.141 → python_sdk_remote-0.0.143}/python_sdk_remote/src/mini_logger.py
RENAMED
|
File without changes
|
{python_sdk_remote-0.0.141 → python_sdk_remote-0.0.143}/python_sdk_remote/src/unified_json.py
RENAMED
|
File without changes
|
|
File without changes
|
{python_sdk_remote-0.0.141 → python_sdk_remote-0.0.143}/python_sdk_remote/src/valid_json_versions.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
{python_sdk_remote-0.0.141 → python_sdk_remote-0.0.143}/python_sdk_remote.egg-info/requires.txt
RENAMED
|
File without changes
|
{python_sdk_remote-0.0.141 → python_sdk_remote-0.0.143}/python_sdk_remote.egg-info/top_level.txt
RENAMED
|
File without changes
|
|
File without changes
|