cloudnet-api-client 0.9.0__tar.gz → 0.9.2__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.
@@ -5,6 +5,15 @@ 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.9.2 – 2025-08-04
9
+
10
+ - Use updated Cloudnet API
11
+
12
+ ## 0.9.1 – 2025-06-19
13
+
14
+ - Support mobile sites without latitude and longitude
15
+ - Fix metadata fetching when `instrument_pid` defined
16
+
8
17
  ## 0.9.0 – 2025-05-14
9
18
 
10
19
  - By default download to current folder
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: cloudnet-api-client
3
- Version: 0.9.0
3
+ Version: 0.9.2
4
4
  Summary: Cloudnet API client
5
5
  Author-email: Simo Tukiainen <simo.tukiainen@fmi.fi>
6
6
  License-File: LICENSE
@@ -111,17 +111,18 @@ class APIClient:
111
111
 
112
112
  _check_params(params, ("showLegacy",))
113
113
 
114
- no_instrument = not instrument_id or instrument_pid
115
- if no_instrument and (not product and model_id):
114
+ no_instrument = instrument_id is None and instrument_pid is None
115
+
116
+ if no_instrument and (product is None and model_id is not None):
116
117
  files_res = []
117
118
  else:
118
119
  files_res = self._get_response("files", params)
119
120
 
120
121
  # Add model files if requested
121
122
  if (
122
- (not product and no_instrument)
123
- or (product and "model" in product)
124
- or (model_id and (not product or "model" in product))
123
+ (product is None and no_instrument)
124
+ or (product is not None and "model" in product)
125
+ or (model_id is not None and (product is None or "model" in product))
125
126
  ):
126
127
  for key in ("showLegacy", "product", "instrument", "instrumentPid"):
127
128
  del params[key]
@@ -431,7 +432,7 @@ def _build_raw_meta_objects(res: list[dict]) -> list[RawMetadata]:
431
432
  return [
432
433
  RawMetadata(
433
434
  **{_to_snake(k): v for k, v in obj.items() if _to_snake(k) in field_names},
434
- instrument=_create_instrument_object(obj["instrumentInfo"]),
435
+ instrument=_create_instrument_object(obj["instrument"]),
435
436
  measurement_date=datetime.date.fromisoformat(obj["measurementDate"]),
436
437
  created_at=_parse_datetime(obj["createdAt"]),
437
438
  updated_at=_parse_datetime(obj["updatedAt"]),
@@ -482,9 +483,9 @@ def _create_site_object(metadata: dict) -> Site:
482
483
  id=metadata["id"],
483
484
  human_readable_name=metadata["humanReadableName"],
484
485
  station_name=metadata["stationName"],
485
- latitude=float(metadata["latitude"]),
486
- longitude=float(metadata["longitude"]),
487
- altitude=float(metadata["altitude"]),
486
+ latitude=metadata["latitude"],
487
+ longitude=metadata["longitude"],
488
+ altitude=metadata["altitude"],
488
489
  dvas_id=metadata["dvasId"],
489
490
  actris_id=metadata["actrisId"],
490
491
  country=metadata["country"],
@@ -13,9 +13,9 @@ class Site:
13
13
  id: str
14
14
  human_readable_name: str
15
15
  station_name: str | None
16
- latitude: float
17
- longitude: float
18
- altitude: float
16
+ latitude: float | None
17
+ longitude: float | None
18
+ altitude: int
19
19
  dvas_id: str | None
20
20
  actris_id: int | None
21
21
  country: str
@@ -0,0 +1 @@
1
+ __version__ = "0.9.2"
@@ -1 +0,0 @@
1
- __version__ = "0.9.0"