cdsetool 0.3.1__tar.gz → 0.3.3__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.
- {cdsetool-0.3.1/src/cdsetool.egg-info → cdsetool-0.3.3}/PKG-INFO +38 -18
- {cdsetool-0.3.1 → cdsetool-0.3.3}/README.md +32 -12
- {cdsetool-0.3.1 → cdsetool-0.3.3}/pyproject.toml +8 -8
- {cdsetool-0.3.1 → cdsetool-0.3.3}/src/cdsetool/monitor.py +2 -7
- {cdsetool-0.3.1 → cdsetool-0.3.3/src/cdsetool.egg-info}/PKG-INFO +38 -18
- {cdsetool-0.3.1 → cdsetool-0.3.3}/src/cdsetool.egg-info/requires.txt +4 -4
- {cdsetool-0.3.1 → cdsetool-0.3.3}/LICENSE +0 -0
- {cdsetool-0.3.1 → cdsetool-0.3.3}/setup.cfg +0 -0
- {cdsetool-0.3.1 → cdsetool-0.3.3}/src/cdsetool/__init__.py +0 -0
- {cdsetool-0.3.1 → cdsetool-0.3.3}/src/cdsetool/_attributes.py +0 -0
- {cdsetool-0.3.1 → cdsetool-0.3.3}/src/cdsetool/_processing.py +0 -0
- {cdsetool-0.3.1 → cdsetool-0.3.3}/src/cdsetool/cli.py +0 -0
- {cdsetool-0.3.1 → cdsetool-0.3.3}/src/cdsetool/credentials.py +0 -0
- {cdsetool-0.3.1 → cdsetool-0.3.3}/src/cdsetool/download.py +0 -0
- {cdsetool-0.3.1 → cdsetool-0.3.3}/src/cdsetool/logger.py +0 -0
- {cdsetool-0.3.1 → cdsetool-0.3.3}/src/cdsetool/py.typed +0 -0
- {cdsetool-0.3.1 → cdsetool-0.3.3}/src/cdsetool/query.py +0 -0
- {cdsetool-0.3.1 → cdsetool-0.3.3}/src/cdsetool.egg-info/SOURCES.txt +0 -0
- {cdsetool-0.3.1 → cdsetool-0.3.3}/src/cdsetool.egg-info/dependency_links.txt +0 -0
- {cdsetool-0.3.1 → cdsetool-0.3.3}/src/cdsetool.egg-info/entry_points.txt +0 -0
- {cdsetool-0.3.1 → cdsetool-0.3.3}/src/cdsetool.egg-info/top_level.txt +0 -0
|
@@ -1,26 +1,26 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: cdsetool
|
|
3
|
-
Version: 0.3.
|
|
3
|
+
Version: 0.3.3
|
|
4
4
|
Summary: Tools & CLI for interacting with CDSE product APIs
|
|
5
5
|
Author-email: Jacob Vejby <javej@sdfi.dk>
|
|
6
6
|
Project-URL: Homepage, https://github.com/CDSETool/CDSETool
|
|
7
7
|
Project-URL: Bug Tracker, https://github.com/CDSETool/CDSETool/issues
|
|
8
8
|
Classifier: Programming Language :: Python :: 3
|
|
9
9
|
Classifier: Operating System :: OS Independent
|
|
10
|
-
Requires-Python: >=3.
|
|
10
|
+
Requires-Python: >=3.11
|
|
11
11
|
Description-Content-Type: text/markdown
|
|
12
12
|
License-File: LICENSE
|
|
13
13
|
Requires-Dist: typer<1,>=0.9
|
|
14
14
|
Requires-Dist: rich<16,>=13.6
|
|
15
15
|
Requires-Dist: requests<3,>=2.28.1
|
|
16
|
-
Requires-Dist: pyjwt[crypto]<
|
|
16
|
+
Requires-Dist: pyjwt[crypto]<3,>=2.8
|
|
17
17
|
Requires-Dist: geopandas>=0.13.2
|
|
18
18
|
Provides-Extra: test
|
|
19
|
-
Requires-Dist: pylint==
|
|
20
|
-
Requires-Dist: pytest==
|
|
19
|
+
Requires-Dist: pylint==4.1.3; extra == "test"
|
|
20
|
+
Requires-Dist: pytest==9.1.1; extra == "test"
|
|
21
21
|
Requires-Dist: pytest-cov==7.1.0; extra == "test"
|
|
22
22
|
Requires-Dist: requests-mock==1.12.1; extra == "test"
|
|
23
|
-
Requires-Dist: pytest-mock==3.
|
|
23
|
+
Requires-Dist: pytest-mock==3.16.0; extra == "test"
|
|
24
24
|
Dynamic: license-file
|
|
25
25
|
|
|
26
26
|
# CDSETool
|
|
@@ -95,7 +95,7 @@ cdsetool download SENTINEL-2 PATH/TO/DIR --concurrency 4 --search-term contentDa
|
|
|
95
95
|
Install `cdsetool` using pip:
|
|
96
96
|
|
|
97
97
|
```bash
|
|
98
|
-
pip install cdsetool==0.3.
|
|
98
|
+
pip install cdsetool==0.3.3
|
|
99
99
|
```
|
|
100
100
|
|
|
101
101
|
## Usage
|
|
@@ -155,8 +155,8 @@ product = {
|
|
|
155
155
|
"Attributes": [
|
|
156
156
|
{"Name": "productType", "Value": "S2MSI2A"},
|
|
157
157
|
{"Name": "cloudCover", "Value": 5.2},
|
|
158
|
-
|
|
159
|
-
]
|
|
158
|
+
...,
|
|
159
|
+
],
|
|
160
160
|
}
|
|
161
161
|
```
|
|
162
162
|
|
|
@@ -170,13 +170,13 @@ from cdsetool.query import query_features, get_product_attribute
|
|
|
170
170
|
features = query_features(
|
|
171
171
|
"SENTINEL-2",
|
|
172
172
|
{"contentDateStartGe": "2024-01-01"},
|
|
173
|
-
options={"expand_attributes": True}
|
|
173
|
+
options={"expand_attributes": True},
|
|
174
174
|
)
|
|
175
175
|
feature = features[0]
|
|
176
176
|
|
|
177
177
|
# Access basic properties directly
|
|
178
178
|
print(feature["Name"]) # Product name
|
|
179
|
-
print(feature["Id"])
|
|
179
|
+
print(feature["Id"]) # Product UUID
|
|
180
180
|
|
|
181
181
|
# Access attributes using helper function
|
|
182
182
|
cloud_cover = get_product_attribute(feature, "cloudCover")
|
|
@@ -240,10 +240,19 @@ Interval syntax is only allowed on the base name, not on suffixed variants, and
|
|
|
240
240
|
from cdsetool.query import query_features
|
|
241
241
|
from datetime import date, datetime
|
|
242
242
|
|
|
243
|
-
date_from = date(
|
|
243
|
+
date_from = date(
|
|
244
|
+
2020, 1, 1
|
|
245
|
+
) # or datetime(2020, 1, 1, 23, 59, 59, 123456) or "2020-01-01" or "2020-01-01T23:59:59.123456Z"
|
|
244
246
|
date_to = date(2020, 12, 31)
|
|
245
247
|
|
|
246
|
-
features = query_features(
|
|
248
|
+
features = query_features(
|
|
249
|
+
"SENTINEL-2",
|
|
250
|
+
{
|
|
251
|
+
"contentDateStartGe": date_from,
|
|
252
|
+
"contentDateStartLe": date_to,
|
|
253
|
+
"cloudCover": "[0, 30]",
|
|
254
|
+
},
|
|
255
|
+
)
|
|
247
256
|
```
|
|
248
257
|
|
|
249
258
|
#### Listing search terms
|
|
@@ -307,7 +316,7 @@ Credentials can be validated using the `validate_credentials` function which wil
|
|
|
307
316
|
```python
|
|
308
317
|
from cdsetool.credentials import validate_credentials
|
|
309
318
|
|
|
310
|
-
validate_credentials(username=
|
|
319
|
+
validate_credentials(username="user", password="password")
|
|
311
320
|
```
|
|
312
321
|
|
|
313
322
|
If None are passed to username and password, `validate_credentials` will validate `.netrc`
|
|
@@ -324,7 +333,10 @@ The downloaded feature ids are yielded, so its required to await the results.
|
|
|
324
333
|
from cdsetool.query import query_features
|
|
325
334
|
from cdsetool.download import download_features
|
|
326
335
|
|
|
327
|
-
features = query_features(
|
|
336
|
+
features = query_features(
|
|
337
|
+
"SENTINEL-2",
|
|
338
|
+
{"contentDateStartGe": "2024-01-01", "contentDateStartLe": "2024-01-10"},
|
|
339
|
+
)
|
|
328
340
|
|
|
329
341
|
download_path = "/path/to/download/folder"
|
|
330
342
|
downloads = download_features(features, download_path, {"concurrency": 4})
|
|
@@ -345,7 +357,10 @@ Its possible to download features sequentially in a single thread if desired.
|
|
|
345
357
|
from cdsetool.query import query_features
|
|
346
358
|
from cdsetool.download import download_feature
|
|
347
359
|
|
|
348
|
-
features = query_features(
|
|
360
|
+
features = query_features(
|
|
361
|
+
"SENTINEL-2",
|
|
362
|
+
{"contentDateStartGe": "2024-01-01", "contentDateStartLe": "2024-01-10"},
|
|
363
|
+
)
|
|
349
364
|
|
|
350
365
|
download_path = "/path/to/download/folder"
|
|
351
366
|
for feature in features:
|
|
@@ -363,11 +378,16 @@ It can be used in CDSETool:
|
|
|
363
378
|
from cdsetool.query import query_features
|
|
364
379
|
from cdsetool.download import download_features
|
|
365
380
|
|
|
366
|
-
features = query_features(
|
|
381
|
+
features = query_features(
|
|
382
|
+
"SENTINEL-2",
|
|
383
|
+
{"contentDateStartGe": "2024-01-01", "contentDateStartLe": "2024-01-10"},
|
|
384
|
+
)
|
|
367
385
|
|
|
368
386
|
download_path = "/path/to/download/folder"
|
|
369
387
|
filter_pattern = "*TCI.jp2"
|
|
370
|
-
downloads = download_features(
|
|
388
|
+
downloads = download_features(
|
|
389
|
+
features, download_path, {"filter_pattern": filter_pattern}
|
|
390
|
+
)
|
|
371
391
|
|
|
372
392
|
for id in downloads:
|
|
373
393
|
print(f"feature {id} downloaded")
|
|
@@ -70,7 +70,7 @@ cdsetool download SENTINEL-2 PATH/TO/DIR --concurrency 4 --search-term contentDa
|
|
|
70
70
|
Install `cdsetool` using pip:
|
|
71
71
|
|
|
72
72
|
```bash
|
|
73
|
-
pip install cdsetool==0.3.
|
|
73
|
+
pip install cdsetool==0.3.3
|
|
74
74
|
```
|
|
75
75
|
|
|
76
76
|
## Usage
|
|
@@ -130,8 +130,8 @@ product = {
|
|
|
130
130
|
"Attributes": [
|
|
131
131
|
{"Name": "productType", "Value": "S2MSI2A"},
|
|
132
132
|
{"Name": "cloudCover", "Value": 5.2},
|
|
133
|
-
|
|
134
|
-
]
|
|
133
|
+
...,
|
|
134
|
+
],
|
|
135
135
|
}
|
|
136
136
|
```
|
|
137
137
|
|
|
@@ -145,13 +145,13 @@ from cdsetool.query import query_features, get_product_attribute
|
|
|
145
145
|
features = query_features(
|
|
146
146
|
"SENTINEL-2",
|
|
147
147
|
{"contentDateStartGe": "2024-01-01"},
|
|
148
|
-
options={"expand_attributes": True}
|
|
148
|
+
options={"expand_attributes": True},
|
|
149
149
|
)
|
|
150
150
|
feature = features[0]
|
|
151
151
|
|
|
152
152
|
# Access basic properties directly
|
|
153
153
|
print(feature["Name"]) # Product name
|
|
154
|
-
print(feature["Id"])
|
|
154
|
+
print(feature["Id"]) # Product UUID
|
|
155
155
|
|
|
156
156
|
# Access attributes using helper function
|
|
157
157
|
cloud_cover = get_product_attribute(feature, "cloudCover")
|
|
@@ -215,10 +215,19 @@ Interval syntax is only allowed on the base name, not on suffixed variants, and
|
|
|
215
215
|
from cdsetool.query import query_features
|
|
216
216
|
from datetime import date, datetime
|
|
217
217
|
|
|
218
|
-
date_from = date(
|
|
218
|
+
date_from = date(
|
|
219
|
+
2020, 1, 1
|
|
220
|
+
) # or datetime(2020, 1, 1, 23, 59, 59, 123456) or "2020-01-01" or "2020-01-01T23:59:59.123456Z"
|
|
219
221
|
date_to = date(2020, 12, 31)
|
|
220
222
|
|
|
221
|
-
features = query_features(
|
|
223
|
+
features = query_features(
|
|
224
|
+
"SENTINEL-2",
|
|
225
|
+
{
|
|
226
|
+
"contentDateStartGe": date_from,
|
|
227
|
+
"contentDateStartLe": date_to,
|
|
228
|
+
"cloudCover": "[0, 30]",
|
|
229
|
+
},
|
|
230
|
+
)
|
|
222
231
|
```
|
|
223
232
|
|
|
224
233
|
#### Listing search terms
|
|
@@ -282,7 +291,7 @@ Credentials can be validated using the `validate_credentials` function which wil
|
|
|
282
291
|
```python
|
|
283
292
|
from cdsetool.credentials import validate_credentials
|
|
284
293
|
|
|
285
|
-
validate_credentials(username=
|
|
294
|
+
validate_credentials(username="user", password="password")
|
|
286
295
|
```
|
|
287
296
|
|
|
288
297
|
If None are passed to username and password, `validate_credentials` will validate `.netrc`
|
|
@@ -299,7 +308,10 @@ The downloaded feature ids are yielded, so its required to await the results.
|
|
|
299
308
|
from cdsetool.query import query_features
|
|
300
309
|
from cdsetool.download import download_features
|
|
301
310
|
|
|
302
|
-
features = query_features(
|
|
311
|
+
features = query_features(
|
|
312
|
+
"SENTINEL-2",
|
|
313
|
+
{"contentDateStartGe": "2024-01-01", "contentDateStartLe": "2024-01-10"},
|
|
314
|
+
)
|
|
303
315
|
|
|
304
316
|
download_path = "/path/to/download/folder"
|
|
305
317
|
downloads = download_features(features, download_path, {"concurrency": 4})
|
|
@@ -320,7 +332,10 @@ Its possible to download features sequentially in a single thread if desired.
|
|
|
320
332
|
from cdsetool.query import query_features
|
|
321
333
|
from cdsetool.download import download_feature
|
|
322
334
|
|
|
323
|
-
features = query_features(
|
|
335
|
+
features = query_features(
|
|
336
|
+
"SENTINEL-2",
|
|
337
|
+
{"contentDateStartGe": "2024-01-01", "contentDateStartLe": "2024-01-10"},
|
|
338
|
+
)
|
|
324
339
|
|
|
325
340
|
download_path = "/path/to/download/folder"
|
|
326
341
|
for feature in features:
|
|
@@ -338,11 +353,16 @@ It can be used in CDSETool:
|
|
|
338
353
|
from cdsetool.query import query_features
|
|
339
354
|
from cdsetool.download import download_features
|
|
340
355
|
|
|
341
|
-
features = query_features(
|
|
356
|
+
features = query_features(
|
|
357
|
+
"SENTINEL-2",
|
|
358
|
+
{"contentDateStartGe": "2024-01-01", "contentDateStartLe": "2024-01-10"},
|
|
359
|
+
)
|
|
342
360
|
|
|
343
361
|
download_path = "/path/to/download/folder"
|
|
344
362
|
filter_pattern = "*TCI.jp2"
|
|
345
|
-
downloads = download_features(
|
|
363
|
+
downloads = download_features(
|
|
364
|
+
features, download_path, {"filter_pattern": filter_pattern}
|
|
365
|
+
)
|
|
346
366
|
|
|
347
367
|
for id in downloads:
|
|
348
368
|
print(f"feature {id} downloaded")
|
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
[build-system]
|
|
2
|
-
requires = ["setuptools>=
|
|
2
|
+
requires = ["setuptools>=69"]
|
|
3
3
|
build-backend = "setuptools.build_meta"
|
|
4
4
|
|
|
5
5
|
[project]
|
|
6
6
|
name = "cdsetool"
|
|
7
|
-
version = "0.3.
|
|
7
|
+
version = "0.3.3"
|
|
8
8
|
authors = [
|
|
9
9
|
{ name="Jacob Vejby", email="javej@sdfi.dk" },
|
|
10
10
|
]
|
|
11
11
|
description = "Tools & CLI for interacting with CDSE product APIs"
|
|
12
12
|
readme = "README.md"
|
|
13
|
-
requires-python = ">=3.
|
|
13
|
+
requires-python = ">=3.11"
|
|
14
14
|
classifiers = [
|
|
15
15
|
"Programming Language :: Python :: 3",
|
|
16
16
|
"Operating System :: OS Independent",
|
|
@@ -19,22 +19,22 @@ dependencies = [
|
|
|
19
19
|
"typer >= 0.9,< 1",
|
|
20
20
|
"rich >= 13.6,< 16",
|
|
21
21
|
"requests >= 2.28.1,< 3",
|
|
22
|
-
"pyjwt[crypto] >= 2.8,<
|
|
22
|
+
"pyjwt[crypto] >= 2.8,< 3",
|
|
23
23
|
"geopandas >= 0.13.2",
|
|
24
24
|
]
|
|
25
25
|
[dependency-groups]
|
|
26
26
|
dev = [
|
|
27
|
-
"ruff==0.
|
|
27
|
+
"ruff==0.17.1",
|
|
28
28
|
]
|
|
29
29
|
# (Jan 30 2025) Pip does not support dependency-groups yet, so
|
|
30
30
|
# leave the optional dependencies for everything except Ruff.
|
|
31
31
|
[project.optional-dependencies]
|
|
32
32
|
test = [
|
|
33
|
-
"pylint==
|
|
34
|
-
"pytest==
|
|
33
|
+
"pylint==4.1.3",
|
|
34
|
+
"pytest==9.1.1",
|
|
35
35
|
"pytest-cov==7.1.0",
|
|
36
36
|
"requests-mock==1.12.1",
|
|
37
|
-
"pytest-mock==3.
|
|
37
|
+
"pytest-mock==3.16.0",
|
|
38
38
|
]
|
|
39
39
|
|
|
40
40
|
[project.urls]
|
|
@@ -16,17 +16,12 @@ import threading
|
|
|
16
16
|
import time
|
|
17
17
|
from typing import List, Tuple, Union
|
|
18
18
|
|
|
19
|
-
IS_IPYTHON = True
|
|
20
|
-
|
|
21
19
|
try:
|
|
22
20
|
from IPython import get_ipython # type:ignore[reportMissingImports]
|
|
23
21
|
from IPython.display import clear_output # type:ignore[reportMissingImports]
|
|
24
22
|
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
except ImportError:
|
|
28
|
-
IS_IPYTHON = False
|
|
29
|
-
except AttributeError:
|
|
23
|
+
IS_IPYTHON = "IPKernelApp" in get_ipython().config
|
|
24
|
+
except (ImportError, AttributeError):
|
|
30
25
|
IS_IPYTHON = False
|
|
31
26
|
|
|
32
27
|
|
|
@@ -1,26 +1,26 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: cdsetool
|
|
3
|
-
Version: 0.3.
|
|
3
|
+
Version: 0.3.3
|
|
4
4
|
Summary: Tools & CLI for interacting with CDSE product APIs
|
|
5
5
|
Author-email: Jacob Vejby <javej@sdfi.dk>
|
|
6
6
|
Project-URL: Homepage, https://github.com/CDSETool/CDSETool
|
|
7
7
|
Project-URL: Bug Tracker, https://github.com/CDSETool/CDSETool/issues
|
|
8
8
|
Classifier: Programming Language :: Python :: 3
|
|
9
9
|
Classifier: Operating System :: OS Independent
|
|
10
|
-
Requires-Python: >=3.
|
|
10
|
+
Requires-Python: >=3.11
|
|
11
11
|
Description-Content-Type: text/markdown
|
|
12
12
|
License-File: LICENSE
|
|
13
13
|
Requires-Dist: typer<1,>=0.9
|
|
14
14
|
Requires-Dist: rich<16,>=13.6
|
|
15
15
|
Requires-Dist: requests<3,>=2.28.1
|
|
16
|
-
Requires-Dist: pyjwt[crypto]<
|
|
16
|
+
Requires-Dist: pyjwt[crypto]<3,>=2.8
|
|
17
17
|
Requires-Dist: geopandas>=0.13.2
|
|
18
18
|
Provides-Extra: test
|
|
19
|
-
Requires-Dist: pylint==
|
|
20
|
-
Requires-Dist: pytest==
|
|
19
|
+
Requires-Dist: pylint==4.1.3; extra == "test"
|
|
20
|
+
Requires-Dist: pytest==9.1.1; extra == "test"
|
|
21
21
|
Requires-Dist: pytest-cov==7.1.0; extra == "test"
|
|
22
22
|
Requires-Dist: requests-mock==1.12.1; extra == "test"
|
|
23
|
-
Requires-Dist: pytest-mock==3.
|
|
23
|
+
Requires-Dist: pytest-mock==3.16.0; extra == "test"
|
|
24
24
|
Dynamic: license-file
|
|
25
25
|
|
|
26
26
|
# CDSETool
|
|
@@ -95,7 +95,7 @@ cdsetool download SENTINEL-2 PATH/TO/DIR --concurrency 4 --search-term contentDa
|
|
|
95
95
|
Install `cdsetool` using pip:
|
|
96
96
|
|
|
97
97
|
```bash
|
|
98
|
-
pip install cdsetool==0.3.
|
|
98
|
+
pip install cdsetool==0.3.3
|
|
99
99
|
```
|
|
100
100
|
|
|
101
101
|
## Usage
|
|
@@ -155,8 +155,8 @@ product = {
|
|
|
155
155
|
"Attributes": [
|
|
156
156
|
{"Name": "productType", "Value": "S2MSI2A"},
|
|
157
157
|
{"Name": "cloudCover", "Value": 5.2},
|
|
158
|
-
|
|
159
|
-
]
|
|
158
|
+
...,
|
|
159
|
+
],
|
|
160
160
|
}
|
|
161
161
|
```
|
|
162
162
|
|
|
@@ -170,13 +170,13 @@ from cdsetool.query import query_features, get_product_attribute
|
|
|
170
170
|
features = query_features(
|
|
171
171
|
"SENTINEL-2",
|
|
172
172
|
{"contentDateStartGe": "2024-01-01"},
|
|
173
|
-
options={"expand_attributes": True}
|
|
173
|
+
options={"expand_attributes": True},
|
|
174
174
|
)
|
|
175
175
|
feature = features[0]
|
|
176
176
|
|
|
177
177
|
# Access basic properties directly
|
|
178
178
|
print(feature["Name"]) # Product name
|
|
179
|
-
print(feature["Id"])
|
|
179
|
+
print(feature["Id"]) # Product UUID
|
|
180
180
|
|
|
181
181
|
# Access attributes using helper function
|
|
182
182
|
cloud_cover = get_product_attribute(feature, "cloudCover")
|
|
@@ -240,10 +240,19 @@ Interval syntax is only allowed on the base name, not on suffixed variants, and
|
|
|
240
240
|
from cdsetool.query import query_features
|
|
241
241
|
from datetime import date, datetime
|
|
242
242
|
|
|
243
|
-
date_from = date(
|
|
243
|
+
date_from = date(
|
|
244
|
+
2020, 1, 1
|
|
245
|
+
) # or datetime(2020, 1, 1, 23, 59, 59, 123456) or "2020-01-01" or "2020-01-01T23:59:59.123456Z"
|
|
244
246
|
date_to = date(2020, 12, 31)
|
|
245
247
|
|
|
246
|
-
features = query_features(
|
|
248
|
+
features = query_features(
|
|
249
|
+
"SENTINEL-2",
|
|
250
|
+
{
|
|
251
|
+
"contentDateStartGe": date_from,
|
|
252
|
+
"contentDateStartLe": date_to,
|
|
253
|
+
"cloudCover": "[0, 30]",
|
|
254
|
+
},
|
|
255
|
+
)
|
|
247
256
|
```
|
|
248
257
|
|
|
249
258
|
#### Listing search terms
|
|
@@ -307,7 +316,7 @@ Credentials can be validated using the `validate_credentials` function which wil
|
|
|
307
316
|
```python
|
|
308
317
|
from cdsetool.credentials import validate_credentials
|
|
309
318
|
|
|
310
|
-
validate_credentials(username=
|
|
319
|
+
validate_credentials(username="user", password="password")
|
|
311
320
|
```
|
|
312
321
|
|
|
313
322
|
If None are passed to username and password, `validate_credentials` will validate `.netrc`
|
|
@@ -324,7 +333,10 @@ The downloaded feature ids are yielded, so its required to await the results.
|
|
|
324
333
|
from cdsetool.query import query_features
|
|
325
334
|
from cdsetool.download import download_features
|
|
326
335
|
|
|
327
|
-
features = query_features(
|
|
336
|
+
features = query_features(
|
|
337
|
+
"SENTINEL-2",
|
|
338
|
+
{"contentDateStartGe": "2024-01-01", "contentDateStartLe": "2024-01-10"},
|
|
339
|
+
)
|
|
328
340
|
|
|
329
341
|
download_path = "/path/to/download/folder"
|
|
330
342
|
downloads = download_features(features, download_path, {"concurrency": 4})
|
|
@@ -345,7 +357,10 @@ Its possible to download features sequentially in a single thread if desired.
|
|
|
345
357
|
from cdsetool.query import query_features
|
|
346
358
|
from cdsetool.download import download_feature
|
|
347
359
|
|
|
348
|
-
features = query_features(
|
|
360
|
+
features = query_features(
|
|
361
|
+
"SENTINEL-2",
|
|
362
|
+
{"contentDateStartGe": "2024-01-01", "contentDateStartLe": "2024-01-10"},
|
|
363
|
+
)
|
|
349
364
|
|
|
350
365
|
download_path = "/path/to/download/folder"
|
|
351
366
|
for feature in features:
|
|
@@ -363,11 +378,16 @@ It can be used in CDSETool:
|
|
|
363
378
|
from cdsetool.query import query_features
|
|
364
379
|
from cdsetool.download import download_features
|
|
365
380
|
|
|
366
|
-
features = query_features(
|
|
381
|
+
features = query_features(
|
|
382
|
+
"SENTINEL-2",
|
|
383
|
+
{"contentDateStartGe": "2024-01-01", "contentDateStartLe": "2024-01-10"},
|
|
384
|
+
)
|
|
367
385
|
|
|
368
386
|
download_path = "/path/to/download/folder"
|
|
369
387
|
filter_pattern = "*TCI.jp2"
|
|
370
|
-
downloads = download_features(
|
|
388
|
+
downloads = download_features(
|
|
389
|
+
features, download_path, {"filter_pattern": filter_pattern}
|
|
390
|
+
)
|
|
371
391
|
|
|
372
392
|
for id in downloads:
|
|
373
393
|
print(f"feature {id} downloaded")
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
typer<1,>=0.9
|
|
2
2
|
rich<16,>=13.6
|
|
3
3
|
requests<3,>=2.28.1
|
|
4
|
-
pyjwt[crypto]<
|
|
4
|
+
pyjwt[crypto]<3,>=2.8
|
|
5
5
|
geopandas>=0.13.2
|
|
6
6
|
|
|
7
7
|
[test]
|
|
8
|
-
pylint==
|
|
9
|
-
pytest==
|
|
8
|
+
pylint==4.1.3
|
|
9
|
+
pytest==9.1.1
|
|
10
10
|
pytest-cov==7.1.0
|
|
11
11
|
requests-mock==1.12.1
|
|
12
|
-
pytest-mock==3.
|
|
12
|
+
pytest-mock==3.16.0
|
|
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
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|