cdsetool 0.2.3__tar.gz → 0.2.4__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.2.3/src/cdsetool.egg-info → cdsetool-0.2.4}/PKG-INFO +5 -5
- {cdsetool-0.2.3 → cdsetool-0.2.4}/README.md +1 -1
- {cdsetool-0.2.3 → cdsetool-0.2.4}/pyproject.toml +4 -4
- {cdsetool-0.2.3 → cdsetool-0.2.4}/src/cdsetool/_processing.py +1 -0
- {cdsetool-0.2.3 → cdsetool-0.2.4}/src/cdsetool/cli.py +11 -1
- {cdsetool-0.2.3 → cdsetool-0.2.4}/src/cdsetool/credentials.py +1 -0
- {cdsetool-0.2.3 → cdsetool-0.2.4}/src/cdsetool/download.py +8 -3
- {cdsetool-0.2.3 → cdsetool-0.2.4}/src/cdsetool/monitor.py +1 -0
- {cdsetool-0.2.3 → cdsetool-0.2.4}/src/cdsetool/query.py +3 -0
- {cdsetool-0.2.3 → cdsetool-0.2.4/src/cdsetool.egg-info}/PKG-INFO +5 -5
- {cdsetool-0.2.3 → cdsetool-0.2.4}/src/cdsetool.egg-info/requires.txt +3 -3
- {cdsetool-0.2.3 → cdsetool-0.2.4}/LICENSE +0 -0
- {cdsetool-0.2.3 → cdsetool-0.2.4}/setup.cfg +0 -0
- {cdsetool-0.2.3 → cdsetool-0.2.4}/src/cdsetool/__init__.py +0 -0
- {cdsetool-0.2.3 → cdsetool-0.2.4}/src/cdsetool.egg-info/SOURCES.txt +0 -0
- {cdsetool-0.2.3 → cdsetool-0.2.4}/src/cdsetool.egg-info/dependency_links.txt +0 -0
- {cdsetool-0.2.3 → cdsetool-0.2.4}/src/cdsetool.egg-info/entry_points.txt +0 -0
- {cdsetool-0.2.3 → cdsetool-0.2.4}/src/cdsetool.egg-info/top_level.txt +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.1
|
|
2
2
|
Name: cdsetool
|
|
3
|
-
Version: 0.2.
|
|
3
|
+
Version: 0.2.4
|
|
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/SDFIdk/CDSETool
|
|
@@ -15,9 +15,9 @@ Requires-Dist: rich<13.8,>=13.6
|
|
|
15
15
|
Requires-Dist: requests<2.32.0,>=2.28.1
|
|
16
16
|
Requires-Dist: pyjwt[crypto]~=2.8.0
|
|
17
17
|
Provides-Extra: test
|
|
18
|
-
Requires-Dist: black==
|
|
19
|
-
Requires-Dist: pylint==3.0.
|
|
20
|
-
Requires-Dist: pytest==
|
|
18
|
+
Requires-Dist: black==24.1.1; extra == "test"
|
|
19
|
+
Requires-Dist: pylint==3.0.3; extra == "test"
|
|
20
|
+
Requires-Dist: pytest==8.0.0; extra == "test"
|
|
21
21
|
Requires-Dist: pytest-cov==4.1.0; extra == "test"
|
|
22
22
|
Requires-Dist: requests-mock==1.11.0; extra == "test"
|
|
23
23
|
Requires-Dist: pytest-mock==3.12.0; extra == "test"
|
|
@@ -97,7 +97,7 @@ cdsetool download Sentinel2 PATH/TO/DIR --concurrency 4 --search-term startDate=
|
|
|
97
97
|
Install `cdsetool` using pip:
|
|
98
98
|
|
|
99
99
|
```bash
|
|
100
|
-
pip install cdsetool==0.2.
|
|
100
|
+
pip install cdsetool==0.2.4
|
|
101
101
|
```
|
|
102
102
|
|
|
103
103
|
## Usage
|
|
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
|
|
|
4
4
|
|
|
5
5
|
[project]
|
|
6
6
|
name = "cdsetool"
|
|
7
|
-
version = "0.2.
|
|
7
|
+
version = "0.2.4"
|
|
8
8
|
authors = [
|
|
9
9
|
{ name="Jacob Vejby", email="javej@sdfi.dk" },
|
|
10
10
|
]
|
|
@@ -23,9 +23,9 @@ dependencies = [
|
|
|
23
23
|
]
|
|
24
24
|
[project.optional-dependencies]
|
|
25
25
|
test = [
|
|
26
|
-
"black==
|
|
27
|
-
"pylint==3.0.
|
|
28
|
-
"pytest==
|
|
26
|
+
"black==24.1.1",
|
|
27
|
+
"pylint==3.0.3",
|
|
28
|
+
"pytest==8.0.0",
|
|
29
29
|
"pytest-cov==4.1.0",
|
|
30
30
|
"requests-mock==1.11.0",
|
|
31
31
|
"pytest-mock==3.12.0",
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
"""
|
|
2
2
|
Command line interface
|
|
3
3
|
"""
|
|
4
|
+
|
|
4
5
|
import os
|
|
5
6
|
import sys
|
|
6
7
|
import json as JSON
|
|
@@ -76,6 +77,9 @@ def download(
|
|
|
76
77
|
concurrency: Annotated[
|
|
77
78
|
int, typer.Option(help="Number of concurrent connections")
|
|
78
79
|
] = 1,
|
|
80
|
+
overwrite_existing: Annotated[
|
|
81
|
+
bool, typer.Option(help="Overwrite already downloaded files")
|
|
82
|
+
] = False,
|
|
79
83
|
search_term: Annotated[
|
|
80
84
|
Optional[List[str]],
|
|
81
85
|
typer.Option(
|
|
@@ -97,7 +101,13 @@ def download(
|
|
|
97
101
|
|
|
98
102
|
list(
|
|
99
103
|
download_features(
|
|
100
|
-
features,
|
|
104
|
+
features,
|
|
105
|
+
path,
|
|
106
|
+
{
|
|
107
|
+
"monitor": StatusMonitor(),
|
|
108
|
+
"concurrency": concurrency,
|
|
109
|
+
"overwrite_existing": overwrite_existing,
|
|
110
|
+
},
|
|
101
111
|
)
|
|
102
112
|
)
|
|
103
113
|
|
|
@@ -4,6 +4,7 @@ Download features from a Copernicus Data Space Ecosystem OpenSearch API result
|
|
|
4
4
|
Provides a function to download a single feature, and a function to download
|
|
5
5
|
all features in a result set.
|
|
6
6
|
"""
|
|
7
|
+
|
|
7
8
|
import os
|
|
8
9
|
import random
|
|
9
10
|
import tempfile
|
|
@@ -27,8 +28,12 @@ def download_feature(feature, path, options=None):
|
|
|
27
28
|
if not url or not filename:
|
|
28
29
|
return feature.get("id")
|
|
29
30
|
|
|
30
|
-
|
|
31
|
-
|
|
31
|
+
overwrite = options.get("overwrite_existing", False)
|
|
32
|
+
|
|
33
|
+
result_path = os.path.join(path, filename.replace(".SAFE", ".zip"))
|
|
34
|
+
|
|
35
|
+
if not overwrite and os.path.exists(result_path):
|
|
36
|
+
return feature.get("id")
|
|
32
37
|
|
|
33
38
|
with _get_monitor(options).status() as status:
|
|
34
39
|
status.set_filename(filename)
|
|
@@ -51,7 +56,7 @@ def download_feature(feature, path, options=None):
|
|
|
51
56
|
status.add_progress(len(chunk))
|
|
52
57
|
|
|
53
58
|
os.close(fd)
|
|
54
|
-
shutil.move(tmp,
|
|
59
|
+
shutil.move(tmp, result_path)
|
|
55
60
|
|
|
56
61
|
return feature.get("id")
|
|
57
62
|
|
|
@@ -3,6 +3,7 @@ Query the Copernicus Data Space Ecosystem OpenSearch API
|
|
|
3
3
|
|
|
4
4
|
https://documentation.dataspace.copernicus.eu/APIs/OpenSearch.html
|
|
5
5
|
"""
|
|
6
|
+
|
|
6
7
|
from xml.etree import ElementTree
|
|
7
8
|
from datetime import datetime, date
|
|
8
9
|
import re
|
|
@@ -114,6 +115,8 @@ def geojson_to_wkt(geojson):
|
|
|
114
115
|
|
|
115
116
|
if geojson.get("type") == "Feature":
|
|
116
117
|
geojson = geojson["geometry"]
|
|
118
|
+
elif geojson.get("type") == "FeatureCollection" and len(geojson["features"]) == 1:
|
|
119
|
+
geojson = geojson["features"][0]["geometry"]
|
|
117
120
|
|
|
118
121
|
coordinates = str(
|
|
119
122
|
tuple(item for sublist in geojson["coordinates"][0] for item in sublist)
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.1
|
|
2
2
|
Name: cdsetool
|
|
3
|
-
Version: 0.2.
|
|
3
|
+
Version: 0.2.4
|
|
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/SDFIdk/CDSETool
|
|
@@ -15,9 +15,9 @@ Requires-Dist: rich<13.8,>=13.6
|
|
|
15
15
|
Requires-Dist: requests<2.32.0,>=2.28.1
|
|
16
16
|
Requires-Dist: pyjwt[crypto]~=2.8.0
|
|
17
17
|
Provides-Extra: test
|
|
18
|
-
Requires-Dist: black==
|
|
19
|
-
Requires-Dist: pylint==3.0.
|
|
20
|
-
Requires-Dist: pytest==
|
|
18
|
+
Requires-Dist: black==24.1.1; extra == "test"
|
|
19
|
+
Requires-Dist: pylint==3.0.3; extra == "test"
|
|
20
|
+
Requires-Dist: pytest==8.0.0; extra == "test"
|
|
21
21
|
Requires-Dist: pytest-cov==4.1.0; extra == "test"
|
|
22
22
|
Requires-Dist: requests-mock==1.11.0; extra == "test"
|
|
23
23
|
Requires-Dist: pytest-mock==3.12.0; extra == "test"
|
|
@@ -97,7 +97,7 @@ cdsetool download Sentinel2 PATH/TO/DIR --concurrency 4 --search-term startDate=
|
|
|
97
97
|
Install `cdsetool` using pip:
|
|
98
98
|
|
|
99
99
|
```bash
|
|
100
|
-
pip install cdsetool==0.2.
|
|
100
|
+
pip install cdsetool==0.2.4
|
|
101
101
|
```
|
|
102
102
|
|
|
103
103
|
## Usage
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|