cecil 0.0.10__py3-none-any.whl → 0.0.12__py3-none-any.whl
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.
- cecil/client.py +20 -2
- cecil/models.py +19 -0
- {cecil-0.0.10.dist-info → cecil-0.0.12.dist-info}/METADATA +1 -1
- cecil-0.0.12.dist-info/RECORD +7 -0
- cecil-0.0.10.dist-info/RECORD +0 -7
- {cecil-0.0.10.dist-info → cecil-0.0.12.dist-info}/WHEEL +0 -0
- {cecil-0.0.10.dist-info → cecil-0.0.12.dist-info}/licenses/LICENSE.txt +0 -0
cecil/client.py
CHANGED
|
@@ -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":
|
|
122
|
+
headers = {"cecil-python-sdk-version": SDK_VERSION}
|
|
105
123
|
|
|
106
124
|
try:
|
|
107
125
|
r = requests.request(
|
cecil/models.py
CHANGED
|
@@ -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
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
cecil/__init__.py,sha256=MF64bwUCd4sm3dvcxZnkb4ujHtxT_KeuXdD0nVieEt4,27
|
|
2
|
+
cecil/client.py,sha256=Lnu8eUK9e7tmq8Cb_vjfAagxfhvSQ6aRBNdksV5Ji_c,5000
|
|
3
|
+
cecil/models.py,sha256=6p9AedCDdkK-ptK2r5pc9AKG8rgZHw-YYDvRgXPAQqI,2544
|
|
4
|
+
cecil-0.0.12.dist-info/METADATA,sha256=03bTqwBAreI1zIGEXU7iCeuaIW9hkTVul673Shn6gAA,2677
|
|
5
|
+
cecil-0.0.12.dist-info/WHEEL,sha256=1yFddiXMmvYK7QYTqtRNtX66WJ0Mz8PYEiEUoOUUxRY,87
|
|
6
|
+
cecil-0.0.12.dist-info/licenses/LICENSE.txt,sha256=mUexcmfYx3bG1VIzAdQTOf_NzStYw6-QkKVdUY_d4i4,1066
|
|
7
|
+
cecil-0.0.12.dist-info/RECORD,,
|
cecil-0.0.10.dist-info/RECORD
DELETED
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
cecil/__init__.py,sha256=MF64bwUCd4sm3dvcxZnkb4ujHtxT_KeuXdD0nVieEt4,27
|
|
2
|
-
cecil/client.py,sha256=aXr6gho9NaZotpHcDmmO_XCdmfsUChyb6cKi1EC_aXc,4475
|
|
3
|
-
cecil/models.py,sha256=eSkDhHSCJyW9OsOkK7eMYh4BXY5FI1Z_THOLVLcE8QA,2027
|
|
4
|
-
cecil-0.0.10.dist-info/METADATA,sha256=ZCYjxeHDt69LzMZjkQdntRNIBLgEOpQyRYqX2pQ_6rw,2677
|
|
5
|
-
cecil-0.0.10.dist-info/WHEEL,sha256=1yFddiXMmvYK7QYTqtRNtX66WJ0Mz8PYEiEUoOUUxRY,87
|
|
6
|
-
cecil-0.0.10.dist-info/licenses/LICENSE.txt,sha256=mUexcmfYx3bG1VIzAdQTOf_NzStYw6-QkKVdUY_d4i4,1066
|
|
7
|
-
cecil-0.0.10.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|