eodash_catalog 0.0.14__py3-none-any.whl → 0.0.16__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 eodash_catalog might be problematic. Click here for more details.

@@ -1,4 +1,4 @@
1
1
  # SPDX-FileCopyrightText: 2024-present Daniel Santillan <daniel.santillan@eox.at>
2
2
  #
3
3
  # SPDX-License-Identifier: MIT
4
- __version__ = "0.0.14"
4
+ __version__ = "0.0.16"
@@ -106,29 +106,17 @@ def handle_STAC_based_endpoint(
106
106
  catalog, collection_config["Name"], collection_config, catalog_config, endpoint_config
107
107
  )
108
108
  for location in collection_config["Locations"]:
109
- if "FilterDates" in location:
110
- collection = process_STACAPI_Endpoint(
111
- catalog_config=catalog_config,
112
- endpoint_config=endpoint_config,
113
- collection_config=collection_config,
114
- catalog=catalog,
115
- options=options,
116
- headers=headers,
117
- bbox=",".join(map(str, location["Bbox"])),
118
- filter_dates=location["FilterDates"],
119
- root_collection=root_collection,
120
- )
121
- else:
122
- collection = process_STACAPI_Endpoint(
123
- catalog_config=catalog_config,
124
- endpoint_config=endpoint_config,
125
- collection_config=collection_config,
126
- catalog=catalog,
127
- options=options,
128
- headers=headers,
129
- bbox=",".join(map(str, location["Bbox"])),
130
- root_collection=root_collection,
131
- )
109
+ collection = process_STACAPI_Endpoint(
110
+ catalog_config=catalog_config,
111
+ endpoint_config=endpoint_config,
112
+ collection_config=collection_config,
113
+ catalog=catalog,
114
+ options=options,
115
+ headers=headers,
116
+ filter_dates=location.get("FilterDates"),
117
+ bbox=",".join(map(str, location["Bbox"])),
118
+ root_collection=root_collection,
119
+ )
132
120
  # Update identifier to use location as well as title
133
121
  # TODO: should we use the name as id? it provides much more
134
122
  # information in the clients
