cecil 0.0.20__py3-none-any.whl → 0.0.22__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 +12 -22
- cecil/models.py +5 -19
- cecil/version.py +1 -1
- {cecil-0.0.20.dist-info → cecil-0.0.22.dist-info}/METADATA +1 -1
- cecil-0.0.22.dist-info/RECORD +9 -0
- cecil-0.0.20.dist-info/RECORD +0 -9
- {cecil-0.0.20.dist-info → cecil-0.0.22.dist-info}/WHEEL +0 -0
- {cecil-0.0.20.dist-info → cecil-0.0.22.dist-info}/licenses/LICENSE.txt +0 -0
cecil/client.py
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import os
|
|
2
|
-
from typing import Dict, List
|
|
2
|
+
from typing import Dict, List, Optional
|
|
3
3
|
|
|
4
4
|
import pandas as pd
|
|
5
5
|
import requests
|
|
@@ -21,14 +21,11 @@ from .models import (
|
|
|
21
21
|
AOICreate,
|
|
22
22
|
DataRequest,
|
|
23
23
|
DataRequestCreate,
|
|
24
|
-
OrganisationCreate,
|
|
25
24
|
OrganisationSettings,
|
|
26
25
|
RecoverAPIKey,
|
|
27
26
|
RecoverAPIKeyRequest,
|
|
28
27
|
RotateAPIKey,
|
|
29
28
|
RotateAPIKeyRequest,
|
|
30
|
-
SignUpRequest,
|
|
31
|
-
SignUpResponse,
|
|
32
29
|
SnowflakeUserCredentials,
|
|
33
30
|
Transformation,
|
|
34
31
|
TransformationCreate,
|
|
@@ -46,9 +43,12 @@ class Client:
|
|
|
46
43
|
)
|
|
47
44
|
self._snowflake_user_creds = None
|
|
48
45
|
|
|
49
|
-
def create_aoi(self,
|
|
46
|
+
def create_aoi(self, geometry: Dict, external_ref: Optional[str] = None) -> AOI:
|
|
50
47
|
# TODO: validate geometry
|
|
51
|
-
res = self._post(
|
|
48
|
+
res = self._post(
|
|
49
|
+
url="/v0/aois",
|
|
50
|
+
model=AOICreate(geometry=geometry, external_ref=external_ref),
|
|
51
|
+
)
|
|
52
52
|
return AOI(**res)
|
|
53
53
|
|
|
54
54
|
def get_aoi(self, id: str) -> AOI:
|
|
@@ -59,10 +59,14 @@ class Client:
|
|
|
59
59
|
res = self._get(url="/v0/aois")
|
|
60
60
|
return [AOIRecord(**record) for record in res["records"]]
|
|
61
61
|
|
|
62
|
-
def create_data_request(
|
|
62
|
+
def create_data_request(
|
|
63
|
+
self, aoi_id: str, dataset_id: str, external_ref: Optional[str] = None
|
|
64
|
+
) -> DataRequest:
|
|
63
65
|
res = self._post(
|
|
64
66
|
url="/v0/data-requests",
|
|
65
|
-
model=DataRequestCreate(
|
|
67
|
+
model=DataRequestCreate(
|
|
68
|
+
aoi_id=aoi_id, dataset_id=dataset_id, external_ref=external_ref
|
|
69
|
+
),
|
|
66
70
|
)
|
|
67
71
|
return DataRequest(**res)
|
|
68
72
|
|
|
@@ -129,20 +133,6 @@ class Client:
|
|
|
129
133
|
|
|
130
134
|
return RotateAPIKey(**res)
|
|
131
135
|
|
|
132
|
-
def sign_up(
|
|
133
|
-
self, organisation: Dict[str, str], user: Dict[str, str]
|
|
134
|
-
) -> SignUpResponse:
|
|
135
|
-
res = self._post(
|
|
136
|
-
url="/v0/sign-up",
|
|
137
|
-
model=SignUpRequest(
|
|
138
|
-
organisation=OrganisationCreate(**organisation),
|
|
139
|
-
user=UserCreate(**user),
|
|
140
|
-
),
|
|
141
|
-
skip_auth=True,
|
|
142
|
-
)
|
|
143
|
-
|
|
144
|
-
return SignUpResponse(**res)
|
|
145
|
-
|
|
146
136
|
def create_user(self, first_name: str, last_name: str, email: str) -> User:
|
|
147
137
|
res = self._post(
|
|
148
138
|
url="/v0/users",
|
cecil/models.py
CHANGED
|
@@ -8,7 +8,7 @@ from pydantic.alias_generators import to_camel
|
|
|
8
8
|
class AOI(BaseModel):
|
|
9
9
|
model_config = ConfigDict(alias_generator=to_camel, populate_by_name=True)
|
|
10
10
|
id: str
|
|
11
|
-
|
|
11
|
+
external_ref: Optional[str]
|
|
12
12
|
geometry: Dict
|
|
13
13
|
hectares: float
|
|
14
14
|
created_at: datetime.datetime
|
|
@@ -18,7 +18,7 @@ class AOI(BaseModel):
|
|
|
18
18
|
class AOIRecord(BaseModel):
|
|
19
19
|
model_config = ConfigDict(alias_generator=to_camel, populate_by_name=True)
|
|
20
20
|
id: str
|
|
21
|
-
|
|
21
|
+
external_ref: Optional[str]
|
|
22
22
|
hectares: float
|
|
23
23
|
created_at: datetime.datetime
|
|
24
24
|
created_by: str
|
|
@@ -26,8 +26,8 @@ class AOIRecord(BaseModel):
|
|
|
26
26
|
|
|
27
27
|
class AOICreate(BaseModel):
|
|
28
28
|
model_config = ConfigDict(alias_generator=to_camel, populate_by_name=True)
|
|
29
|
-
name: str
|
|
30
29
|
geometry: Dict
|
|
30
|
+
external_ref: Optional[str]
|
|
31
31
|
|
|
32
32
|
|
|
33
33
|
class DataRequest(BaseModel):
|
|
@@ -35,6 +35,7 @@ class DataRequest(BaseModel):
|
|
|
35
35
|
id: str
|
|
36
36
|
aoi_id: str
|
|
37
37
|
dataset_id: str
|
|
38
|
+
external_ref: Optional[str]
|
|
38
39
|
created_at: datetime.datetime
|
|
39
40
|
created_by: str
|
|
40
41
|
|
|
@@ -43,11 +44,7 @@ class DataRequestCreate(BaseModel):
|
|
|
43
44
|
model_config = ConfigDict(alias_generator=to_camel, populate_by_name=True)
|
|
44
45
|
aoi_id: str
|
|
45
46
|
dataset_id: str
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
class OrganisationCreate(BaseModel):
|
|
49
|
-
model_config = ConfigDict(alias_generator=to_camel, populate_by_name=True)
|
|
50
|
-
name: str
|
|
47
|
+
external_ref: Optional[str]
|
|
51
48
|
|
|
52
49
|
|
|
53
50
|
class OrganisationSettings(BaseModel):
|
|
@@ -113,14 +110,3 @@ class UserCreate(BaseModel):
|
|
|
113
110
|
first_name: str
|
|
114
111
|
last_name: str
|
|
115
112
|
email: str
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
class SignUpRequest(BaseModel):
|
|
119
|
-
model_config = ConfigDict(alias_generator=to_camel, populate_by_name=True)
|
|
120
|
-
organisation: OrganisationCreate
|
|
121
|
-
user: UserCreate
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
class SignUpResponse(BaseModel):
|
|
125
|
-
model_config = ConfigDict(alias_generator=to_camel, populate_by_name=True)
|
|
126
|
-
message: str
|
cecil/version.py
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
__version__ = "0.0.
|
|
1
|
+
__version__ = "0.0.22"
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
cecil/__init__.py,sha256=AEcRl73BDSAQe6W0d1PDD87IEcumARtREl7dCVa_YQY,86
|
|
2
|
+
cecil/client.py,sha256=3aWjfXIcxxAetJ0HFw_fChb-SDefAEybUdYPAX62pQk,7623
|
|
3
|
+
cecil/errors.py,sha256=ZNiSTYH2MgNZ7tNIgV07-Ge3KtmdncfzWiBi9yjURGs,1818
|
|
4
|
+
cecil/models.py,sha256=rMY8oOKqcBgIVY8UH31-BgQFFx7myPrgyFgCNuSwLzY,2917
|
|
5
|
+
cecil/version.py,sha256=jm3DtWh67jHGndudbAPoUHe_3HKFBWN3B5blfPj6v9g,23
|
|
6
|
+
cecil-0.0.22.dist-info/METADATA,sha256=dVw9o67f_-oQcvsxa7P8Y_BAbWuucqtAR5ZyS9PKCSk,2659
|
|
7
|
+
cecil-0.0.22.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
|
|
8
|
+
cecil-0.0.22.dist-info/licenses/LICENSE.txt,sha256=mUexcmfYx3bG1VIzAdQTOf_NzStYw6-QkKVdUY_d4i4,1066
|
|
9
|
+
cecil-0.0.22.dist-info/RECORD,,
|
cecil-0.0.20.dist-info/RECORD
DELETED
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
cecil/__init__.py,sha256=AEcRl73BDSAQe6W0d1PDD87IEcumARtREl7dCVa_YQY,86
|
|
2
|
-
cecil/client.py,sha256=mTmwI-p7fidDB4zv_D1S6M8cbms1NL90CifPV0tNF4k,7888
|
|
3
|
-
cecil/errors.py,sha256=ZNiSTYH2MgNZ7tNIgV07-Ge3KtmdncfzWiBi9yjURGs,1818
|
|
4
|
-
cecil/models.py,sha256=9RLtS5c3wHeu9jCqrL_XEc2POtubDY9RImkyDD4004A,3233
|
|
5
|
-
cecil/version.py,sha256=wQP0zPwrPeGkZ12uVa4mTM7oYoqji6PECSRd7QD_QXE,23
|
|
6
|
-
cecil-0.0.20.dist-info/METADATA,sha256=_ZP24-gkB3FmUSrbhEXQu6QuMBODzOa81ZcQG7WEimE,2659
|
|
7
|
-
cecil-0.0.20.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
|
|
8
|
-
cecil-0.0.20.dist-info/licenses/LICENSE.txt,sha256=mUexcmfYx3bG1VIzAdQTOf_NzStYw6-QkKVdUY_d4i4,1066
|
|
9
|
-
cecil-0.0.20.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|