cecil 0.0.12__tar.gz → 0.0.14__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 cecil might be problematic. Click here for more details.

@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.3
2
2
  Name: cecil
3
- Version: 0.0.12
3
+ Version: 0.0.14
4
4
  Summary: Python SDK for Cecil Earth
5
5
  License-Expression: MIT
6
6
  License-File: LICENSE.txt
@@ -0,0 +1 @@
1
+ __version__ = "0.0.14"
@@ -21,7 +21,7 @@ from .models import (
21
21
  )
22
22
 
23
23
  # TODO: find a way to get this version from __about__.py
24
- SDK_VERSION = "0.0.12"
24
+ SDK_VERSION = "0.0.14"
25
25
 
26
26
  # TODO: Documentation (Google style)
27
27
  # TODO: Add HTTP retries
@@ -106,6 +106,7 @@ class Client:
106
106
  res = self._post(
107
107
  url=f"/v0/recover-api-key",
108
108
  model=RecoverAPIKeyRequest(email=email),
109
+ skip_auth=True,
109
110
  )
110
111
 
111
112
  return RecoverAPIKey(**res)
@@ -115,9 +116,10 @@ class Client:
115
116
 
116
117
  return RotateAPIKey(**res)
117
118
 
118
- def _request(self, method: str, url: str, **kwargs) -> Dict:
119
+ def _request(self, method: str, url: str, skip_auth=False, **kwargs) -> Dict:
119
120
 
120
- self._set_auth()
121
+ if skip_auth is False:
122
+ self._set_auth()
121
123
 
122
124
  headers = {"cecil-python-sdk-version": SDK_VERSION}
123
125
 
@@ -136,17 +138,22 @@ class Client:
136
138
  except requests.exceptions.ConnectionError as err:
137
139
  raise ValueError("Connection error") from err
138
140
  except requests.exceptions.HTTPError as err:
139
- if err.response.status_code == 403:
140
- raise ValueError("Authentication error") from err
141
- else:
142
- raise
141
+ message = f"Request failed with status code {err.response.status_code}"
142
+ if err.response.text != "":
143
+ message += f": {err.response.text}"
144
+
145
+ raise ValueError(message) from err
143
146
 
144
147
  def _get(self, url: str, **kwargs) -> Dict:
145
148
  return self._request(method="get", url=url, **kwargs)
146
149
 
147
- def _post(self, url: str, model: BaseModel, **kwargs) -> Dict:
150
+ def _post(self, url: str, model: BaseModel, skip_auth=False, **kwargs) -> Dict:
148
151
  return self._request(
149
- method="post", url=url, json=model.model_dump(by_alias=True), **kwargs
152
+ method="post",
153
+ url=url,
154
+ json=model.model_dump(by_alias=True),
155
+ skip_auth=skip_auth,
156
+ **kwargs,
150
157
  )
151
158
 
152
159
  def _set_auth(self) -> None:
cecil-0.0.12/__about__.py DELETED
@@ -1 +0,0 @@
1
- __version__ = "0.0.12"
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes