python-sdk-remote 0.0.134__tar.gz → 0.0.136__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.134 → python_sdk_remote-0.0.136}/PKG-INFO +1 -1
- {python_sdk_remote-0.0.134 → python_sdk_remote-0.0.136}/python_sdk_remote/src/our_object.py +20 -1
- {python_sdk_remote-0.0.134 → python_sdk_remote-0.0.136}/python_sdk_remote.egg-info/PKG-INFO +1 -1
- {python_sdk_remote-0.0.134 → python_sdk_remote-0.0.136}/setup.py +1 -1
- {python_sdk_remote-0.0.134 → python_sdk_remote-0.0.136}/README.md +0 -0
- {python_sdk_remote-0.0.134 → python_sdk_remote-0.0.136}/pyproject.toml +0 -0
- {python_sdk_remote-0.0.134 → python_sdk_remote-0.0.136}/python_sdk_remote/src/__init__.py +0 -0
- {python_sdk_remote-0.0.134 → python_sdk_remote-0.0.136}/python_sdk_remote/src/constants.py +0 -0
- {python_sdk_remote-0.0.134 → python_sdk_remote-0.0.136}/python_sdk_remote/src/http_response.py +0 -0
- {python_sdk_remote-0.0.134 → python_sdk_remote-0.0.136}/python_sdk_remote/src/item.py +0 -0
- {python_sdk_remote-0.0.134 → python_sdk_remote-0.0.136}/python_sdk_remote/src/mini_logger.py +0 -0
- {python_sdk_remote-0.0.134 → python_sdk_remote-0.0.136}/python_sdk_remote/src/unified_json.py +0 -0
- {python_sdk_remote-0.0.134 → python_sdk_remote-0.0.136}/python_sdk_remote/src/utilities.py +0 -0
- {python_sdk_remote-0.0.134 → python_sdk_remote-0.0.136}/python_sdk_remote/src/valid_json_versions.py +0 -0
- {python_sdk_remote-0.0.134 → python_sdk_remote-0.0.136}/python_sdk_remote/src/validate_environment.py +0 -0
- {python_sdk_remote-0.0.134 → python_sdk_remote-0.0.136}/python_sdk_remote.egg-info/SOURCES.txt +0 -0
- {python_sdk_remote-0.0.134 → python_sdk_remote-0.0.136}/python_sdk_remote.egg-info/dependency_links.txt +0 -0
- {python_sdk_remote-0.0.134 → python_sdk_remote-0.0.136}/python_sdk_remote.egg-info/requires.txt +0 -0
- {python_sdk_remote-0.0.134 → python_sdk_remote-0.0.136}/python_sdk_remote.egg-info/top_level.txt +0 -0
- {python_sdk_remote-0.0.134 → python_sdk_remote-0.0.136}/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
|
|
|
@@ -44,8 +45,26 @@ class OurObject(ABC):
|
|
|
44
45
|
return self.__dict__
|
|
45
46
|
|
|
46
47
|
def to_json(self) -> str:
|
|
48
|
+
"""This is backwards compatible with the previous implementation"""
|
|
49
|
+
return self.to_json_str()
|
|
50
|
+
|
|
51
|
+
def to_json_dict(self) -> str:
|
|
47
52
|
"""Returns a json string representation of this object"""
|
|
48
|
-
|
|
53
|
+
json_str = self.to_json_str()
|
|
54
|
+
json_dict = json.loads(json_str)
|
|
55
|
+
|
|
56
|
+
return json_dict
|
|
57
|
+
|
|
58
|
+
def to_json_str(self) -> str:
|
|
59
|
+
"""Returns a json string representation of this object"""
|
|
60
|
+
return json.dumps(self.__dict__, default=self._serialize)
|
|
61
|
+
|
|
62
|
+
@staticmethod
|
|
63
|
+
def _serialize(obj):
|
|
64
|
+
"""Custom serialization function for unsupported types. Used by json.dumps"""
|
|
65
|
+
if isinstance(obj, datetime):
|
|
66
|
+
return obj.isoformat() # Converts datetime to ISO 8601 string
|
|
67
|
+
raise TypeError(f"Type {type(obj)} not serializable")
|
|
49
68
|
|
|
50
69
|
def from_json(self, json_string: str) -> 'OurObject':
|
|
51
70
|
"""Returns an instance of the class from a json string"""
|
|
@@ -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.136', # 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.134 → python_sdk_remote-0.0.136}/python_sdk_remote/src/http_response.py
RENAMED
|
File without changes
|
|
File without changes
|
{python_sdk_remote-0.0.134 → python_sdk_remote-0.0.136}/python_sdk_remote/src/mini_logger.py
RENAMED
|
File without changes
|
{python_sdk_remote-0.0.134 → python_sdk_remote-0.0.136}/python_sdk_remote/src/unified_json.py
RENAMED
|
File without changes
|
|
File without changes
|
{python_sdk_remote-0.0.134 → python_sdk_remote-0.0.136}/python_sdk_remote/src/valid_json_versions.py
RENAMED
|
File without changes
|
|
File without changes
|
{python_sdk_remote-0.0.134 → python_sdk_remote-0.0.136}/python_sdk_remote.egg-info/SOURCES.txt
RENAMED
|
File without changes
|
|
File without changes
|
{python_sdk_remote-0.0.134 → python_sdk_remote-0.0.136}/python_sdk_remote.egg-info/requires.txt
RENAMED
|
File without changes
|
{python_sdk_remote-0.0.134 → python_sdk_remote-0.0.136}/python_sdk_remote.egg-info/top_level.txt
RENAMED
|
File without changes
|
|
File without changes
|