python-sdk-remote 0.0.172__tar.gz → 0.0.174__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 (33) hide show
  1. {python_sdk_remote-0.0.172 → python_sdk_remote-0.0.174}/PKG-INFO +2 -1
  2. {python_sdk_remote-0.0.172 → python_sdk_remote-0.0.174}/python_sdk_remote/src/__init__.py +4 -1
  3. {python_sdk_remote-0.0.172 → python_sdk_remote-0.0.174}/python_sdk_remote/src/item.py +3 -1
  4. python_sdk_remote-0.0.174/python_sdk_remote/src/our_object.py +56 -0
  5. {python_sdk_remote-0.0.172 → python_sdk_remote-0.0.174}/python_sdk_remote.egg-info/PKG-INFO +2 -1
  6. {python_sdk_remote-0.0.172 → python_sdk_remote-0.0.174}/python_sdk_remote.egg-info/requires.txt +1 -0
  7. {python_sdk_remote-0.0.172 → python_sdk_remote-0.0.174}/setup.py +5 -1
  8. python_sdk_remote-0.0.172/python_sdk_remote/src/our_object.py +0 -174
  9. {python_sdk_remote-0.0.172 → python_sdk_remote-0.0.174}/README.md +0 -0
  10. {python_sdk_remote-0.0.172 → python_sdk_remote-0.0.174}/pyproject.toml +0 -0
  11. {python_sdk_remote-0.0.172 → python_sdk_remote-0.0.174}/python_sdk_remote/src/constants.py +0 -0
  12. {python_sdk_remote-0.0.172 → python_sdk_remote-0.0.174}/python_sdk_remote/src/constants_src_mini_logger_and_logger.py +0 -0
  13. {python_sdk_remote-0.0.172 → python_sdk_remote-0.0.174}/python_sdk_remote/src/datetime_range.py +0 -0
  14. {python_sdk_remote-0.0.172 → python_sdk_remote-0.0.174}/python_sdk_remote/src/exceptions.py +0 -0
  15. {python_sdk_remote-0.0.172 → python_sdk_remote-0.0.174}/python_sdk_remote/src/generic_crud.py +0 -0
  16. {python_sdk_remote-0.0.172 → python_sdk_remote-0.0.174}/python_sdk_remote/src/http_response.py +0 -0
  17. {python_sdk_remote-0.0.172 → python_sdk_remote-0.0.174}/python_sdk_remote/src/is_test_data.py +0 -0
  18. {python_sdk_remote-0.0.172 → python_sdk_remote-0.0.174}/python_sdk_remote/src/mini_logger.py +0 -0
  19. {python_sdk_remote-0.0.172 → python_sdk_remote-0.0.174}/python_sdk_remote/src/our_obfuscation.py +0 -0
  20. {python_sdk_remote-0.0.172 → python_sdk_remote-0.0.174}/python_sdk_remote/src/our_objects.py +0 -0
  21. {python_sdk_remote-0.0.172 → python_sdk_remote-0.0.174}/python_sdk_remote/src/our_objects_local.py +0 -0
  22. {python_sdk_remote-0.0.172 → python_sdk_remote-0.0.174}/python_sdk_remote/src/our_objects_remote.py +0 -0
  23. {python_sdk_remote-0.0.172 → python_sdk_remote-0.0.174}/python_sdk_remote/src/our_request.py +0 -0
  24. {python_sdk_remote-0.0.172 → python_sdk_remote-0.0.174}/python_sdk_remote/src/our_request_old.py +0 -0
  25. {python_sdk_remote-0.0.172 → python_sdk_remote-0.0.174}/python_sdk_remote/src/unified_json.py +0 -0
  26. {python_sdk_remote-0.0.172 → python_sdk_remote-0.0.174}/python_sdk_remote/src/utilities.py +0 -0
  27. {python_sdk_remote-0.0.172 → python_sdk_remote-0.0.174}/python_sdk_remote/src/valid_json_versions.py +0 -0
  28. {python_sdk_remote-0.0.172 → python_sdk_remote-0.0.174}/python_sdk_remote/src/validate_environment.py +0 -0
  29. {python_sdk_remote-0.0.172 → python_sdk_remote-0.0.174}/python_sdk_remote/src/version.py +0 -0
  30. {python_sdk_remote-0.0.172 → python_sdk_remote-0.0.174}/python_sdk_remote.egg-info/SOURCES.txt +0 -0
  31. {python_sdk_remote-0.0.172 → python_sdk_remote-0.0.174}/python_sdk_remote.egg-info/dependency_links.txt +0 -0
  32. {python_sdk_remote-0.0.172 → python_sdk_remote-0.0.174}/python_sdk_remote.egg-info/top_level.txt +0 -0
  33. {python_sdk_remote-0.0.172 → python_sdk_remote-0.0.174}/setup.cfg +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: python-sdk-remote
