cloudnet-api-client 0.1.1__tar.gz → 0.1.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,10 @@ 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.1.2 – 2025-03-27
9
+
10
+ - Add method to fetch instruments
11
+
8
12
  ## 0.1.1 – 2025-03-27
9
13
 
10
14
  - Add `updated_at_from` and `updated_at_to` parameters
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: cloudnet-api-client
3
- Version: 0.1.1
3
+ Version: 0.1.2
4
4
  Summary: Cloudnet API client
5
5
  Author-email: Simo Tukiainen <simo.tukiainen@fmi.fi>
6
6
  License-File: LICENSE
@@ -127,6 +127,10 @@ Parameters:
127
127
  | ---- | ---------------- | ----------------------------------------- | ------- |
128
128
  | type | `str` or `[str]` | "instrument", "geophysical", "evaluation" | `None` |
129
129
 
130
+ ### `APIClient().instruments()` &rarr; `[Instrument]`
131
+
132
+ Fetch cloudnet instruments.
133
+
130
134
  ### `cloudnet_api_client.download([Metadata])`
131
135
 
132
136
  Download files from the fetched metadata.
@@ -102,6 +102,10 @@ Parameters:
102
102
  | ---- | ---------------- | ----------------------------------------- | ------- |
103
103
  | type | `str` or `[str]` | "instrument", "geophysical", "evaluation" | `None` |
104
104
 
105
+ ### `APIClient().instruments()` &rarr; `[Instrument]`
106
+
107
+ Fetch cloudnet instruments.
108
+
105
109
  ### `cloudnet_api_client.download([Metadata])`
106
110
 
107
111
  Download files from the fetched metadata.
@@ -50,6 +50,22 @@ class APIClient:
50
50
  data = [obj for obj in data if any(t in obj.type for t in type)]
51
51
  return data
52
52
 
53
+ def instruments(self) -> list[Instrument]:
54
+ res = self._get_response("instrument-pids")
55
+ return [
56
+ Instrument(
57
+ instrument_id=obj["instrument"]["id"],
58
+ model=obj["model"],
59
+ type=obj["type"],
60
+ uuid=obj["uuid"],
61
+ pid=obj["pid"],
62
+ owners=obj["owners"],
63
+ serial_number=obj["serialNumber"],
64
+ name=obj["name"],
65
+ )
66
+ for obj in res
67
+ ]
68
+
53
69
  def metadata(
54
70
  self,
55
71
  site_id: str,
@@ -0,0 +1 @@
1
+ __version__ = "0.1.2"
@@ -1 +0,0 @@
1
- __version__ = "0.1.1"