rs-client-libraries 0.2a3.post31.dev0__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.
- rs_client/__init__.py +18 -0
- rs_client/auxip_client.py +61 -0
- rs_client/cadip_client.py +142 -0
- rs_client/rs_client.py +433 -0
- rs_client/stac_client.py +390 -0
- rs_client_libraries-0.2a3.post31.dev0.dist-info/LICENSE +201 -0
- rs_client_libraries-0.2a3.post31.dev0.dist-info/METADATA +41 -0
- rs_client_libraries-0.2a3.post31.dev0.dist-info/RECORD +20 -0
- rs_client_libraries-0.2a3.post31.dev0.dist-info/WHEEL +4 -0
- rs_common/__init__.py +20 -0
- rs_common/config.py +62 -0
- rs_common/logging.py +108 -0
- rs_common/opentelemetry.py +114 -0
- rs_common/serialization.py +86 -0
- rs_common/utils.py +46 -0
- rs_workflows/__init__.py +18 -0
- rs_workflows/config/dpr_config_template.yaml +43 -0
- rs_workflows/example.py +43 -0
- rs_workflows/s1_l0.py +497 -0
- rs_workflows/staging.py +512 -0
rs_client/stac_client.py
ADDED
|
@@ -0,0 +1,390 @@
|
|
|
1
|
+
# Copyright 2024 CS Group
|
|
2
|
+
#
|
|
3
|
+
# Licensed under the Apache License, Version 2.0 (the "License");
|
|
4
|
+
# you may not use this file except in compliance with the License.
|
|
5
|
+
# You may obtain a copy of the License at
|
|
6
|
+
#
|
|
7
|
+
# http://www.apache.org/licenses/LICENSE-2.0
|
|
8
|
+
#
|
|
9
|
+
# Unless required by applicable law or agreed to in writing, software
|
|
10
|
+
# distributed under the License is distributed on an "AS IS" BASIS,
|
|
11
|
+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
12
|
+
# See the License for the specific language governing permissions and
|
|
13
|
+
# limitations under the License.
|
|
14
|
+
|
|
15
|
+
"""Implement the class StacCLient that inherits from pystact_client Client."""
|
|
16
|
+
|
|
17
|
+
from __future__ import annotations
|
|
18
|
+
|
|
19
|
+
import logging
|
|
20
|
+
import os
|
|
21
|
+
from functools import lru_cache
|
|
22
|
+
from typing import Any, Callable, Dict, List, Optional, Union
|
|
23
|
+
|
|
24
|
+
import pystac
|
|
25
|
+
from pystac import CatalogType, Collection, Item, Link, RelType
|
|
26
|
+
from pystac.layout import HrefLayoutStrategy
|
|
27
|
+
from pystac_client import Client, Modifiable
|
|
28
|
+
from pystac_client.collection_client import CollectionClient
|
|
29
|
+
from pystac_client.item_search import (
|
|
30
|
+
BBoxLike,
|
|
31
|
+
DatetimeLike,
|
|
32
|
+
FieldsLike,
|
|
33
|
+
FilterLike,
|
|
34
|
+
IDsLike,
|
|
35
|
+
IntersectsLike,
|
|
36
|
+
ItemSearch,
|
|
37
|
+
QueryLike,
|
|
38
|
+
SortbyLike,
|
|
39
|
+
)
|
|
40
|
+
from pystac_client.stac_api_io import StacApiIO, Timeout
|
|
41
|
+
from requests import Request, Response
|
|
42
|
+
|
|
43
|
+
from rs_client.rs_client import APIKEY_HEADER, TIMEOUT, RsClient
|
|
44
|
+
|
|
45
|
+
|
|
46
|
+
class StacClient(RsClient, Client): # type: ignore # pylint: disable=too-many-ancestors
|
|
47
|
+
"""StacClient inherits from both rs_client.RsClient and pystac_client.Client. The goal of this class is to
|
|
48
|
+
allow an user to use RS-Server services more easily than calling REST endpoints directly.
|
|
49
|
+
"""
|
|
50
|
+
|
|
51
|
+
##################
|
|
52
|
+
# Initialisation #
|
|
53
|
+
##################
|
|
54
|
+
|
|
55
|
+
def __init__( # pylint: disable=too-many-arguments,super-init-not-called # super-init is called in .open(...)
|
|
56
|
+
self,
|
|
57
|
+
id: str, # pylint: disable=redefined-builtin
|
|
58
|
+
description: str,
|
|
59
|
+
title: Optional[str] = None,
|
|
60
|
+
stac_extensions: Optional[List[str]] = None,
|
|
61
|
+
extra_fields: Optional[Dict[str, Any]] = None,
|
|
62
|
+
href: Optional[str] = None,
|
|
63
|
+
catalog_type: CatalogType = CatalogType.ABSOLUTE_PUBLISHED,
|
|
64
|
+
strategy: Optional[HrefLayoutStrategy] = None,
|
|
65
|
+
*,
|
|
66
|
+
modifier: Optional[Callable[[Modifiable], None]] = None,
|
|
67
|
+
**kwargs: Dict[str, Any],
|
|
68
|
+
):
|
|
69
|
+
"""
|
|
70
|
+
Constructor. Called only by pystac.
|
|
71
|
+
As an user: don't use this directly, call the open(...) class method instead or RsClient.get_stac_client(...).
|
|
72
|
+
"""
|
|
73
|
+
|
|
74
|
+
# Call manually the parent pystac Client constructor.
|
|
75
|
+
# The RsClient constructor will be called manually later.
|
|
76
|
+
Client.__init__(
|
|
77
|
+
self,
|
|
78
|
+
id=id,
|
|
79
|
+
description=description,
|
|
80
|
+
title=title,
|
|
81
|
+
stac_extensions=stac_extensions,
|
|
82
|
+
extra_fields=extra_fields,
|
|
83
|
+
href=href,
|
|
84
|
+
catalog_type=catalog_type,
|
|
85
|
+
strategy=strategy,
|
|
86
|
+
modifier=modifier,
|
|
87
|
+
**kwargs,
|
|
88
|
+
)
|
|
89
|
+
|
|
90
|
+
@classmethod
|
|
91
|
+
def open( # type: ignore # pylint: disable=arguments-renamed, too-many-arguments
|
|
92
|
+
cls,
|
|
93
|
+
# RsClient parameters
|
|
94
|
+
rs_server_href: str | None,
|
|
95
|
+
rs_server_api_key: str | None,
|
|
96
|
+
rs_server_oauth2_cookie: str | None,
|
|
97
|
+
owner_id: str | None,
|
|
98
|
+
logger: logging.Logger | None = None,
|
|
99
|
+
# pystac Client parameters
|
|
100
|
+
headers: Optional[Dict[str, str]] = None,
|
|
101
|
+
parameters: Optional[Dict[str, Any]] = None,
|
|
102
|
+
ignore_conformance: Optional[bool] = None,
|
|
103
|
+
modifier: Optional[Callable[[Modifiable], None]] = None,
|
|
104
|
+
request_modifier: Optional[Callable[[Request], Union[Request, None]]] = None,
|
|
105
|
+
stac_io: Optional[StacApiIO] = None,
|
|
106
|
+
timeout: Optional[Timeout] = TIMEOUT,
|
|
107
|
+
) -> StacClient:
|
|
108
|
+
"""Create a new StacClient instance."""
|
|
109
|
+
|
|
110
|
+
# Save the API key in the HTTP headers
|
|
111
|
+
if rs_server_api_key:
|
|
112
|
+
if headers is None:
|
|
113
|
+
headers = {}
|
|
114
|
+
headers[APIKEY_HEADER] = rs_server_api_key
|
|
115
|
+
|
|
116
|
+
# Save the OAuth2 authentication cookie in the pystac client cookies
|
|
117
|
+
if rs_server_oauth2_cookie:
|
|
118
|
+
if stac_io is None:
|
|
119
|
+
stac_io = StacApiIO( # This is what is done in pystac_client/client.py::from_file
|
|
120
|
+
headers=headers,
|
|
121
|
+
parameters=parameters,
|
|
122
|
+
request_modifier=request_modifier,
|
|
123
|
+
timeout=timeout,
|
|
124
|
+
)
|
|
125
|
+
stac_io.session.cookies.set("session", rs_server_oauth2_cookie)
|
|
126
|
+
|
|
127
|
+
client: StacClient = super().open( # type: ignore
|
|
128
|
+
cls.__href_catalog(rs_server_href) + "/catalog/",
|
|
129
|
+
headers,
|
|
130
|
+
parameters,
|
|
131
|
+
ignore_conformance,
|
|
132
|
+
modifier,
|
|
133
|
+
request_modifier,
|
|
134
|
+
stac_io,
|
|
135
|
+
timeout,
|
|
136
|
+
)
|
|
137
|
+
|
|
138
|
+
# Manual call to the parent RsClient constructor
|
|
139
|
+
RsClient.__init__(
|
|
140
|
+
client,
|
|
141
|
+
rs_server_href=rs_server_href,
|
|
142
|
+
rs_server_api_key=rs_server_api_key,
|
|
143
|
+
owner_id=owner_id,
|
|
144
|
+
logger=logger,
|
|
145
|
+
)
|
|
146
|
+
|
|
147
|
+
return client
|
|
148
|
+
|
|
149
|
+
##############
|
|
150
|
+
# Properties #
|
|
151
|
+
##############
|
|
152
|
+
|
|
153
|
+
@property
|
|
154
|
+
def href_catalog(self) -> str:
|
|
155
|
+
"""
|
|
156
|
+
Return the RS-Server catalog URL hostname.
|
|
157
|
+
This URL can be overwritten using the RSPY_HOST_CATALOG env variable (used e.g. for local mode).
|
|
158
|
+
Otherwise it should just be the RS-Server URL.
|
|
159
|
+
"""
|
|
160
|
+
return self.__href_catalog(self.rs_server_href)
|
|
161
|
+
|
|
162
|
+
@staticmethod
|
|
163
|
+
def __href_catalog(rs_server_href) -> str:
|
|
164
|
+
if from_env := os.getenv("RSPY_HOST_CATALOG", None):
|
|
165
|
+
return from_env.rstrip("/")
|
|
166
|
+
if not rs_server_href:
|
|
167
|
+
raise RuntimeError("RS-Server URL is undefined")
|
|
168
|
+
return rs_server_href.rstrip("/")
|
|
169
|
+
|
|
170
|
+
def full_collection_id(self, owner_id: str | None, collection_id: str):
|
|
171
|
+
"""
|
|
172
|
+
Return the full collection name as: <owner_id>:<collection_id>
|
|
173
|
+
|
|
174
|
+
Args:
|
|
175
|
+
owner_id (str): Collection owner ID. If missing, we use self.owner_id.
|
|
176
|
+
collection_id (str): Collection name
|
|
177
|
+
"""
|
|
178
|
+
return f"{owner_id or self.owner_id}:{collection_id}"
|
|
179
|
+
|
|
180
|
+
################################
|
|
181
|
+
# Specific STAC implementation #
|
|
182
|
+
################################
|
|
183
|
+
|
|
184
|
+
@lru_cache()
|
|
185
|
+
def get_collection(self, collection_id: str, owner_id: str | None = None) -> Union[Collection, CollectionClient]:
|
|
186
|
+
"""Get the requested collection as <owner_id>:<collection_id>"""
|
|
187
|
+
full_collection_id = self.full_collection_id(owner_id, collection_id)
|
|
188
|
+
return Client.get_collection(self, full_collection_id)
|
|
189
|
+
|
|
190
|
+
def add_collection(
|
|
191
|
+
self,
|
|
192
|
+
collection: Collection,
|
|
193
|
+
add_public_license: bool = True,
|
|
194
|
+
owner_id: str | None = None,
|
|
195
|
+
timeout: int = TIMEOUT,
|
|
196
|
+
) -> Response:
|
|
197
|
+
"""Update the collection links, then post the collection into the catalog.
|
|
198
|
+
|
|
199
|
+
Args:
|
|
200
|
+
collection (Collection): STAC collection
|
|
201
|
+
add_public_license (bool): If True, add a public domain license field and link.
|
|
202
|
+
owner_id (str, optional): Collection owner ID. If missing, we use self.owner_id.
|
|
203
|
+
timeout (int): The timeout duration for the HTTP request.
|
|
204
|
+
|
|
205
|
+
Returns:
|
|
206
|
+
JSONResponse (json): The response of the request.
|
|
207
|
+
"""
|
|
208
|
+
|
|
209
|
+
full_owner_id = owner_id or self.owner_id
|
|
210
|
+
|
|
211
|
+
# Use owner_id:collection_id instead of just the collection ID, before adding the links,
|
|
212
|
+
# so the links contain the full owner_id:collection_id
|
|
213
|
+
short_collection_id = collection.id
|
|
214
|
+
full_collection_id = self.full_collection_id(owner_id, short_collection_id)
|
|
215
|
+
collection.id = full_collection_id
|
|
216
|
+
|
|
217
|
+
# Default description
|
|
218
|
+
if not collection.description:
|
|
219
|
+
collection.description = f"This is the collection {short_collection_id} from user {full_owner_id}."
|
|
220
|
+
|
|
221
|
+
# Add the owner_id as an extra field
|
|
222
|
+
collection.extra_fields["owner"] = full_owner_id
|
|
223
|
+
|
|
224
|
+
# Add public domain license
|
|
225
|
+
if add_public_license:
|
|
226
|
+
collection.license = "public-domain"
|
|
227
|
+
collection.add_link(
|
|
228
|
+
Link(
|
|
229
|
+
rel=RelType.LICENSE,
|
|
230
|
+
target="https://creativecommons.org/licenses/publicdomain/",
|
|
231
|
+
title="public-domain",
|
|
232
|
+
),
|
|
233
|
+
)
|
|
234
|
+
|
|
235
|
+
# Update the links
|
|
236
|
+
self.add_child(collection)
|
|
237
|
+
|
|
238
|
+
# Restore the short collection_id at the root of the collection
|
|
239
|
+
collection.id = short_collection_id
|
|
240
|
+
|
|
241
|
+
# Check that the collection is compliant to STAC
|
|
242
|
+
collection.validate_all()
|
|
243
|
+
|
|
244
|
+
# Post the collection to the catalog
|
|
245
|
+
return self.http_session.post(
|
|
246
|
+
f"{self.href_catalog}/catalog/collections",
|
|
247
|
+
json=collection.to_dict(),
|
|
248
|
+
**self.apikey_headers,
|
|
249
|
+
timeout=timeout,
|
|
250
|
+
)
|
|
251
|
+
|
|
252
|
+
def remove_collection(
|
|
253
|
+
self,
|
|
254
|
+
collection_id: str,
|
|
255
|
+
owner_id: str | None = None,
|
|
256
|
+
timeout: int = TIMEOUT,
|
|
257
|
+
) -> Response:
|
|
258
|
+
"""Remove/delete a collection from the catalog.
|
|
259
|
+
|
|
260
|
+
Args:
|
|
261
|
+
collection_id (str): The collection id.
|
|
262
|
+
owner_id (str, optional): Collection owner ID. If missing, we use self.owner_id.
|
|
263
|
+
timeout (int): The timeout duration for the HTTP request.
|
|
264
|
+
|
|
265
|
+
Returns:
|
|
266
|
+
JSONResponse: The response of the request.
|
|
267
|
+
"""
|
|
268
|
+
# owner_id:collection_id
|
|
269
|
+
full_collection_id = self.full_collection_id(owner_id, collection_id)
|
|
270
|
+
|
|
271
|
+
# Remove the collection from the "child" links of the local catalog instance
|
|
272
|
+
collection_link = f"{self.self_href.rstrip('/')}/collections/{full_collection_id}"
|
|
273
|
+
self.links = [
|
|
274
|
+
link for link in self.links if not ((link.rel == pystac.RelType.CHILD) and (link.href == collection_link))
|
|
275
|
+
]
|
|
276
|
+
|
|
277
|
+
# We need to clear the cache for this and parent "get_collection" methods
|
|
278
|
+
# because their returned value must be updated.
|
|
279
|
+
self.get_collection.cache_clear()
|
|
280
|
+
Client.get_collection.cache_clear()
|
|
281
|
+
|
|
282
|
+
# Remove the collection from the server catalog
|
|
283
|
+
return self.http_session.delete(
|
|
284
|
+
f"{self.href_catalog}/catalog/collections/{full_collection_id}",
|
|
285
|
+
**self.apikey_headers,
|
|
286
|
+
timeout=timeout,
|
|
287
|
+
)
|
|
288
|
+
|
|
289
|
+
def add_item( # type: ignore # pylint: disable=arguments-renamed
|
|
290
|
+
self,
|
|
291
|
+
collection_id: str,
|
|
292
|
+
item: Item,
|
|
293
|
+
owner_id: str | None = None,
|
|
294
|
+
timeout: int = TIMEOUT,
|
|
295
|
+
) -> Response:
|
|
296
|
+
"""Update the item links, then post the item into the catalog.
|
|
297
|
+
|
|
298
|
+
Args:
|
|
299
|
+
collection_id (str): The collection id.
|
|
300
|
+
item (Item): STAC item to update and post
|
|
301
|
+
owner_id (str, optional): Collection owner ID. If missing, we use self.owner_id.
|
|
302
|
+
timeout (int): The timeout duration for the HTTP request.
|
|
303
|
+
|
|
304
|
+
Returns:
|
|
305
|
+
JSONResponse: The response of the request.
|
|
306
|
+
"""
|
|
307
|
+
# owner_id:collection_id
|
|
308
|
+
full_collection_id = self.full_collection_id(owner_id, collection_id)
|
|
309
|
+
|
|
310
|
+
# Check that the item is compliant to STAC
|
|
311
|
+
item.validate()
|
|
312
|
+
|
|
313
|
+
# Get the collection from the catalog
|
|
314
|
+
collection = self.get_collection(collection_id, owner_id)
|
|
315
|
+
|
|
316
|
+
# Update the item contents
|
|
317
|
+
collection.add_item(item)
|
|
318
|
+
|
|
319
|
+
# Post the item to the catalog
|
|
320
|
+
return self.http_session.post(
|
|
321
|
+
f"{self.href_catalog}/catalog/collections/{full_collection_id}/items",
|
|
322
|
+
json=item.to_dict(),
|
|
323
|
+
**self.apikey_headers,
|
|
324
|
+
timeout=timeout,
|
|
325
|
+
)
|
|
326
|
+
|
|
327
|
+
def remove_item( # type: ignore # pylint: disable=arguments-differ
|
|
328
|
+
self,
|
|
329
|
+
collection_id: str,
|
|
330
|
+
item_id: str,
|
|
331
|
+
owner_id: str | None = None,
|
|
332
|
+
timeout: int = TIMEOUT,
|
|
333
|
+
) -> Response:
|
|
334
|
+
"""Remove/delete an item from a collection.
|
|
335
|
+
|
|
336
|
+
Args:
|
|
337
|
+
collection_id (str): The collection id.
|
|
338
|
+
item_id (str): The item id.
|
|
339
|
+
owner_id (str, optional): Collection owner ID. If missing, we use self.owner_id.
|
|
340
|
+
timeout (int): The timeout duration for the HTTP request.
|
|
341
|
+
|
|
342
|
+
Returns:
|
|
343
|
+
JSONResponse: The response of the request.
|
|
344
|
+
"""
|
|
345
|
+
# owner_id:collection_id
|
|
346
|
+
full_collection_id = self.full_collection_id(owner_id, collection_id)
|
|
347
|
+
|
|
348
|
+
# Remove the collection from the server catalog
|
|
349
|
+
return self.http_session.delete(
|
|
350
|
+
f"{self.href_catalog}/catalog/collections/{full_collection_id}/items/{item_id}",
|
|
351
|
+
**self.apikey_headers,
|
|
352
|
+
timeout=timeout,
|
|
353
|
+
)
|
|
354
|
+
|
|
355
|
+
def search_inside_collection( # pylint: disable=too-many-arguments
|
|
356
|
+
self,
|
|
357
|
+
*,
|
|
358
|
+
collection_id: str,
|
|
359
|
+
owner_id: str | None = None,
|
|
360
|
+
method: Optional[str] = "POST",
|
|
361
|
+
max_items: Optional[int] = None,
|
|
362
|
+
limit: Optional[int] = None,
|
|
363
|
+
ids: Optional[IDsLike] = None,
|
|
364
|
+
bbox: Optional[BBoxLike] = None,
|
|
365
|
+
intersects: Optional[IntersectsLike] = None,
|
|
366
|
+
datetime: Optional[DatetimeLike] = None,
|
|
367
|
+
query: Optional[QueryLike] = None,
|
|
368
|
+
stac_filter: Optional[FilterLike] = None,
|
|
369
|
+
filter_lang: Optional[str] = None,
|
|
370
|
+
sortby: Optional[SortbyLike] = None,
|
|
371
|
+
fields: Optional[FieldsLike] = None,
|
|
372
|
+
) -> ItemSearch:
|
|
373
|
+
"""Search items inside a specific collection."""
|
|
374
|
+
|
|
375
|
+
return Client.search(
|
|
376
|
+
self,
|
|
377
|
+
method=method,
|
|
378
|
+
max_items=max_items,
|
|
379
|
+
limit=limit,
|
|
380
|
+
ids=ids,
|
|
381
|
+
collections=[f"{owner_id}_{collection_id}"],
|
|
382
|
+
bbox=bbox,
|
|
383
|
+
intersects=intersects,
|
|
384
|
+
datetime=datetime,
|
|
385
|
+
query=query,
|
|
386
|
+
filter=stac_filter,
|
|
387
|
+
filter_lang=filter_lang,
|
|
388
|
+
sortby=sortby,
|
|
389
|
+
fields=fields,
|
|
390
|
+
)
|
|
@@ -0,0 +1,201 @@
|
|
|
1
|
+
Apache License
|
|
2
|
+
Version 2.0, January 2004
|
|
3
|
+
http://www.apache.org/licenses/
|
|
4
|
+
|
|
5
|
+
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
|
|
6
|
+
|
|
7
|
+
1. Definitions.
|
|
8
|
+
|
|
9
|
+
"License" shall mean the terms and conditions for use, reproduction,
|
|
10
|
+
and distribution as defined by Sections 1 through 9 of this document.
|
|
11
|
+
|
|
12
|
+
"Licensor" shall mean the copyright owner or entity authorized by
|
|
13
|
+
the copyright owner that is granting the License.
|
|
14
|
+
|
|
15
|
+
"Legal Entity" shall mean the union of the acting entity and all
|
|
16
|
+
other entities that control, are controlled by, or are under common
|
|
17
|
+
control with that entity. For the purposes of this definition,
|
|
18
|
+
"control" means (i) the power, direct or indirect, to cause the
|
|
19
|
+
direction or management of such entity, whether by contract or
|
|
20
|
+
otherwise, or (ii) ownership of fifty percent (50%) or more of the
|
|
21
|
+
outstanding shares, or (iii) beneficial ownership of such entity.
|
|
22
|
+
|
|
23
|
+
"You" (or "Your") shall mean an individual or Legal Entity
|
|
24
|
+
exercising permissions granted by this License.
|
|
25
|
+
|
|
26
|
+
"Source" form shall mean the preferred form for making modifications,
|
|
27
|
+
including but not limited to software source code, documentation
|
|
28
|
+
source, and configuration files.
|
|
29
|
+
|
|
30
|
+
"Object" form shall mean any form resulting from mechanical
|
|
31
|
+
transformation or translation of a Source form, including but
|
|
32
|
+
not limited to compiled object code, generated documentation,
|
|
33
|
+
and conversions to other media types.
|
|
34
|
+
|
|
35
|
+
"Work" shall mean the work of authorship, whether in Source or
|
|
36
|
+
Object form, made available under the License, as indicated by a
|
|
37
|
+
copyright notice that is included in or attached to the work
|
|
38
|
+
(an example is provided in the Appendix below).
|
|
39
|
+
|
|
40
|
+
"Derivative Works" shall mean any work, whether in Source or Object
|
|
41
|
+
form, that is based on (or derived from) the Work and for which the
|
|
42
|
+
editorial revisions, annotations, elaborations, or other modifications
|
|
43
|
+
represent, as a whole, an original work of authorship. For the purposes
|
|
44
|
+
of this License, Derivative Works shall not include works that remain
|
|
45
|
+
separable from, or merely link (or bind by name) to the interfaces of,
|
|
46
|
+
the Work and Derivative Works thereof.
|
|
47
|
+
|
|
48
|
+
"Contribution" shall mean any work of authorship, including
|
|
49
|
+
the original version of the Work and any modifications or additions
|
|
50
|
+
to that Work or Derivative Works thereof, that is intentionally
|
|
51
|
+
submitted to Licensor for inclusion in the Work by the copyright owner
|
|
52
|
+
or by an individual or Legal Entity authorized to submit on behalf of
|
|
53
|
+
the copyright owner. For the purposes of this definition, "submitted"
|
|
54
|
+
means any form of electronic, verbal, or written communication sent
|
|
55
|
+
to the Licensor or its representatives, including but not limited to
|
|
56
|
+
communication on electronic mailing lists, source code control systems,
|
|
57
|
+
and issue tracking systems that are managed by, or on behalf of, the
|
|
58
|
+
Licensor for the purpose of discussing and improving the Work, but
|
|
59
|
+
excluding communication that is conspicuously marked or otherwise
|
|
60
|
+
designated in writing by the copyright owner as "Not a Contribution."
|
|
61
|
+
|
|
62
|
+
"Contributor" shall mean Licensor and any individual or Legal Entity
|
|
63
|
+
on behalf of whom a Contribution has been received by Licensor and
|
|
64
|
+
subsequently incorporated within the Work.
|
|
65
|
+
|
|
66
|
+
2. Grant of Copyright License. Subject to the terms and conditions of
|
|
67
|
+
this License, each Contributor hereby grants to You a perpetual,
|
|
68
|
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
69
|
+
copyright license to reproduce, prepare Derivative Works of,
|
|
70
|
+
publicly display, publicly perform, sublicense, and distribute the
|
|
71
|
+
Work and such Derivative Works in Source or Object form.
|
|
72
|
+
|
|
73
|
+
3. Grant of Patent License. Subject to the terms and conditions of
|
|
74
|
+
this License, each Contributor hereby grants to You a perpetual,
|
|
75
|
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
76
|
+
(except as stated in this section) patent license to make, have made,
|
|
77
|
+
use, offer to sell, sell, import, and otherwise transfer the Work,
|
|
78
|
+
where such license applies only to those patent claims licensable
|
|
79
|
+
by such Contributor that are necessarily infringed by their
|
|
80
|
+
Contribution(s) alone or by combination of their Contribution(s)
|
|
81
|
+
with the Work to which such Contribution(s) was submitted. If You
|
|
82
|
+
institute patent litigation against any entity (including a
|
|
83
|
+
cross-claim or counterclaim in a lawsuit) alleging that the Work
|
|
84
|
+
or a Contribution incorporated within the Work constitutes direct
|
|
85
|
+
or contributory patent infringement, then any patent licenses
|
|
86
|
+
granted to You under this License for that Work shall terminate
|
|
87
|
+
as of the date such litigation is filed.
|
|
88
|
+
|
|
89
|
+
4. Redistribution. You may reproduce and distribute copies of the
|
|
90
|
+
Work or Derivative Works thereof in any medium, with or without
|
|
91
|
+
modifications, and in Source or Object form, provided that You
|
|
92
|
+
meet the following conditions:
|
|
93
|
+
|
|
94
|
+
(a) You must give any other recipients of the Work or
|
|
95
|
+
Derivative Works a copy of this License; and
|
|
96
|
+
|
|
97
|
+
(b) You must cause any modified files to carry prominent notices
|
|
98
|
+
stating that You changed the files; and
|
|
99
|
+
|
|
100
|
+
(c) You must retain, in the Source form of any Derivative Works
|
|
101
|
+
that You distribute, all copyright, patent, trademark, and
|
|
102
|
+
attribution notices from the Source form of the Work,
|
|
103
|
+
excluding those notices that do not pertain to any part of
|
|
104
|
+
the Derivative Works; and
|
|
105
|
+
|
|
106
|
+
(d) If the Work includes a "NOTICE" text file as part of its
|
|
107
|
+
distribution, then any Derivative Works that You distribute must
|
|
108
|
+
include a readable copy of the attribution notices contained
|
|
109
|
+
within such NOTICE file, excluding those notices that do not
|
|
110
|
+
pertain to any part of the Derivative Works, in at least one
|
|
111
|
+
of the following places: within a NOTICE text file distributed
|
|
112
|
+
as part of the Derivative Works; within the Source form or
|
|
113
|
+
documentation, if provided along with the Derivative Works; or,
|
|
114
|
+
within a display generated by the Derivative Works, if and
|
|
115
|
+
wherever such third-party notices normally appear. The contents
|
|
116
|
+
of the NOTICE file are for informational purposes only and
|
|
117
|
+
do not modify the License. You may add Your own attribution
|
|
118
|
+
notices within Derivative Works that You distribute, alongside
|
|
119
|
+
or as an addendum to the NOTICE text from the Work, provided
|
|
120
|
+
that such additional attribution notices cannot be construed
|
|
121
|
+
as modifying the License.
|
|
122
|
+
|
|
123
|
+
You may add Your own copyright statement to Your modifications and
|
|
124
|
+
may provide additional or different license terms and conditions
|
|
125
|
+
for use, reproduction, or distribution of Your modifications, or
|
|
126
|
+
for any such Derivative Works as a whole, provided Your use,
|
|
127
|
+
reproduction, and distribution of the Work otherwise complies with
|
|
128
|
+
the conditions stated in this License.
|
|
129
|
+
|
|
130
|
+
5. Submission of Contributions. Unless You explicitly state otherwise,
|
|
131
|
+
any Contribution intentionally submitted for inclusion in the Work
|
|
132
|
+
by You to the Licensor shall be under the terms and conditions of
|
|
133
|
+
this License, without any additional terms or conditions.
|
|
134
|
+
Notwithstanding the above, nothing herein shall supersede or modify
|
|
135
|
+
the terms of any separate license agreement you may have executed
|
|
136
|
+
with Licensor regarding such Contributions.
|
|
137
|
+
|
|
138
|
+
6. Trademarks. This License does not grant permission to use the trade
|
|
139
|
+
names, trademarks, service marks, or product names of the Licensor,
|
|
140
|
+
except as required for reasonable and customary use in describing the
|
|
141
|
+
origin of the Work and reproducing the content of the NOTICE file.
|
|
142
|
+
|
|
143
|
+
7. Disclaimer of Warranty. Unless required by applicable law or
|
|
144
|
+
agreed to in writing, Licensor provides the Work (and each
|
|
145
|
+
Contributor provides its Contributions) on an "AS IS" BASIS,
|
|
146
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
|
|
147
|
+
implied, including, without limitation, any warranties or conditions
|
|
148
|
+
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
|
|
149
|
+
PARTICULAR PURPOSE. You are solely responsible for determining the
|
|
150
|
+
appropriateness of using or redistributing the Work and assume any
|
|
151
|
+
risks associated with Your exercise of permissions under this License.
|
|
152
|
+
|
|
153
|
+
8. Limitation of Liability. In no event and under no legal theory,
|
|
154
|
+
whether in tort (including negligence), contract, or otherwise,
|
|
155
|
+
unless required by applicable law (such as deliberate and grossly
|
|
156
|
+
negligent acts) or agreed to in writing, shall any Contributor be
|
|
157
|
+
liable to You for damages, including any direct, indirect, special,
|
|
158
|
+
incidental, or consequential damages of any character arising as a
|
|
159
|
+
result of this License or out of the use or inability to use the
|
|
160
|
+
Work (including but not limited to damages for loss of goodwill,
|
|
161
|
+
work stoppage, computer failure or malfunction, or any and all
|
|
162
|
+
other commercial damages or losses), even if such Contributor
|
|
163
|
+
has been advised of the possibility of such damages.
|
|
164
|
+
|
|
165
|
+
9. Accepting Warranty or Additional Liability. While redistributing
|
|
166
|
+
the Work or Derivative Works thereof, You may choose to offer,
|
|
167
|
+
and charge a fee for, acceptance of support, warranty, indemnity,
|
|
168
|
+
or other liability obligations and/or rights consistent with this
|
|
169
|
+
License. However, in accepting such obligations, You may act only
|
|
170
|
+
on Your own behalf and on Your sole responsibility, not on behalf
|
|
171
|
+
of any other Contributor, and only if You agree to indemnify,
|
|
172
|
+
defend, and hold each Contributor harmless for any liability
|
|
173
|
+
incurred by, or claims asserted against, such Contributor by reason
|
|
174
|
+
of your accepting any such warranty or additional liability.
|
|
175
|
+
|
|
176
|
+
END OF TERMS AND CONDITIONS
|
|
177
|
+
|
|
178
|
+
APPENDIX: How to apply the Apache License to your work.
|
|
179
|
+
|
|
180
|
+
To apply the Apache License to your work, attach the following
|
|
181
|
+
boilerplate notice, with the fields enclosed by brackets "[]"
|
|
182
|
+
replaced with your own identifying information. (Don't include
|
|
183
|
+
the brackets!) The text should be enclosed in the appropriate
|
|
184
|
+
comment syntax for the file format. We also recommend that a
|
|
185
|
+
file or class name and description of purpose be included on the
|
|
186
|
+
same "printed page" as the copyright notice for easier
|
|
187
|
+
identification within third-party archives.
|
|
188
|
+
|
|
189
|
+
Copyright [yyyy] [name of copyright owner]
|
|
190
|
+
|
|
191
|
+
Licensed under the Apache License, Version 2.0 (the "License");
|
|
192
|
+
you may not use this file except in compliance with the License.
|
|
193
|
+
You may obtain a copy of the License at
|
|
194
|
+
|
|
195
|
+
http://www.apache.org/licenses/LICENSE-2.0
|
|
196
|
+
|
|
197
|
+
Unless required by applicable law or agreed to in writing, software
|
|
198
|
+
distributed under the License is distributed on an "AS IS" BASIS,
|
|
199
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
200
|
+
See the License for the specific language governing permissions and
|
|
201
|
+
limitations under the License.
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
Metadata-Version: 2.1
|
|
2
|
+
Name: rs-client-libraries
|
|
3
|
+
Version: 0.2a3.post31.dev0
|
|
4
|
+
Summary: Copernicus Sentinel rs-client library and processing workflows.
|
|
5
|
+
Home-page: https://home.rs-python.eu/
|
|
6
|
+
License: Apache-2.0
|
|
7
|
+
Keywords: stac,copernicus,sentinel,processing
|
|
8
|
+
Author: ESA under contract with Airbus and CS
|
|
9
|
+
Author-email: ops_coprs@airbus.com
|
|
10
|
+
Requires-Python: >=3.11,<4.0
|
|
11
|
+
Classifier: Development Status :: 3 - Alpha
|
|
12
|
+
Classifier: Framework :: OpenTelemetry
|
|
13
|
+
Classifier: Intended Audience :: Developers
|
|
14
|
+
Classifier: Intended Audience :: Science/Research
|
|
15
|
+
Classifier: License :: OSI Approved :: Apache Software License
|
|
16
|
+
Classifier: Programming Language :: Python :: 3
|
|
17
|
+
Classifier: Programming Language :: Python :: 3.11
|
|
18
|
+
Classifier: Programming Language :: Python :: 3.12
|
|
19
|
+
Classifier: Topic :: Scientific/Engineering :: Image Processing
|
|
20
|
+
Classifier: Topic :: Software Development :: Libraries :: Python Modules
|
|
21
|
+
Requires-Dist: cachetools (>=5.3.3,<6.0.0)
|
|
22
|
+
Requires-Dist: numpy (>=1.26.4,<2.0.0)
|
|
23
|
+
Requires-Dist: opentelemetry-distro (>=0.48b0,<0.49)
|
|
24
|
+
Requires-Dist: opentelemetry-exporter-otlp (>=1.27.0,<2.0.0)
|
|
25
|
+
Requires-Dist: opentelemetry-instrumentation-aws-lambda (>=0.48b0,<0.49)
|
|
26
|
+
Requires-Dist: opentelemetry-test-utils (>=0.48b0,<0.49)
|
|
27
|
+
Requires-Dist: prefect (>=2.14.21,<3.0.0)
|
|
28
|
+
Requires-Dist: prefect-dask (>=0.2.6,<0.3.0)
|
|
29
|
+
Requires-Dist: pystac (>=1.10.1,<2.0.0)
|
|
30
|
+
Requires-Dist: pystac-client (>=0.8.1,<0.9.0)
|
|
31
|
+
Requires-Dist: python-dateutil (>=2.9.0.post0,<3.0.0)
|
|
32
|
+
Requires-Dist: python-logging-loki (>=0.3.1,<0.4.0)
|
|
33
|
+
Requires-Dist: shapely (>=2.0.6,<3.0.0)
|
|
34
|
+
Requires-Dist: starlette (>=0.38.4,<0.39.0)
|
|
35
|
+
Project-URL: Documentation, https://home.rs-python.eu/rs-documentation/rs-client-libraries/docs/doc/
|
|
36
|
+
Project-URL: Repository, https://github.com/RS-PYTHON/rs-client-libraries
|
|
37
|
+
Description-Content-Type: text/plain
|
|
38
|
+
|
|
39
|
+
# rs-client-libraries
|
|
40
|
+
This repository contains all the prefect flows allowing to build Copernicus processing chains.
|
|
41
|
+
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
rs_client/__init__.py,sha256=FDgOKDOWFh0Ip-6syPzYAeBlEgVzw9kQsCqCyiGYuFU,695
|
|
2
|
+
rs_client/auxip_client.py,sha256=7JieCMp-7EW1zPmTfmxrXj7Fg4hU18TXFB3rHeW1xXs,2049
|
|
3
|
+
rs_client/cadip_client.py,sha256=SvEELtFKSl_HE3A9nSTVbTAJNomJTvjtRtHSNKgEuBE,5529
|
|
4
|
+
rs_client/rs_client.py,sha256=AwD6Vzc3l-SLYzo3C6HKA8qDVWaPioPbx8z_n59CG4g,17749
|
|
5
|
+
rs_client/stac_client.py,sha256=9zkJtgDGF0Jf3hNwPqiM92aZFajrWLXMA1Fqq_H2ZrA,13994
|
|
6
|
+
rs_common/__init__.py,sha256=7d3Ib4tkK0xEyt2u7I-_9lBAjXDUMSn5qagvl1KMmGM,698
|
|
7
|
+
rs_common/config.py,sha256=Izo1xdmOEBp0vScTwFmK2HoEz288j0iB43_c5p2agY4,1450
|
|
8
|
+
rs_common/logging.py,sha256=Hh4TGdzzqqi9TQ_-aVVv8JrMgKnaZJOVMkoX3Die0ss,3382
|
|
9
|
+
rs_common/opentelemetry.py,sha256=r0L_66oFSeBcUMraX2qqRpz9eNJfr_4_KKsas9EM1ZQ,4812
|
|
10
|
+
rs_common/serialization.py,sha256=jZaubX1-DsqI7OFo8tKn1pCdcdNoqC4JmL192Sq-bws,3300
|
|
11
|
+
rs_common/utils.py,sha256=k_izJC-EVKx5Fm7VRuRPMwE8A81nBKvsQVe4IzqjzTY,1391
|
|
12
|
+
rs_workflows/__init__.py,sha256=HmTf_nhW4SKjePGrEcP--PxtuaWKxugTajKoogRQqq4,699
|
|
13
|
+
rs_workflows/config/dpr_config_template.yaml,sha256=mSuUWsGmQh2pjG3cubQ8Y23eT55D2txsfJ4wVVp56h4,1319
|
|
14
|
+
rs_workflows/example.py,sha256=tOxiuPMB2VlQsu6wiMV53b2ViDtfb_PfD80HUllDsg4,1430
|
|
15
|
+
rs_workflows/s1_l0.py,sha256=CsBFfry2MJSzUcMRnc0epRGl0llnWC7F8bylJ7isG-I,19017
|
|
16
|
+
rs_workflows/staging.py,sha256=A2g_n8et_8YhCNtBqy1EXVin8F4f-dnOYOnZS97xiDU,20380
|
|
17
|
+
rs_client_libraries-0.2a3.post31.dev0.dist-info/LICENSE,sha256=xx0jnfkXJvxRnG63LTGOxlggYnIysveWIZ6H3PNdCrQ,11357
|
|
18
|
+
rs_client_libraries-0.2a3.post31.dev0.dist-info/METADATA,sha256=K1vzY2vshWfJU_Nb8sWMrM5XqjdbMfF1YTVbk3Oz7ww,1909
|
|
19
|
+
rs_client_libraries-0.2a3.post31.dev0.dist-info/WHEEL,sha256=sP946D7jFCHeNz5Iq4fL4Lu-PrWrFsgfLXbbkciIZwg,88
|
|
20
|
+
rs_client_libraries-0.2a3.post31.dev0.dist-info/RECORD,,
|
rs_common/__init__.py
ADDED
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
# Copyright 2024 CS Group
|
|
2
|
+
#
|
|
3
|
+
# Licensed under the Apache License, Version 2.0 (the "License");
|
|
4
|
+
# you may not use this file except in compliance with the License.
|
|
5
|
+
# You may obtain a copy of the License at
|
|
6
|
+
#
|
|
7
|
+
# http://www.apache.org/licenses/LICENSE-2.0
|
|
8
|
+
#
|
|
9
|
+
# Unless required by applicable law or agreed to in writing, software
|
|
10
|
+
# distributed under the License is distributed on an "AS IS" BASIS,
|
|
11
|
+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
12
|
+
# See the License for the specific language governing permissions and
|
|
13
|
+
# limitations under the License.
|
|
14
|
+
|
|
15
|
+
"""Common modules."""
|
|
16
|
+
|
|
17
|
+
# Configure OpenTelemetry
|
|
18
|
+
from rs_common import opentelemetry
|
|
19
|
+
|
|
20
|
+
opentelemetry.init_traces("rs.client")
|