cecil 0.0.10__tar.gz → 0.0.12__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.10
3
+ Version: 0.0.12
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.12"
@@ -6,7 +6,6 @@ import snowflake.connector
6
6
  from pydantic import BaseModel
7
7
  from requests import auth
8
8
 
9
- from __about__ import __version__
10
9
  from .models import (
11
10
  AOI,
12
11
  AOICreate,
@@ -14,9 +13,15 @@ from .models import (
14
13
  DataRequestCreate,
15
14
  Reprojection,
16
15
  ReprojectionCreate,
16
+ RecoverAPIKey,
17
+ RecoverAPIKeyRequest,
18
+ RotateAPIKey,
19
+ RotateAPIKeyRequest,
17
20
  SnowflakeCredentials,
18
21
  )
19
22
 
23
+ # TODO: find a way to get this version from __about__.py
24
+ SDK_VERSION = "0.0.12"
20
25
 
21
26
  # TODO: Documentation (Google style)
22
27
  # TODO: Add HTTP retries
@@ -97,11 +102,24 @@ class Client:
97
102
 
98
103
  return df
99
104
 
105
+ def recover_api_key(self, email: str) -> RecoverAPIKey:
106
+ res = self._post(
107
+ url=f"/v0/recover-api-key",
108
+ model=RecoverAPIKeyRequest(email=email),
109
+ )
110
+
111
+ return RecoverAPIKey(**res)
112
+
113
+ def rotate_api_key(self) -> RotateAPIKey:
114
+ res = self._post(url=f"/v0/rotate-api-key", model=RotateAPIKeyRequest())
115
+
116
+ return RotateAPIKey(**res)
117
+
100
118
  def _request(self, method: str, url: str, **kwargs) -> Dict:
101
119
 
102
120
  self._set_auth()
103
121
 
104
- headers = {"cecil-python-sdk-version": __version__}
122
+ headers = {"cecil-python-sdk-version": SDK_VERSION}
105
123
 
106
124
  try:
107
125
  r = requests.request(
@@ -59,6 +59,25 @@ class DataRequestCreate(BaseModel):
59
59
  dataset_id: str
60
60
 
61
61
 
62
+ class RecoverAPIKey(BaseModel):
63
+ model_config = ConfigDict(alias_generator=to_camel, populate_by_name=True)
64
+ message: str
65
+
66
+
67
+ class RecoverAPIKeyRequest(BaseModel):
68
+ model_config = ConfigDict(alias_generator=to_camel, populate_by_name=True)
69
+ email: str
70
+
71
+
72
+ class RotateAPIKey(BaseModel):
73
+ model_config = ConfigDict(alias_generator=to_camel, populate_by_name=True)
74
+ new_api_key: str
75
+
76
+
77
+ class RotateAPIKeyRequest(BaseModel):
78
+ model_config = ConfigDict(alias_generator=to_camel, populate_by_name=True)
79
+
80
+
62
81
  class Reprojection(BaseModel):
63
82
  model_config = ConfigDict(alias_generator=to_camel, populate_by_name=True)
64
83
  id: str
cecil-0.0.10/__about__.py DELETED
@@ -1 +0,0 @@
1
- __version__ = "0.0.10"
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