cecil 0.0.20__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.

@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: cecil
3
- Version: 0.0.20
3
+ Version: 0.0.22
4
4
  Summary: Python SDK for Cecil Earth
5
5
  License-Expression: MIT
6
6
  License-File: LICENSE.txt
@@ -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, name: str, geometry: Dict) -> AOI:
46
+ def create_aoi(self, geometry: Dict, external_ref: Optional[str] = None) -> AOI:
50
47
  # TODO: validate geometry
51
- res = self._post(url="/v0/aois", model=AOICreate(name=name, geometry=geometry))
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(self, aoi_id: str, dataset_id: str) -> DataRequest:
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(aoi_id=aoi_id, dataset_id=dataset_id),
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",
@@ -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
- name: str
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
- name: str
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
@@ -0,0 +1 @@
1
+ __version__ = "0.0.22"
@@ -1 +0,0 @@
1
- __version__ = "0.0.20"
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