cecil 0.0.21__tar.gz → 0.0.22__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.
- {cecil-0.0.21 → cecil-0.0.22}/PKG-INFO +1 -1
- {cecil-0.0.21 → cecil-0.0.22}/src/cecil/client.py +12 -5
- {cecil-0.0.21 → cecil-0.0.22}/src/cecil/models.py +5 -3
- cecil-0.0.22/src/cecil/version.py +1 -0
- cecil-0.0.21/src/cecil/version.py +0 -1
- {cecil-0.0.21 → cecil-0.0.22}/.editorconfig +0 -0
- {cecil-0.0.21 → cecil-0.0.22}/.gitignore +0 -0
- {cecil-0.0.21 → cecil-0.0.22}/CONTRIBUTING.md +0 -0
- {cecil-0.0.21 → cecil-0.0.22}/LICENSE.txt +0 -0
- {cecil-0.0.21 → cecil-0.0.22}/Makefile +0 -0
- {cecil-0.0.21 → cecil-0.0.22}/README.md +0 -0
- {cecil-0.0.21 → cecil-0.0.22}/pyproject.toml +0 -0
- {cecil-0.0.21 → cecil-0.0.22}/src/cecil/__init__.py +0 -0
- {cecil-0.0.21 → cecil-0.0.22}/src/cecil/errors.py +0 -0
- {cecil-0.0.21 → cecil-0.0.22}/tests/__init__.py +0 -0
- {cecil-0.0.21 → cecil-0.0.22}/tests/test_client.py +0 -0
|
@@ -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
|
|
@@ -43,9 +43,12 @@ class Client:
|
|
|
43
43
|
)
|
|
44
44
|
self._snowflake_user_creds = None
|
|
45
45
|
|
|
46
|
-
def create_aoi(self,
|
|
46
|
+
def create_aoi(self, geometry: Dict, external_ref: Optional[str] = None) -> AOI:
|
|
47
47
|
# TODO: validate geometry
|
|
48
|
-
res = self._post(
|
|
48
|
+
res = self._post(
|
|
49
|
+
url="/v0/aois",
|
|
50
|
+
model=AOICreate(geometry=geometry, external_ref=external_ref),
|
|
51
|
+
)
|
|
49
52
|
return AOI(**res)
|
|
50
53
|
|
|
51
54
|
def get_aoi(self, id: str) -> AOI:
|
|
@@ -56,10 +59,14 @@ class Client:
|
|
|
56
59
|
res = self._get(url="/v0/aois")
|
|
57
60
|
return [AOIRecord(**record) for record in res["records"]]
|
|
58
61
|
|
|
59
|
-
def create_data_request(
|
|
62
|
+
def create_data_request(
|
|
63
|
+
self, aoi_id: str, dataset_id: str, external_ref: Optional[str] = None
|
|
64
|
+
) -> DataRequest:
|
|
60
65
|
res = self._post(
|
|
61
66
|
url="/v0/data-requests",
|
|
62
|
-
model=DataRequestCreate(
|
|
67
|
+
model=DataRequestCreate(
|
|
68
|
+
aoi_id=aoi_id, dataset_id=dataset_id, external_ref=external_ref
|
|
69
|
+
),
|
|
63
70
|
)
|
|
64
71
|
return DataRequest(**res)
|
|
65
72
|
|
|
@@ -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,6 +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
|
|
47
|
+
external_ref: Optional[str]
|
|
46
48
|
|
|
47
49
|
|
|
48
50
|
class OrganisationSettings(BaseModel):
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
__version__ = "0.0.22"
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
__version__ = "0.0.21"
|
|
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
|
|
File without changes
|