3
- Version: 0.0.172
3
+ Version: 0.0.174
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
@@ -12,6 +12,7 @@ Requires-Dist: requests
12
12
  Requires-Dist: python-dotenv
13
13
  Requires-Dist: url-remote
14
14
  Requires-Dist: pyjwt
15
+ Requires-Dist: our-object-local
15
16
  Dynamic: author
16
17
  Dynamic: author-email
17
18
  Dynamic: classifier
@@ -67,7 +67,10 @@ from .our_objects_local import OurObjectsLocal
67
67
 
68
68
  # Existing classes
69
69
  from .mini_logger import MiniLogger
70
- from .our_object import OurObject
70
+ # OurObject moved to our-object-local. Imported from there rather than from the
71
+ # deprecated .our_object re-export, so that `import python_sdk_remote` does not
72
+ # emit a deprecation warning for itself on every single import.
73
+ from our_object_local.our_object import OurObject
71
74
  from .version import PACKAGE_VERSION
72
75
 
73
76
  # Constants
@@ -1,6 +1,8 @@
1
1
  from abc import abstractmethod
2
2
 
3
- from .our_object import OurObject
3
+ # Straight from the owning package, not through our_object.py: that module is the
4
+ # deprecated path and warns, and this package must not warn about itself.
5
+ from our_object_local.our_object import OurObject
4
6
 
5
7
  ENTITY_NAME = "item"
6
8
 
@@ -0,0 +1,56 @@
1
+ """Backward-compatibility re-export of `OurObject`, which now lives in `our-object-local`.
2
+
3
+ The class moved to the `our-object-local` package so that anything wanting the
4
+ base business object no longer has to take the whole SDK, and so that
5
+ `our-object-field-local` can sit above `fields-local` without a cycle:
6
+
7
+ our-object-field-local -> fields-local -> python-sdk-remote -> our-object-local
8
+
9
+ `our-object-local` declares no circlez dependencies at all, which is what keeps
10
+ that chain acyclic.
11
+
12
+ This module is temporary. It exists only so that
13
+ `from python_sdk_remote.our_object import OurObject` - what every consumer
14
+ writes today - keeps working while they migrate: `Contact` (contact-local),
15
+ `Event` (event-local), `FieldLocal` (fields-local), `CalendarLocal`
16
+ (calendar-local), `Item` (in this package), and both `GenericCRUD.foreach()`
17
+ and `HelperMysqlObject` in database-mysql-local.
18
+
19
+ New code should import from the owning package instead:
20
+
21
+ from our_object_local.our_object import OurObject
22
+
23
+ Reading `OurObject` from here calls `deprecation_warning_function`, so every
24
+ remaining caller shows up in the logs - and therefore in the metrics - with its
25
+ own file name. That is what tells us when this module can be deleted. The
26
+ warning is raised from a module-level `__getattr__` (PEP 562) rather than at
27
+ import time on purpose: at import time the only frame above us is
28
+ `<frozen importlib._bootstrap>`, which names no caller and measures nothing.
29
+
30
+ Nothing inside this package reads `OurObject` through this module - `item.py`
31
+ and `__init__.py` import it straight from `our_object_local` - so every warning
32
+ counted here comes from a real consumer.
33
+
34
+ Not to be confused with `OurObjectsLocal` (plural) in `our_objects_local.py`,
35
+ which is an unrelated `GenericCRUD` collection layer that stays in this package.
36
+ """
37
+ from typing import TYPE_CHECKING, Any
38
+
39
+ from .utilities import deprecation_warning_function
40
+
41
+ if TYPE_CHECKING: # so type checkers still resolve OurObject to the real class
42
+ from our_object_local.our_object import OurObject
43
+
44
+ OLD_OUR_OBJECT_IMPORT_PATH = 'python_sdk_remote.our_object.OurObject'
45
+ NEW_OUR_OBJECT_IMPORT_PATH = 'our_object_local.our_object.OurObject'
46
+
47
+ __all__ = ['OurObject']
48
+
49
+
50
+ def __getattr__(name: str) -> Any:
51
+ if name == 'OurObject':
52
+ deprecation_warning_function(old_name=OLD_OUR_OBJECT_IMPORT_PATH,
53
+ new_name=NEW_OUR_OBJECT_IMPORT_PATH)
54
+ from our_object_local.our_object import OurObject as our_object_class
55
+ return our_object_class
56
+ raise AttributeError(f"module {__name__!r} has no attribute {name!r}")
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: python-sdk-remote
3
- Version: 0.0.172
3
+ Version: 0.0.174
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
@@ -12,6 +12,7 @@ Requires-Dist: requests
12
12
  Requires-Dist: python-dotenv
