cecil 0.0.18__tar.gz → 0.0.20__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.18
3
+ Version: 0.0.20
4
4
  Summary: Python SDK for Cecil Earth
5
5
  License-Expression: MIT
6
6
  License-File: LICENSE.txt
@@ -17,10 +17,12 @@ from .errors import (
17
17
  )
18
18
  from .models import (
19
19
  AOI,
20
+ AOIRecord,
20
21
  AOICreate,
21
22
  DataRequest,
22
23
  DataRequestCreate,
23
24
  OrganisationCreate,
25
+ OrganisationSettings,
24
26
  RecoverAPIKey,
25
27
  RecoverAPIKeyRequest,
26
28
  RotateAPIKey,
@@ -53,9 +55,9 @@ class Client:
53
55
  res = self._get(url=f"/v0/aois/{id}")
54
56
  return AOI(**res)
55
57
 
56
- def list_aois(self) -> List[AOI]:
58
+ def list_aois(self) -> List[AOIRecord]:
57
59
  res = self._get(url="/v0/aois")
58
- return [AOI(**record) for record in res["records"]]
60
+ return [AOIRecord(**record) for record in res["records"]]
59
61
 
60
62
  def create_data_request(self, aoi_id: str, dataset_id: str) -> DataRequest:
61
63
  res = self._post(
@@ -160,6 +162,23 @@ class Client:
160
162
  res = self._get(url="/v0/users")
161
163
  return [User(**record) for record in res["records"]]
162
164
 
165
+ def get_organisation_settings(self) -> OrganisationSettings:
166
+ res = self._get(url="/v0/organisation/settings")
167
+ return OrganisationSettings(**res)
168
+
169
+ def update_organisation_settings(
170
+ self,
171
+ *,
172
+ monthly_data_request_limit,
173
+ ) -> OrganisationSettings:
174
+ res = self._post(
175
+ url="/v0/organisation/settings",
176
+ model=OrganisationSettings(
177
+ monthly_data_request_limit=monthly_data_request_limit,
178
+ ),
179
+ )
180
+ return OrganisationSettings(**res)
181
+
163
182
  def _request(self, method: str, url: str, skip_auth=False, **kwargs) -> Dict:
164
183
 
165
184
  if skip_auth is False:
@@ -1,5 +1,5 @@
1
1
  import datetime
2
- from typing import Dict
2
+ from typing import Dict, Optional
3
3
 
4
4
  from pydantic import BaseModel, ConfigDict, SecretStr
5
5
  from pydantic.alias_generators import to_camel
@@ -15,6 +15,15 @@ class AOI(BaseModel):
15
15
  created_by: str
16
16
 
17
17
 
18
+ class AOIRecord(BaseModel):
19
+ model_config = ConfigDict(alias_generator=to_camel, populate_by_name=True)
20
+ id: str
21
+ name: str
22
+ hectares: float
23
+ created_at: datetime.datetime
24
+ created_by: str
25
+
26
+
18
27
  class AOICreate(BaseModel):
19
28
  model_config = ConfigDict(alias_generator=to_camel, populate_by_name=True)
20
29
  name: str
@@ -41,6 +50,11 @@ class OrganisationCreate(BaseModel):
41
50
  name: str
42
51
 
43
52
 
53
+ class OrganisationSettings(BaseModel):
54
+ model_config = ConfigDict(alias_generator=to_camel, populate_by_name=True)
55
+ monthly_data_request_limit: Optional[int] = None
56
+
57
+
44
58
  class RecoverAPIKey(BaseModel):
45
59
  model_config = ConfigDict(alias_generator=to_camel, populate_by_name=True)
46
60
  message: str
@@ -0,0 +1 @@
1
+ __version__ = "0.0.20"
@@ -1 +0,0 @@
1
- __version__ = "0.0.18"
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