python-sdk-remote 0.0.144__tar.gz → 0.0.145__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.144 → python_sdk_remote-0.0.145}/PKG-INFO +1 -1
  2. {python_sdk_remote-0.0.144 → python_sdk_remote-0.0.145}/python_sdk_remote/src/our_object.py +22 -2
  3. {python_sdk_remote-0.0.144 → python_sdk_remote-0.0.145}/python_sdk_remote.egg-info/PKG-INFO +1 -1
  4. {python_sdk_remote-0.0.144 → python_sdk_remote-0.0.145}/setup.py +1 -1
  5. {python_sdk_remote-0.0.144 → python_sdk_remote-0.0.145}/README.md +0 -0
  6. {python_sdk_remote-0.0.144 → python_sdk_remote-0.0.145}/pyproject.toml +0 -0
  7. {python_sdk_remote-0.0.144 → python_sdk_remote-0.0.145}/python_sdk_remote/src/__init__.py +0 -0
  8. {python_sdk_remote-0.0.144 → python_sdk_remote-0.0.145}/python_sdk_remote/src/constants.py +0 -0
  9. {python_sdk_remote-0.0.144 → python_sdk_remote-0.0.145}/python_sdk_remote/src/http_response.py +0 -0
  10. {python_sdk_remote-0.0.144 → python_sdk_remote-0.0.145}/python_sdk_remote/src/is_test_data.py +0 -0
  11. {python_sdk_remote-0.0.144 → python_sdk_remote-0.0.145}/python_sdk_remote/src/item.py +0 -0
  12. {python_sdk_remote-0.0.144 → python_sdk_remote-0.0.145}/python_sdk_remote/src/mini_logger.py +0 -0
  13. {python_sdk_remote-0.0.144 → python_sdk_remote-0.0.145}/python_sdk_remote/src/unified_json.py +0 -0
  14. {python_sdk_remote-0.0.144 → python_sdk_remote-0.0.145}/python_sdk_remote/src/utilities.py +0 -0
  15. {python_sdk_remote-0.0.144 → python_sdk_remote-0.0.145}/python_sdk_remote/src/valid_json_versions.py +0 -0
  16. {python_sdk_remote-0.0.144 → python_sdk_remote-0.0.145}/python_sdk_remote/src/validate_environment.py +0 -0
  17. {python_sdk_remote-0.0.144 → python_sdk_remote-0.0.145}/python_sdk_remote.egg-info/SOURCES.txt +0 -0
  18. {python_sdk_remote-0.0.144 → python_sdk_remote-0.0.145}/python_sdk_remote.egg-info/dependency_links.txt +0 -0
  19. {python_sdk_remote-0.0.144 → python_sdk_remote-0.0.145}/python_sdk_remote.egg-info/requires.txt +0 -0
  20. {python_sdk_remote-0.0.144 → python_sdk_remote-0.0.145}/python_sdk_remote.egg-info/top_level.txt +0 -0
  21. {python_sdk_remote-0.0.144 → python_sdk_remote-0.0.145}/setup.cfg +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: python-sdk-remote
3
- Version: 0.0.144
3
+ Version: 0.0.145
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
 
@@ -77,10 +78,29 @@ class OurObject(ABC):
77
78
  return get_all_arguments_result
78
79
 
79
80
  def to_json(self) -> str:
80
- """Returns a json string representation of this object"""
81
- to_json_result = json.dumps(self.__dict__)
81
+ """This is backwards compatible with the previous implementation"""
82
+ to_json_result = self.to_json_str()
82
83
  return to_json_result
83
84
 
85
+ def to_json_dict(self) -> str:
86
+ """Returns a json string representation of this object"""
87
+ json_str = self.to_json_str()
88
+ json_dict = json.loads(json_str)
89
+
90
+ return json_dict
91
+
92
+ def to_json_str(self) -> str:
93
+ """Returns a json string representation of this object"""
94
+ to_json_str_result = json.dumps(self.__dict__, default=self._serialize)
95
+ return to_json_str_result
96
+
97
+ @staticmethod
98
+ def _serialize(obj):
99
+ """Custom serialization function for unsupported types. Used by json.dumps"""
100
+ if isinstance(obj, datetime):
101
+ return obj.isoformat() # Converts datetime to ISO 8601 string
102
+ raise TypeError(f"Type {type(obj)} not serializable")
103
+
84
104
  def from_json(self, json_string: str) -> 'OurObject':
85
105
  """Returns an instance of the class from a json string"""
86
106
  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.144
3
+ Version: 0.0.145
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.144', # https://pypi.org/project/python-sdk-remote/
10
+ version='0.0.145', # 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",