python-sdk-remote 0.0.142__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.

Files changed (21) hide show
  1. {python_sdk_remote-0.0.142 → python_sdk_remote-0.0.143}/PKG-INFO +1 -1
  2. {python_sdk_remote-0.0.142 → python_sdk_remote-0.0.143}/python_sdk_remote/src/our_object.py +22 -2
  3. {python_sdk_remote-0.0.142 → python_sdk_remote-0.0.143}/python_sdk_remote.egg-info/PKG-INFO +1 -1
  4. {python_sdk_remote-0.0.142 → python_sdk_remote-0.0.143}/setup.py +1 -1
  5. {python_sdk_remote-0.0.142 → python_sdk_remote-0.0.143}/README.md +0 -0
  6. {python_sdk_remote-0.0.142 → python_sdk_remote-0.0.143}/pyproject.toml +0 -0
  7. {python_sdk_remote-0.0.142 → python_sdk_remote-0.0.143}/python_sdk_remote/src/__init__.py +0 -0
  8. {python_sdk_remote-0.0.142 → python_sdk_remote-0.0.143}/python_sdk_remote/src/constants.py +0 -0
  9. {python_sdk_remote-0.0.142 → python_sdk_remote-0.0.143}/python_sdk_remote/src/http_response.py +0 -0
  10. {python_sdk_remote-0.0.142 → python_sdk_remote-0.0.143}/python_sdk_remote/src/is_test_data.py +0 -0
  11. {python_sdk_remote-0.0.142 → python_sdk_remote-0.0.143}/python_sdk_remote/src/item.py +0 -0
  12. {python_sdk_remote-0.0.142 → python_sdk_remote-0.0.143}/python_sdk_remote/src/mini_logger.py +0 -0
  13. {python_sdk_remote-0.0.142 → python_sdk_remote-0.0.143}/python_sdk_remote/src/unified_json.py +0 -0
  14. {python_sdk_remote-0.0.142 → python_sdk_remote-0.0.143}/python_sdk_remote/src/utilities.py +0 -0
  15. {python_sdk_remote-0.0.142 → python_sdk_remote-0.0.143}/python_sdk_remote/src/valid_json_versions.py +0 -0
  16. {python_sdk_remote-0.0.142 → python_sdk_remote-0.0.143}/python_sdk_remote/src/validate_environment.py +0 -0
  17. {python_sdk_remote-0.0.142 → python_sdk_remote-0.0.143}/python_sdk_remote.egg-info/SOURCES.txt +0 -0
  18. {python_sdk_remote-0.0.142 → python_sdk_remote-0.0.143}/python_sdk_remote.egg-info/dependency_links.txt +0 -0
  19. {python_sdk_remote-0.0.142 → python_sdk_remote-0.0.143}/python_sdk_remote.egg-info/requires.txt +0 -0
  20. {python_sdk_remote-0.0.142 → python_sdk_remote-0.0.143}/python_sdk_remote.egg-info/top_level.txt +0 -0
  21. {python_sdk_remote-0.0.142 → python_sdk_remote-0.0.143}/setup.cfg +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: python-sdk-remote
3
- Version: 0.0.142
3
+ Version: 0.0.143
4
4
  Summary: PyPI Package for Circles Python SDK Local Python
5
5
  Home-page: https://github.com/circles-zone/python-sdk-remote-python-package
6
6
  Author: Circles
@@ -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,10 +77,29 @@ class OurObject(ABC):
76
77
  return getattr(self, 'kwargs', None)
77
78
 
78
79
  def to_json(self) -> str:
79
- """Returns a json string representation of this object"""
80
- to_json_result = json.dumps(self.__dict__)
80
+ """This is backwards compatible with the previous implementation"""
81
+ to_json_result = self.to_json_str()
81
82
  return to_json_result
82
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:
92
+ """Returns a json string representation of this object"""
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")
102
+
83
103
  def from_json(self, json_string: str) -> 'OurObject':
84
104
  """Returns an instance of the class from a json string"""
85
105
  FROM_JSON_METHOD_NAME = 'from_json'
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: python-sdk-remote
3
- Version: 0.0.142
3
+ Version: 0.0.143
4
4
  Summary: PyPI Package for Circles Python SDK Local Python
5
5
  Home-page: https://github.com/circles-zone/python-sdk-remote-python-package
6
6
  Author: Circles
@@ -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.142', # https://pypi.org/project/python-sdk-remote/
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",