cecil 0.0.24__py3-none-any.whl → 0.0.25__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 +41 -0
- cecil/version.py +1 -1
- {cecil-0.0.24.dist-info → cecil-0.0.25.dist-info}/METADATA +8 -5
- cecil-0.0.25.dist-info/RECORD +10 -0
- cecil-0.0.24.dist-info/RECORD +0 -10
- {cecil-0.0.24.dist-info → cecil-0.0.25.dist-info}/WHEEL +0 -0
- {cecil-0.0.24.dist-info → cecil-0.0.25.dist-info}/licenses/LICENSE.txt +0 -0
cecil/client.py
CHANGED
|
@@ -9,6 +9,7 @@ from pydantic import BaseModel
|
|
|
9
9
|
from requests import auth
|
|
10
10
|
from cryptography.hazmat.primitives import serialization
|
|
11
11
|
from typing import Dict, List, Optional
|
|
12
|
+
from warnings import warn
|
|
12
13
|
|
|
13
14
|
from .errors import (
|
|
14
15
|
Error,
|
|
@@ -87,9 +88,31 @@ class Client:
|
|
|
87
88
|
metadata = DataRequestMetadata(**res)
|
|
88
89
|
return load_xarray(metadata)
|
|
89
90
|
|
|
91
|
+
def load_dataframe(self, data_request_id: str) -> pd.DataFrame:
|
|
92
|
+
|
|
93
|
+
data_request = self.get_data_request(data_request_id)
|
|
94
|
+
|
|
95
|
+
try:
|
|
96
|
+
secure_view = {
|
|
97
|
+
"528f54b8-1cb9-412c-a646-30a55ddb7cbd": "data_request_db.ibat.kba",
|
|
98
|
+
"f30f2125-c472-43c7-85c8-52f0d4b1d160": "data_request_db.ibat.redlist",
|
|
99
|
+
"c1ee0d62-95ef-49b1-adf1-6a5a933d726d": "data_request_db.ibat.wdpa",
|
|
100
|
+
}[data_request.dataset_id]
|
|
101
|
+
except KeyError:
|
|
102
|
+
raise ValueError("load_dataframe() is not supported for raster datasets.")
|
|
103
|
+
|
|
104
|
+
return self._query(
|
|
105
|
+
f"select * from {secure_view} where data_request_id = '{data_request_id}'"
|
|
106
|
+
)
|
|
107
|
+
|
|
90
108
|
def create_transformation(
|
|
91
109
|
self, data_request_id: str, crs: str, spatial_resolution: float
|
|
92
110
|
) -> Transformation:
|
|
111
|
+
warn(
|
|
112
|
+
"create_transformation() is deprecated, refer to https://github.com/cecilearth/examples",
|
|
113
|
+
DeprecationWarning,
|
|
114
|
+
stacklevel=2,
|
|
115
|
+
)
|
|
93
116
|
res = self._post(
|
|
94
117
|
url="/v0/transformations",
|
|
95
118
|
model=TransformationCreate(
|
|
@@ -101,14 +124,32 @@ class Client:
|
|
|
101
124
|
return Transformation(**res)
|
|
102
125
|
|
|
103
126
|
def get_transformation(self, id: str) -> Transformation:
|
|
127
|
+
warn(
|
|
128
|
+
"get_transformation() is deprecated.",
|
|
129
|
+
DeprecationWarning,
|
|
130
|
+
stacklevel=2,
|
|
131
|
+
)
|
|
104
132
|
res = self._get(url=f"/v0/transformations/{id}")
|
|
105
133
|
return Transformation(**res)
|
|
106
134
|
|
|
107
135
|
def list_transformations(self) -> List[Transformation]:
|
|
136
|
+
warn(
|
|
137
|
+
"list_transformations() is deprecated.",
|
|
138
|
+
DeprecationWarning,
|
|
139
|
+
stacklevel=2,
|
|
140
|
+
)
|
|
108
141
|
res = self._get(url="/v0/transformations")
|
|
109
142
|
return [Transformation(**record) for record in res["records"]]
|
|
110
143
|
|
|
111
144
|
def query(self, sql: str) -> pd.DataFrame:
|
|
145
|
+
warn(
|
|
146
|
+
"query() is deprecated, use load_xarray() or load_dataframe() instead.",
|
|
147
|
+
DeprecationWarning,
|
|
148
|
+
stacklevel=2,
|
|
149
|
+
)
|
|
150
|
+
return self._query(sql)
|
|
151
|
+
|
|
152
|
+
def _query(self, sql: str) -> pd.DataFrame:
|
|
112
153
|
if self._snowflake_user_creds is None:
|
|
113
154
|
res = self._get(url="/v0/snowflake-user-credentials")
|
|
114
155
|
self._snowflake_user_creds = SnowflakeUserCredentials(**res)
|
cecil/version.py
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
__version__ = "0.0.
|
|
1
|
+
__version__ = "0.0.25"
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: cecil
|
|
3
|
-
Version: 0.0.
|
|
3
|
+
Version: 0.0.25
|
|
4
4
|
Summary: Python SDK for Cecil Earth
|
|
5
5
|
License-Expression: MIT
|
|
6
6
|
License-File: LICENSE.txt
|
|
@@ -8,10 +8,13 @@ Classifier: Development Status :: 4 - Beta
|
|
|
8
8
|
Classifier: License :: OSI Approved :: MIT License
|
|
9
9
|
Classifier: Operating System :: OS Independent
|
|
10
10
|
Classifier: Programming Language :: Python :: 3
|
|
11
|
-
Requires-Python: >=3.
|
|
12
|
-
Requires-Dist:
|
|
13
|
-
Requires-Dist:
|
|
14
|
-
Requires-Dist:
|
|
11
|
+
Requires-Python: >=3.11
|
|
12
|
+
Requires-Dist: dask==2025.9.1
|
|
13
|
+
Requires-Dist: pydantic<3.0.0,>=2.11.9
|
|
14
|
+
Requires-Dist: requests<3.0.0,>=2.32.5
|
|
15
|
+
Requires-Dist: rioxarray==0.19.0
|
|
16
|
+
Requires-Dist: snowflake-connector-python[pandas]<4.0.0,>=3.17.4
|
|
17
|
+
Requires-Dist: xarray==2025.9.1
|
|
15
18
|
Description-Content-Type: text/markdown
|
|
16
19
|
|
|
17
20
|
# Cecil SDK
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
cecil/__init__.py,sha256=AEcRl73BDSAQe6W0d1PDD87IEcumARtREl7dCVa_YQY,86
|
|
2
|
+
cecil/client.py,sha256=cDvsK4qBLs5fR8xOPOJ8uH3hi5vVqN9YbRmI0d_kicM,9357
|
|
3
|
+
cecil/errors.py,sha256=ZNiSTYH2MgNZ7tNIgV07-Ge3KtmdncfzWiBi9yjURGs,1818
|
|
4
|
+
cecil/models.py,sha256=3W892XywxLIZL6TDCHM8_PVRHzR48bJXT5kTV7UU_bY,3509
|
|
5
|
+
cecil/version.py,sha256=ognSasPrsQjE8uJUk5Fcsl4caTERui00vZnmFlQnMoU,23
|
|
6
|
+
cecil/xarray.py,sha256=CvqfJ7NBMLLA4jf73ek2ZtV3sj8xOII__5S0_l3KXYI,2161
|
|
7
|
+
cecil-0.0.25.dist-info/METADATA,sha256=7fk1g-s_Dwp5SyZEBHaWwEje_XbuB29RO01UIYn-0_0,2800
|
|
8
|
+
cecil-0.0.25.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
|
|
9
|
+
cecil-0.0.25.dist-info/licenses/LICENSE.txt,sha256=mUexcmfYx3bG1VIzAdQTOf_NzStYw6-QkKVdUY_d4i4,1066
|
|
10
|
+
cecil-0.0.25.dist-info/RECORD,,
|
cecil-0.0.24.dist-info/RECORD
DELETED
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
cecil/__init__.py,sha256=AEcRl73BDSAQe6W0d1PDD87IEcumARtREl7dCVa_YQY,86
|
|
2
|
-
cecil/client.py,sha256=KyxrMSZpo1R46r6LIy8vSv5YxONsr8xiM4B0W4AGC_o,7923
|
|
3
|
-
cecil/errors.py,sha256=ZNiSTYH2MgNZ7tNIgV07-Ge3KtmdncfzWiBi9yjURGs,1818
|
|
4
|
-
cecil/models.py,sha256=3W892XywxLIZL6TDCHM8_PVRHzR48bJXT5kTV7UU_bY,3509
|
|
5
|
-
cecil/version.py,sha256=ZQhXtFuXIGDwpCAUqfQWo3IQMf-8Lz9t5nYhJnOYBdI,23
|
|
6
|
-
cecil/xarray.py,sha256=CvqfJ7NBMLLA4jf73ek2ZtV3sj8xOII__5S0_l3KXYI,2161
|
|
7
|
-
cecil-0.0.24.dist-info/METADATA,sha256=rWLY1mb0eD52cUBkiofgC2ojdVVtjJ9twSo8KoQWqx4,2659
|
|
8
|
-
cecil-0.0.24.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
|
|
9
|
-
cecil-0.0.24.dist-info/licenses/LICENSE.txt,sha256=mUexcmfYx3bG1VIzAdQTOf_NzStYw6-QkKVdUY_d4i4,1066
|
|
10
|
-
cecil-0.0.24.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|