cloudnet-api-client 0.11.0__tar.gz → 0.12.1__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.
- {cloudnet_api_client-0.11.0 → cloudnet_api_client-0.12.1}/CHANGELOG.md +8 -0
- {cloudnet_api_client-0.11.0 → cloudnet_api_client-0.12.1}/PKG-INFO +77 -23
- {cloudnet_api_client-0.11.0 → cloudnet_api_client-0.12.1}/README.md +76 -22
- cloudnet_api_client-0.12.1/cloudnet_api_client/__init__.py +2 -0
- {cloudnet_api_client-0.11.0 → cloudnet_api_client-0.12.1}/cloudnet_api_client/client.py +237 -117
- {cloudnet_api_client-0.11.0 → cloudnet_api_client-0.12.1}/cloudnet_api_client/containers.py +25 -6
- {cloudnet_api_client-0.11.0 → cloudnet_api_client-0.12.1}/cloudnet_api_client/utils.py +6 -0
- cloudnet_api_client-0.12.1/cloudnet_api_client/version.py +1 -0
- cloudnet_api_client-0.12.1/tests/data/20250821_limassol_parsivel_41582c49.nc +0 -0
- cloudnet_api_client-0.12.1/tests/data/20250822_leipzig-lim_ecmwf-open.nc +0 -0
- {cloudnet_api_client-0.11.0 → cloudnet_api_client-0.12.1}/tests/test_client.py +230 -89
- cloudnet_api_client-0.11.0/cloudnet_api_client/__init__.py +0 -1
- cloudnet_api_client-0.11.0/cloudnet_api_client/version.py +0 -1
- {cloudnet_api_client-0.11.0 → cloudnet_api_client-0.12.1}/.github/dataportal.env +0 -0
- {cloudnet_api_client-0.11.0 → cloudnet_api_client-0.12.1}/.github/db.env +0 -0
- {cloudnet_api_client-0.11.0 → cloudnet_api_client-0.12.1}/.github/docker-compose.yml +0 -0
- {cloudnet_api_client-0.11.0 → cloudnet_api_client-0.12.1}/.github/initdb.d/init-dbs.sh +0 -0
- {cloudnet_api_client-0.11.0 → cloudnet_api_client-0.12.1}/.github/ss.env +0 -0
- {cloudnet_api_client-0.11.0 → cloudnet_api_client-0.12.1}/.github/workflows/publish.yml +0 -0
- {cloudnet_api_client-0.11.0 → cloudnet_api_client-0.12.1}/.github/workflows/test.yml +0 -0
- {cloudnet_api_client-0.11.0 → cloudnet_api_client-0.12.1}/.gitignore +0 -0
- {cloudnet_api_client-0.11.0 → cloudnet_api_client-0.12.1}/.pre-commit-config.yaml +0 -0
- {cloudnet_api_client-0.11.0 → cloudnet_api_client-0.12.1}/LICENSE +0 -0
- {cloudnet_api_client-0.11.0 → cloudnet_api_client-0.12.1}/cloudnet_api_client/dl.py +0 -0
- {cloudnet_api_client-0.11.0 → cloudnet_api_client-0.12.1}/cloudnet_api_client/py.typed +0 -0
- {cloudnet_api_client-0.11.0 → cloudnet_api_client-0.12.1}/pyproject.toml +0 -0
- {cloudnet_api_client-0.11.0 → cloudnet_api_client-0.12.1}/tests/data/20140205_hyytiala_classification.nc +0 -0
- {cloudnet_api_client-0.11.0 → cloudnet_api_client-0.12.1}/tests/data/20250801_Magurele_CHM170137_000.nc +0 -0
- {cloudnet_api_client-0.11.0 → cloudnet_api_client-0.12.1}/tests/data/20250803_JOYCE_WST_01m.dat +0 -0
- {cloudnet_api_client-0.11.0 → cloudnet_api_client-0.12.1}/tests/data/20250808_Granada_CHM170119_0045_000.nc +0 -0
- {cloudnet_api_client-0.11.0 → cloudnet_api_client-0.12.1}/tests/data/20250808_hyytiala_iwc-Z-T-method.nc +0 -0
- {cloudnet_api_client-0.11.0 → cloudnet_api_client-0.12.1}/tests/data/20250814_bucharest_classification.nc +0 -0
|
@@ -5,6 +5,14 @@ All notable changes to this project will be documented in this file.
|
|
|
5
5
|
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
|
|
6
6
|
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
|
7
7
|
|
|
8
|
+
## 0.12.1 – 2025-08-25
|
|
9
|
+
|
|
10
|
+
- Fix tag subset filters
|
|
11
|
+
|
|
12
|
+
## 0.12.0 – 2025-08-25
|
|
13
|
+
|
|
14
|
+
- Adjust routes and responses
|
|
15
|
+
|
|
8
16
|
## 0.11.0 – 2025-08-16
|
|
9
17
|
|
|
10
18
|
- Adjust routes and responses
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: cloudnet-api-client
|
|
3
|
-
Version: 0.
|
|
3
|
+
Version: 0.12.1
|
|
4
4
|
Summary: Cloudnet API client
|
|
5
5
|
Author-email: Simo Tukiainen <simo.tukiainen@fmi.fi>
|
|
6
6
|
License-File: LICENSE
|
|
@@ -47,14 +47,25 @@ from cloudnet_api_client import APIClient
|
|
|
47
47
|
|
|
48
48
|
client = APIClient()
|
|
49
49
|
|
|
50
|
-
sites = client.sites(
|
|
50
|
+
sites = client.sites()
|
|
51
|
+
site = client.site("hyytiala")
|
|
52
|
+
|
|
51
53
|
products = client.products()
|
|
54
|
+
product = client.products("classification")
|
|
55
|
+
|
|
56
|
+
models = client.models()
|
|
57
|
+
model = client.model("ecmwf-open")
|
|
58
|
+
|
|
59
|
+
instruments = client.instruments()
|
|
60
|
+
instrument = client.instrument("d6bf209b-c48b-48a4-bbfb-fed713b27832")
|
|
52
61
|
|
|
53
|
-
|
|
54
|
-
file_paths = client.download(metadata, "data/")
|
|
62
|
+
file = client.file("405cc410-1f24-4ea9-bae8-da7f22be26cb")
|
|
55
63
|
|
|
56
|
-
|
|
57
|
-
file_paths = client.download(
|
|
64
|
+
files = client.files(site_id="hyytiala", date="2021-01-01", product_id=["mwr", "radar"])
|
|
65
|
+
file_paths = client.download(files, "data/")
|
|
66
|
+
|
|
67
|
+
raw_files = client.raw_files(site_id="granada", date="2024-01", instrument_id="parsivel")
|
|
68
|
+
file_paths = client.download(raw_files, "data_raw/")
|
|
58
69
|
```
|
|
59
70
|
|
|
60
71
|
When downloading files inside Jupyter notebook (or similar environment), you have to use the asynchronous version:
|
|
@@ -65,7 +76,7 @@ file_paths = await client.adownload(metadata)
|
|
|
65
76
|
|
|
66
77
|
## Documentation
|
|
67
78
|
|
|
68
|
-
### `APIClient().
|
|
79
|
+
### `APIClient().files()` and `raw_files()` → `list[Metadata]`
|
|
69
80
|
|
|
70
81
|
Fetch product and raw file metadata from the Cloudnet data portal.
|
|
71
82
|
|
|
@@ -83,15 +94,15 @@ Parameters:
|
|
|
83
94
|
| instrument_id | `str` or `list[str]` | `None` | "rpg-fmcw-94" |
|
|
84
95
|
| instrument_pid | `str` or `list[str]` | `None` | "https://hdl.handle.net/21.12132/3.191564170f8a4686" |
|
|
85
96
|
| model_id | `str` or `list[str]` | `None` | "gdas1" |
|
|
86
|
-
|
|
|
97
|
+
| product_id\* | `str` or `list[str]` | `None` | "classification" |
|
|
87
98
|
| show_legacy\* | `bool` | `False` | |
|
|
88
99
|
| filename_prefix\*\* | `str` or `list[str]` | `None` | "stare" |
|
|
89
100
|
| filename_suffix\*\* | `str` or `list[str]` | `None` | ".lv1" |
|
|
90
101
|
| status\*\* | `str` or `list[str]` | `None` | "created", "uploaded", "processed" or "invalid" |
|
|
91
102
|
|
|
92
|
-
\* = only in `
|
|
103
|
+
\* = only in `files()`
|
|
93
104
|
|
|
94
|
-
\*\* = only in `
|
|
105
|
+
\*\* = only in `raw_files()`
|
|
95
106
|
|
|
96
107
|
**Date Handling**
|
|
97
108
|
|
|
@@ -140,30 +151,29 @@ Parameters:
|
|
|
140
151
|
| ---- | -------------------- |
|
|
141
152
|
| uuid | `str` or `uuid.UUID` |
|
|
142
153
|
|
|
143
|
-
### `APIClient().
|
|
154
|
+
### `APIClient().sites()` → `list[Site]`
|
|
144
155
|
|
|
145
|
-
Fetch
|
|
156
|
+
Fetch all sites.
|
|
146
157
|
|
|
147
158
|
Parameters:
|
|
148
159
|
|
|
149
|
-
| name | type
|
|
150
|
-
| ---- |
|
|
151
|
-
|
|
|
160
|
+
| name | type | choices | default |
|
|
161
|
+
| ---- | ----- | ----------------------------------------- | ------- |
|
|
162
|
+
| type | `str` | "cloudnet", "campaign", "model", "hidden" | `None` |
|
|
152
163
|
|
|
153
|
-
### `APIClient().
|
|
164
|
+
### `APIClient().site()` → `Site`
|
|
154
165
|
|
|
155
|
-
Fetch
|
|
166
|
+
Fetch a single site.
|
|
156
167
|
|
|
157
168
|
Parameters:
|
|
158
169
|
|
|
159
|
-
| name | type
|
|
160
|
-
| ------- |
|
|
161
|
-
| site_id | `str`
|
|
162
|
-
| type | `str` or `list[str]` | "cloudnet", "campaign", "model", "hidden" | `None` |
|
|
170
|
+
| name | type |
|
|
171
|
+
| ------- | ----- |
|
|
172
|
+
| site_id | `str` |
|
|
163
173
|
|
|
164
174
|
### `APIClient().products()` → `list[Product]`
|
|
165
175
|
|
|
166
|
-
Fetch
|
|
176
|
+
Fetch all products.
|
|
167
177
|
|
|
168
178
|
Parameters:
|
|
169
179
|
|
|
@@ -171,9 +181,53 @@ Parameters:
|
|
|
171
181
|
| ---- | -------------------- | ----------------------------------------- | ------- |
|
|
172
182
|
| type | `str` or `list[str]` | "instrument", "geophysical", "evaluation" | `None` |
|
|
173
183
|
|
|
184
|
+
### `APIClient().product()` → `ExtendedProduct`
|
|
185
|
+
|
|
186
|
+
Fetch a single product.
|
|
187
|
+
|
|
188
|
+
Parameters:
|
|
189
|
+
|
|
190
|
+
| name | type |
|
|
191
|
+
| ---------- | ----- |
|
|
192
|
+
| product_id | `str` |
|
|
193
|
+
|
|
174
194
|
### `APIClient().instruments()` → `list[Instrument]`
|
|
175
195
|
|
|
176
|
-
Fetch
|
|
196
|
+
Fetch all instruments.
|
|
197
|
+
|
|
198
|
+
### `APIClient().instrument()` → `ExtendedInstrument`
|
|
199
|
+
|
|
200
|
+
Fetch a single instruments.
|
|
201
|
+
|
|
202
|
+
Parameters:
|
|
203
|
+
|
|
204
|
+
| name | type |
|
|
205
|
+
| ---- | ----- |
|
|
206
|
+
| uuid | `str` |
|
|
207
|
+
|
|
208
|
+
### `APIClient().models()` → `list[Model]`
|
|
209
|
+
|
|
210
|
+
Fetch all models.
|
|
211
|
+
|
|
212
|
+
### `APIClient().instrument()` → `Model`
|
|
213
|
+
|
|
214
|
+
Fetch a single model.
|
|
215
|
+
|
|
216
|
+
Parameters:
|
|
217
|
+
|
|
218
|
+
| name | type |
|
|
219
|
+
| -------- | ----- |
|
|
220
|
+
| model_id | `str` |
|
|
221
|
+
|
|
222
|
+
### `APIClient().versions()` → `list[VersionMetadata]`
|
|
223
|
+
|
|
224
|
+
Fetch information of all versions of a file.
|
|
225
|
+
|
|
226
|
+
Parameters:
|
|
227
|
+
|
|
228
|
+
| name | type |
|
|
229
|
+
| ---- | -------------------- |
|
|
230
|
+
| uuid | `str` or `uuid.UUID` |
|
|
177
231
|
|
|
178
232
|
### `APIClient().download(list[Metadata])` → `list[Path]`
|
|
179
233
|
|
|
@@ -18,14 +18,25 @@ from cloudnet_api_client import APIClient
|
|
|
18
18
|
|
|
19
19
|
client = APIClient()
|
|
20
20
|
|
|
21
|
-
sites = client.sites(
|
|
21
|
+
sites = client.sites()
|
|
22
|
+
site = client.site("hyytiala")
|
|
23
|
+
|
|
22
24
|
products = client.products()
|
|
25
|
+
product = client.products("classification")
|
|
26
|
+
|
|
27
|
+
models = client.models()
|
|
28
|
+
model = client.model("ecmwf-open")
|
|
29
|
+
|
|
30
|
+
instruments = client.instruments()
|
|
31
|
+
instrument = client.instrument("d6bf209b-c48b-48a4-bbfb-fed713b27832")
|
|
23
32
|
|
|
24
|
-
|
|
25
|
-
file_paths = client.download(metadata, "data/")
|
|
33
|
+
file = client.file("405cc410-1f24-4ea9-bae8-da7f22be26cb")
|
|
26
34
|
|
|
27
|
-
|
|
28
|
-
file_paths = client.download(
|
|
35
|
+
files = client.files(site_id="hyytiala", date="2021-01-01", product_id=["mwr", "radar"])
|
|
36
|
+
file_paths = client.download(files, "data/")
|
|
37
|
+
|
|
38
|
+
raw_files = client.raw_files(site_id="granada", date="2024-01", instrument_id="parsivel")
|
|
39
|
+
file_paths = client.download(raw_files, "data_raw/")
|
|
29
40
|
```
|
|
30
41
|
|
|
31
42
|
When downloading files inside Jupyter notebook (or similar environment), you have to use the asynchronous version:
|
|
@@ -36,7 +47,7 @@ file_paths = await client.adownload(metadata)
|
|
|
36
47
|
|
|
37
48
|
## Documentation
|
|
38
49
|
|
|
39
|
-
### `APIClient().
|
|
50
|
+
### `APIClient().files()` and `raw_files()` → `list[Metadata]`
|
|
40
51
|
|
|
41
52
|
Fetch product and raw file metadata from the Cloudnet data portal.
|
|
42
53
|
|
|
@@ -54,15 +65,15 @@ Parameters:
|
|
|
54
65
|
| instrument_id | `str` or `list[str]` | `None` | "rpg-fmcw-94" |
|
|
55
66
|
| instrument_pid | `str` or `list[str]` | `None` | "https://hdl.handle.net/21.12132/3.191564170f8a4686" |
|
|
56
67
|
| model_id | `str` or `list[str]` | `None` | "gdas1" |
|
|
57
|
-
|
|
|
68
|
+
| product_id\* | `str` or `list[str]` | `None` | "classification" |
|
|
58
69
|
| show_legacy\* | `bool` | `False` | |
|
|
59
70
|
| filename_prefix\*\* | `str` or `list[str]` | `None` | "stare" |
|
|
60
71
|
| filename_suffix\*\* | `str` or `list[str]` | `None` | ".lv1" |
|
|
61
72
|
| status\*\* | `str` or `list[str]` | `None` | "created", "uploaded", "processed" or "invalid" |
|
|
62
73
|
|
|
63
|
-
\* = only in `
|
|
74
|
+
\* = only in `files()`
|
|
64
75
|
|
|
65
|
-
\*\* = only in `
|
|
76
|
+
\*\* = only in `raw_files()`
|
|
66
77
|
|
|
67
78
|
**Date Handling**
|
|
68
79
|
|
|
@@ -111,30 +122,29 @@ Parameters:
|
|
|
111
122
|
| ---- | -------------------- |
|
|
112
123
|
| uuid | `str` or `uuid.UUID` |
|
|
113
124
|
|
|
114
|
-
### `APIClient().
|
|
125
|
+
### `APIClient().sites()` → `list[Site]`
|
|
115
126
|
|
|
116
|
-
Fetch
|
|
127
|
+
Fetch all sites.
|
|
117
128
|
|
|
118
129
|
Parameters:
|
|
119
130
|
|
|
120
|
-
| name | type
|
|
121
|
-
| ---- |
|
|
122
|
-
|
|
|
131
|
+
| name | type | choices | default |
|
|
132
|
+
| ---- | ----- | ----------------------------------------- | ------- |
|
|
133
|
+
| type | `str` | "cloudnet", "campaign", "model", "hidden" | `None` |
|
|
123
134
|
|
|
124
|
-
### `APIClient().
|
|
135
|
+
### `APIClient().site()` → `Site`
|
|
125
136
|
|
|
126
|
-
Fetch
|
|
137
|
+
Fetch a single site.
|
|
127
138
|
|
|
128
139
|
Parameters:
|
|
129
140
|
|
|
130
|
-
| name | type
|
|
131
|
-
| ------- |
|
|
132
|
-
| site_id | `str`
|
|
133
|
-
| type | `str` or `list[str]` | "cloudnet", "campaign", "model", "hidden" | `None` |
|
|
141
|
+
| name | type |
|
|
142
|
+
| ------- | ----- |
|
|
143
|
+
| site_id | `str` |
|
|
134
144
|
|
|
135
145
|
### `APIClient().products()` → `list[Product]`
|
|
136
146
|
|
|
137
|
-
Fetch
|
|
147
|
+
Fetch all products.
|
|
138
148
|
|
|
139
149
|
Parameters:
|
|
140
150
|
|
|
@@ -142,9 +152,53 @@ Parameters:
|
|
|
142
152
|
| ---- | -------------------- | ----------------------------------------- | ------- |
|
|
143
153
|
| type | `str` or `list[str]` | "instrument", "geophysical", "evaluation" | `None` |
|
|
144
154
|
|
|
155
|
+
### `APIClient().product()` → `ExtendedProduct`
|
|
156
|
+
|
|
157
|
+
Fetch a single product.
|
|
158
|
+
|
|
159
|
+
Parameters:
|
|
160
|
+
|
|
161
|
+
| name | type |
|
|
162
|
+
| ---------- | ----- |
|
|
163
|
+
| product_id | `str` |
|
|
164
|
+
|
|
145
165
|
### `APIClient().instruments()` → `list[Instrument]`
|
|
146
166
|
|
|
147
|
-
Fetch
|
|
167
|
+
Fetch all instruments.
|
|
168
|
+
|
|
169
|
+
### `APIClient().instrument()` → `ExtendedInstrument`
|
|
170
|
+
|
|
171
|
+
Fetch a single instruments.
|
|
172
|
+
|
|
173
|
+
Parameters:
|
|
174
|
+
|
|
175
|
+
| name | type |
|
|
176
|
+
| ---- | ----- |
|
|
177
|
+
| uuid | `str` |
|
|
178
|
+
|
|
179
|
+
### `APIClient().models()` → `list[Model]`
|
|
180
|
+
|
|
181
|
+
Fetch all models.
|
|
182
|
+
|
|
183
|
+
### `APIClient().instrument()` → `Model`
|
|
184
|
+
|
|
185
|
+
Fetch a single model.
|
|
186
|
+
|
|
187
|
+
Parameters:
|
|
188
|
+
|
|
189
|
+
| name | type |
|
|
190
|
+
| -------- | ----- |
|
|
191
|
+
| model_id | `str` |
|
|
192
|
+
|
|
193
|
+
### `APIClient().versions()` → `list[VersionMetadata]`
|
|
194
|
+
|
|
195
|
+
Fetch information of all versions of a file.
|
|
196
|
+
|
|
197
|
+
Parameters:
|
|
198
|
+
|
|
199
|
+
| name | type |
|
|
200
|
+
| ---- | -------------------- |
|
|
201
|
+
| uuid | `str` or `uuid.UUID` |
|
|
148
202
|
|
|
149
203
|
### `APIClient().download(list[Metadata])` → `list[Path]`
|
|
150
204
|
|