@@ -159,25 +147,18 @@ def handle_STAC_based_endpoint(
159
147
  if isinstance(c_child, Collection):
160
148
  root_collection.extent.spatial.bboxes.append(c_child.extent.spatial.bboxes[0])
161
149
  else:
150
+ bbox = None
162
151
  if "Bbox" in endpoint_config:
163
- root_collection = process_STACAPI_Endpoint(
164
- catalog_config=catalog_config,
165
- endpoint_config=endpoint_config,
166
- collection_config=collection_config,
167
- catalog=catalog,
168
- options=options,
169
- headers=headers,
170
- bbox=",".join(map(str, endpoint_config["Bbox"])),
171
- )
172
- else:
173
- root_collection = process_STACAPI_Endpoint(
174
- catalog_config=catalog_config,
175
- endpoint_config=endpoint_config,
176
- collection_config=collection_config,
177
- catalog=catalog,
178
- options=options,
179
- headers=headers,
180
- )
152
+ bbox = ",".join(map(str, endpoint_config["Bbox"]))
153
+ root_collection = process_STACAPI_Endpoint(
154
+ catalog_config=catalog_config,
155
+ endpoint_config=endpoint_config,
156
+ collection_config=collection_config,
157
+ catalog=catalog,
158
+ options=options,
159
+ headers=headers,
160
+ bbox=bbox,
161
+ )
181
162
 
182
163
  add_example_info(root_collection, collection_config, endpoint_config, catalog_config)
183
164
  return root_collection
@@ -199,6 +180,12 @@ def process_STACAPI_Endpoint(
199
180
  collection = get_or_create_collection(
200
181
  catalog, endpoint_config["CollectionId"], collection_config, catalog_config, endpoint_config
201
182
  )
183
+ datetime_query = ["1900-01-01T00:00:00Z", "3000-01-01T00:00:00Z"]
184
+ if query := endpoint_config.get("Query"):
185
+ if start := query.get("Start"):
186
+ datetime_query[0] = start
187
+ if end := query.get("End"):
188
+ datetime_query[1] = end
202
189
 
203
190
  api = Client.open(endpoint_config["EndPoint"], headers=headers)
204
191
  if bbox is None:
@@ -206,7 +193,7 @@ def process_STACAPI_Endpoint(
206
193
  results = api.search(
207
194
  collections=[endpoint_config["CollectionId"]],
208
195
  bbox=bbox,
209
- datetime=["1900-01-01T00:00:00Z", "3000-01-01T00:00:00Z"],
196
+ datetime=datetime_query, # type: ignore
210
197
  )
211
198
  # We keep track of potential duplicate times in this list
212
199
  added_times = {}
@@ -564,7 +551,7 @@ def generate_veda_tiles_link(endpoint_config: dict, item: str | None) -> str:
564
551
  if "NoData" in endpoint_config:
565
552
  no_data = "&no_data={}".format(endpoint_config["NoData"])
566
553
  item = f"&item={item}" if item else ""
567
- target_url = f"https://openveda.cloud/stac/tiles/WebMercatorQuad/{{z}}/{{x}}/{{y}}?{collection}{item}{assets}{color_formula}{no_data}"
554
+ target_url = f"https://openveda.cloud/api/raster/stac/tiles/WebMercatorQuad/{{z}}/{{x}}/{{y}}?{collection}{item}{assets}{color_formula}{no_data}"
568
555
  return target_url
569
556
 
570
557
 
@@ -813,18 +800,18 @@ def handle_raw_source(
813
800
  endpoint_config,
814
801
  item,
815
802
  )
816
- ep_st = endpoint_config["Style"]
817
- style_link = Link(
818
- rel="style",
819
- target=ep_st
820
- if ep_st.startswith("http")
821
- else f"{catalog_config['assets_endpoint']}/{ep_st}",
822
- media_type=style_type,
823
- extra_fields={
824
- "asset:keys": list(assets),
825
- },
826
- )
827
- item.add_link(style_link)
803
+ if ep_st := endpoint_config.get("Style"):
804
+ style_link = Link(
805
+ rel="style",
806
+ target=ep_st
807
+ if ep_st.startswith("http")
808
+ else f"{catalog_config['assets_endpoint']}/{ep_st}",
809
+ media_type=style_type,
810
+ extra_fields={
811
+ "asset:keys": list(assets),
812
+ },
813
+ )
814
+ item.add_link(style_link)
828
815
  link = collection.add_item(item)
829
816
  link.extra_fields["datetime"] = time_entry["Time"]
830
817
  link.extra_fields["assets"] = [a["File"] for a in time_entry["Assets"]]
eodash_catalog/utils.py CHANGED
@@ -221,7 +221,7 @@ def generate_veda_cog_link(endpoint_config: dict, file_url: str | None) -> str:
221
221
 
222
222
  file_url = f"url={file_url}&" if file_url else ""
223
223
 
224
- target_url = f"https://openveda.cloud/cog/tiles/WebMercatorQuad/{{z}}/{{x}}/{{y}}?{file_url}resampling_method=nearest{bidx}{colormap}{colormap_name}{rescale}"
224
+ target_url = f"https://openveda.cloud/api/raster/cog/tiles/WebMercatorQuad/{{z}}/{{x}}/{{y}}?{file_url}resampling_method=nearest{bidx}{colormap}{colormap_name}{rescale}"
225
225
  return target_url
226
226
 
227
227
 
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.3
2
2
  Name: eodash_catalog
3
- Version: 0.0.14
3
+ Version: 0.0.16
4
4
  Summary: This package is intended to help create a compatible STAC catalog for the eodash dashboard client. It supports configuration of multiple endpoint types for information extraction.
5
5
  Project-URL: Documentation, https://github.com/eodash/eodash_catalog#readme
6
6
  Project-URL: Issues, https://github.com/eodash/eodash_catalog/issues
@@ -31,7 +31,7 @@ Requires-Dist: pyyaml<7
31
31
  Requires-Dist: redis<4
32
32
  Requires-Dist: requests-oauthlib<1.3.2
33
33
  Requires-Dist: requests<3
34
- Requires-Dist: setuptools<68
34
+ Requires-Dist: setuptools<71
35
35
  Requires-Dist: spdx-lookup<=0.3.3
36
36
  Requires-Dist: structlog<22.0
37
37
  Requires-Dist: swiftspec==0.0.2
@@ -1,14 +1,14 @@
1
- eodash_catalog/__about__.py,sha256=w0H7WN2arq5UEWqr5ssYyzDn4_yv6Mow9z2xHCP--Ng,138
1
+ eodash_catalog/__about__.py,sha256=DufokORcq7HQve6GPFansFU8LMELcmOjGhPms7LOjFM,138
2
2
  eodash_catalog/__init__.py,sha256=_W_9emPYf6FUqc0P8L2SmADx6hGSd7PlQV3yRmCk5uM,115
3
3
  eodash_catalog/duration.py,sha256=B6XOZfvNU7SuqpxuVtT1kNKODoOQJXDI6mocvA_U1ik,10816
4
- eodash_catalog/endpoints.py,sha256=8D1mLSDwivK6_Ub3hHAtiVMtmtHatd1Ffxhw8rm_BqU,33307
4
+ eodash_catalog/endpoints.py,sha256=0cCwNbQ1YqH8zKxdPY2LvXZWXqmqrAuW6ae_mUK4nTE,32734
5
5
  eodash_catalog/generate_indicators.py,sha256=DlbgMuNVPGdg8roYO7raXIeTmsMRpsyN71DYnRATATI,18790
6
6
  eodash_catalog/sh_endpoint.py,sha256=vELooJwk269v1DNnOzb32vil96vL_SRCio8UBlx10N0,618
7
7
  eodash_catalog/stac_handling.py,sha256=BKFFhM2JhrBnEd6EbEESAIUcFncDaAb5N4aHx0uZBv4,18197
8
8
  eodash_catalog/thumbnails.py,sha256=31Wk38oNQDxfhSUbMLBpHuZFhsR8v_7luYr65XQtDf0,2213
9
- eodash_catalog/utils.py,sha256=FZIn3iwMNjdaGAlbaIHPffYkAhlIHpNU2vkMJmEcYRQ,8427
10
- eodash_catalog-0.0.14.dist-info/METADATA,sha256=9uitoo4TTQi-DzVXTZpD3k81DCXQWKcVm9wbn6iI-eQ,3203
11
- eodash_catalog-0.0.14.dist-info/WHEEL,sha256=1yFddiXMmvYK7QYTqtRNtX66WJ0Mz8PYEiEUoOUUxRY,87
12
- eodash_catalog-0.0.14.dist-info/entry_points.txt,sha256=kuUQrDG1PtYd8kPjf5XM6H_NtQd9Ozwl0jjiGtAvZSM,87
13
- eodash_catalog-0.0.14.dist-info/licenses/LICENSE.txt,sha256=oJCW5zQxnFD-J0hGz6Zh5Lkpdk1oAndmWhseTmV224E,1107
14
- eodash_catalog-0.0.14.dist-info/RECORD,,
9
+ eodash_catalog/utils.py,sha256=4qcCADoIs6woJoqd553j_qT5mLb7_wl6NAUN_BoJ3jE,8438
10
+ eodash_catalog-0.0.16.dist-info/METADATA,sha256=PqIbwvI4nxwpPpXICYWWYhwti33D9NKu77nu0gjXXQU,3203
11
+ eodash_catalog-0.0.16.dist-info/WHEEL,sha256=1yFddiXMmvYK7QYTqtRNtX66WJ0Mz8PYEiEUoOUUxRY,87
12
+ eodash_catalog-0.0.16.dist-info/entry_points.txt,sha256=kuUQrDG1PtYd8kPjf5XM6H_NtQd9Ozwl0jjiGtAvZSM,87
13
+ eodash_catalog-0.0.16.dist-info/licenses/LICENSE.txt,sha256=oJCW5zQxnFD-J0hGz6Zh5Lkpdk1oAndmWhseTmV224E,1107
14
+ eodash_catalog-0.0.16.dist-info/RECORD,,