13
13
  Requires-Dist: url-remote
14
14
  Requires-Dist: pyjwt
15
+ Requires-Dist: our-object-local
15
16
  Dynamic: author
16
17
  Dynamic: author-email
17
18
  Dynamic: classifier
@@ -2,3 +2,4 @@ requests
2
2
  python-dotenv
3
3
  url-remote
4
4
  pyjwt
5
+ our-object-local
@@ -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.172', # https://pypi.org/project/python-sdk-remote#history
10
+ version='0.0.174', # https://pypi.org/project/python-sdk-remote#history
11
11
  author="Circles",
12
12
  author_email="info@circlez.ai",
13
13
  description="PyPI Package for Circles Python SDK Local Python",
@@ -28,5 +28,9 @@ setuptools.setup(
28
28
  "python-dotenv",
29
29
  "url-remote",
30
30
  "pyjwt",
31
+ # OurObject lives here now. item.py and __init__.py import it from this
32
+ # package directly; our_object.py is a temporary deprecated re-export kept
33
+ # for consumers still on `from python_sdk_remote.our_object import OurObject`.
34
+ "our-object-local",
31
35
  ]
32
36
  )
@@ -1,174 +0,0 @@
1
- import json
2
- from abc import ABC # , abstractmethod
3
- from datetime import datetime
4
- from typing import Any, Optional
5
-
6
- from .mini_logger import MiniLogger as logger
7
-
8
- from .version import PACKAGE_VERSION
9
-
10
-
11
- """
12
- Base class for all business objects in the system.
13
-
14
- This class provides common functionality for all entities including:
15
- - JSON serialization/deserialization
16
- - Equality comparison
17
- - String representation
18
- - Attribute access
19
-
20
- Usage: Extend this class for all business entities to ensure consistent behavior.
21
- """
22
- class OurObject(ABC):
23
-
24
- entity_name: Optional[str] = None
25
- id: Optional[int] = None
26
-
27
- # Needed by print_our_object_with_id()
28
- name: Optional[str] = None
29
- number: Optional[int] = None
30
-
31
- fields = {
32
- # Needed by print_our_object_with_id()
33
- "name",
34
- "number"
35
- }
36
-
37
- def __init__(self, entity_name: Optional[str] = None,
38
- id: Optional[int] = None, **kwargs: Any):
39
- INIT_METHOD_NAME = '__init__'
40
- logger.start(INIT_METHOD_NAME, object={'kwargs': kwargs})
41
- self.set_entity_name(entity_name)
42
- self.set_id(id)
43
- self.kwargs = kwargs
44
- logger.end(INIT_METHOD_NAME, object={'kwargs': kwargs})
45
-
46
- def __convert_kwargs_to_fields(self, kwargs, fields):
47
- """Convert kwargs to object fields based on allowed fields list."""
48
- for field, value in kwargs.items():
49
- if field in fields:
50
- setattr(self, field, value)
51
-
52
- def __convert_fields_to_kwargs(self, fields, kwargs):
53
- """
54
- Convert fields to kwargs format.
55
-
56
- Note: This method may be removed in future versions if unused.
57
- """
58
- for field in fields:
59
- if field in kwargs:
60
- setattr(self, field, kwargs[field])
61
- else:
62
- setattr(self, field, None)
63
-
64
- def set_entity_name(self, entity_name: Optional[str]) -> None:
65
- self.entity_name = entity_name
66
-
67
- def get_id_column_name(self) -> str:
68
- """Returns the name of the column that is used as the id of the object"""
69
- # BEHAVIOUR NOTE: was `self.entity_name + "_id"`, which raised
70
- # TypeError on the default entity_name of None. Same fix as in
71
- # our-object-local, so the two copies stay identical.
72
- id_column_name = str(self.entity_name) + "_id"
73
- return id_column_name
74
-
75
- def set_id(self, id: Optional[int]) -> None:
76
- self.id = id
77
-
78
- def get_id(self) -> Optional[int]:
79
- return self.id
80
-
81
- # Commented so we can use it in database foreach()
82
- # @abstractmethod
83
- def get_name(self) -> Optional[str]:
84
- """Returns the name of the object"""
85
- # raise NotImplementedError(
86
- # "Subclasses must implement the 'get_name' method.")
87
- return None
88
-
89
- def get(self, attr_name: str) -> Any:
90
- """Returns the value of the attribute with the given name"""
91
- GET_METHOD_NAME = 'get'
92
- logger.start(GET_METHOD_NAME, object={'attr_name': attr_name})
93
- # BEHAVIOUR NOTE: the getattr default of None was already there, but
94
- # .get() was then called on it unconditionally, so any instance built
95
- # without __init__ - from_json does exactly that - raised
96
- # AttributeError. Same guard as in our-object-local.
97
- arguments = getattr(self, 'kwargs', None)
98
- value = arguments.get(attr_name, None) if arguments else None
99
- logger.end(GET_METHOD_NAME, object={'attr_name': attr_name})
100
- return value
101
-
102
- def get_all_arguments(self):
103
- """Returns all the arguments passed to the constructor as a dictionary"""
104
- get_all_arguments_result = getattr(self, 'kwargs', None)
105
- return get_all_arguments_result
106
-
107
- def to_json(self) -> str:
108
- """This is backwards compatible with the previous implementation"""
109
- to_json_result = self.to_json_str()
110
- return to_json_result
111
-
112
- def to_json_dict(self) -> str:
113
- """Returns a json string representation of this object"""
114
- json_str = self.to_json_str()
115
- json_dict = json.loads(json_str)
116
-
117
- return json_dict
118
-
119
- def to_json_str(self) -> str:
120
- """Returns a json string representation of this object"""
121
- to_json_str_result = json.dumps(self.__dict__, default=self._serialize)
122
- return to_json_str_result
123
-
124
- @staticmethod
125
- def _serialize(obj):
126
- """Custom serialization function for unsupported types. Used by json.dumps"""
127
- if isinstance(obj, datetime):
128
- return obj.isoformat() # Converts datetime to ISO 8601 string
129
- raise TypeError(f"Type {type(obj)} not serializable")
130
-
131
- def from_json(self, json_string: str) -> 'OurObject':
132
- """Returns an instance of the class from a json string"""
133
- FROM_JSON_METHOD_NAME = 'from_json'
134
- logger.start(FROM_JSON_METHOD_NAME,
135
- object={'json_string': json_string})
136
- self.__dict__ = json.loads(json_string)
137
- logger.end(FROM_JSON_METHOD_NAME,
138
- object={'json_dict': self.__dict__})
139
- return self
140
-
141
- def __eq__(self, other) -> bool:
142
- """Checks if two objects are equal"""
143
- if not isinstance(other, OurObject):
144
- return False
145
- eq_result = self.__dict__ == other.__dict__
146
- return eq_result
147
-
148
- def __ne__(self, other) -> bool:
149
- """Checks if two objects are not equal"""
150
- ne_result = not self.__eq__(other)
151
- return ne_result
152
-
153
- def __str__(self):
154
- str_result = self.entity_name + ": " + str(self.__dict__)
155
- return str_result
156
-
157
- def __repr__(self):
158
- """String representation for debugging."""
159
- # Ensure both entity_name and __dict__ are not None for proper representation
160
- entity_name = self.entity_name or "OurObject"
161
- dict_str = str(self.__dict__) if self.__dict__ else "{}"
162
- repr_result = f"{entity_name}: {dict_str}"
163
- return repr_result
164
-
165
- def to_dict(self):
166
- return self.__dict__
167
-
168
- def get_package_version(self) -> str:
169
- """
170
- Get package version.
171
-
172
- Note: Returns version of python-sdk-remote, not the derived class package.
173
- """
174
- return PACKAGE_VERSION