titiler-xarray 2.2.2__tar.gz → 2.4.0__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.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.5
2
2
  Name: titiler-xarray
3
- Version: 2.2.2
3
+ Version: 2.4.0
4
4
  Summary: Xarray plugin for TiTiler.
5
5
  Project-URL: Homepage, https://developmentseed.org/titiler/
6
6
  Project-URL: Documentation, https://developmentseed.org/titiler/
@@ -22,12 +22,11 @@ Classifier: Programming Language :: Python :: 3.13
22
22
  Classifier: Programming Language :: Python :: 3.14
23
23
  Classifier: Topic :: Scientific/Engineering :: GIS
24
24
  Requires-Python: >=3.11
25
- Requires-Dist: httpx2
26
25
  Requires-Dist: obstore
27
26
  Requires-Dist: pydantic-settings~=2.0
28
27
  Requires-Dist: rioxarray
29
28
  Requires-Dist: starlette-cramjam<1.0,>=0.4
30
- Requires-Dist: titiler-core==2.2.2
29
+ Requires-Dist: titiler-core==2.4.0
31
30
  Requires-Dist: xarray
32
31
  Requires-Dist: zarr<4.0,>=3.1
33
32
  Provides-Extra: fs
@@ -29,14 +29,13 @@ classifiers = [
29
29
  ]
30
30
  dynamic = ["version"]
31
31
  dependencies = [
32
- "titiler-core==2.2.2", # x-release-please-version
32
+ "titiler-core==2.4.0", # x-release-please-version
33
33
  "xarray",
34
34
  "rioxarray",
35
35
  "obstore",
36
36
  "zarr>=3.1,<4.0",
37
37
  "starlette-cramjam>=0.4,<1.0",
38
38
  "pydantic-settings~=2.0",
39
- "httpx2",
40
39
  ]
41
40
 
42
41
  [project.optional-dependencies]
@@ -0,0 +1,3 @@
1
+ """titiler.xarray"""
2
+
3
+ __version__ = "2.4.0" # x-release-please-version
@@ -7,7 +7,7 @@ from typing import Annotated
7
7
 
8
8
  import xarray
9
9
  from attrs import define
10
- from fastapi import Depends, Query
10
+ from fastapi import Depends, HTTPException, Query
11
11
  from rio_tiler.constants import WGS84_CRS
12
12
  from starlette.responses import HTMLResponse
13
13
 
@@ -102,6 +102,39 @@ class DatasetMetadataExtension(FactoryExtension):
102
102
  with self.dataset_opener(src_path, **io_params.as_dict()) as ds:
103
103
  return ds.to_dict(data=False)
104
104
 
105
+ @factory.router.get(
106
+ "/dataset/dimensions",
107
+ response_model=dict[str, int],
108
+ responses={200: {"description": "Returns the Dataset dimension sizes."}},
109
+ )
110
+ def dataset_dimensions(
111
+ src_path=Depends(factory.path_dependency),
112
+ io_params=Depends(self.io_dependency),
113
+ ):
114
+ """Returns the Dataset dimension sizes."""
115
+ with self.dataset_opener(src_path, **io_params.as_dict()) as ds:
116
+ return dict(ds.sizes)
117
+
118
+ @factory.router.get(
119
+ "/dataset/coordinates/{name}",
120
+ responses={
121
+ 200: {"description": "Returns a Dataset coordinate and its values."}
122
+ },
123
+ )
124
+ def dataset_coordinate(
125
+ name: str,
126
+ src_path=Depends(factory.path_dependency),
127
+ io_params=Depends(self.io_dependency),
128
+ ):
129
+ """Returns a Dataset coordinate and its values."""
130
+ with self.dataset_opener(src_path, **io_params.as_dict()) as ds:
131
+ try:
132
+ return ds.coords[name].to_dict(data=True)
133
+ except KeyError as e:
134
+ raise HTTPException(
135
+ status_code=404, detail=f"Coordinate '{name}' not found"
136
+ ) from e
137
+
105
138
  @factory.router.get(
106
139
  "/dataset/keys",
107
140
  response_model=list[str],
@@ -1,3 +0,0 @@
1
- """titiler.xarray"""
2
-
3
- __version__ = "2.2.2" # x-release-please-version
File without changes
File without changes