Cloudnet API client
Project description
Cloudnet API client
Official Python client for the Cloudnet data portal API.
Installation
python3 -m pip install cloudnet-api-client
Quickstart
import cloudnet_api_client as cac
client = cac.APIClient()
sites = client.sites(type="cloudnet")
products = client.products()
metadata = client.metadata("hyytiala", "2021-01-01", product=["mwr", "radar"])
client.download(metadata, "data/")
raw_metadata = client.raw_metadata("granada", date="2024-01", instrument_id="parsivel")
client.download(raw_metadata, "data_raw/")
Documentation
APIClient().metadata() and raw_metadata() → list[Metadata]
Fetch product and raw file metadata from the Cloudnet data portal.
Parameters:
| name | type | default | example |
|---|---|---|---|
| site_id | str |
"hyytiala" | |
| date | str or date |
None |
"2024-01-01" |
| date_from | str or date |
None |
"2025-01-01" |
| date_to | str or date |
None |
"2025-01-01" |
| updated_at | str, date or datetime |
None |
"2025-01-01T12:00:00" |
| updated_at_from | str, date or datetime |
None |
"2025-01-01T12:00:00" |
| updated_at_to | str, date or datetime |
None |
"2025-01-01T12:00:00" |
| instrument_id | str or list[str] |
None |
"rpg-fmcw-94" |
| instrument_pid | str or list[str] |
None |
"https://hdl.handle.net/21.12132/3.191564170f8a4686" |
| product* | str or list[str] |
None |
"classification" |
| show_legacy* | bool |
False |
|
| filename_prefix** | str or list[str] |
None |
"stare" |
| filename_suffix** | str or list[str] |
None |
".lv1" |
| status** | str or list[str] |
None |
"created", "uploaded", "processed" or "invalid" |
* = only in metadata()
** = only in raw_metadata()
Date Handling
The date, date_from and date_to parameters support:
- "YYYY-MM-DD" — a specific date
- "YYYY-MM" — the entire month
- "YYYY" — the entire year
- Or directly as
datetime.dateobject
In addition to these, the updated_at, updated_at_from and updated_at_to parameters support:
- "YYYY-MM-DDTHH" — a specific hour
- "YYYY-MM-DDTHH:MM" — a specific minute
- "YYYY-MM-DDTHH:MM:SS" — a specific second
- "YYYY-MM-DDTHH:MM:SS.FFFFFF" — a specific microsecond
- Or directly as
datetime.datetimeobject
Return value
Both methods return a list of dataclass instances, ProductMetadata and RawMetadata, respectively.
APIClient().filter(list[Metadata]) → list[Metadata]
Additional filtering of fetched metadata.
Parameters:
| name | type | default |
|---|---|---|
| metadata | list[RawMetadata] or list[ProductMetadata] |
|
| include_pattern | str |
None |
| exclude_pattern | str |
None |
| include_tag_subset* | set[str] |
None |
| exclude_tag_subset* | set[str] |
None |
* = only with RawMetadata
APIClient().sites() → list[Site]
Fetch cloudnet sites.
Parameters:
| name | type | Choices | default |
|---|---|---|---|
| type | str or list[str] |
"cloudnet", "campaign", "model", "hidden" | None |
APIClient().products() → list[Product]
Fetch cloudnet products.
Parameters:
| name | type | Choices | default |
|---|---|---|---|
| type | str or list[str] |
"instrument", "geophysical", "evaluation" | None |
APIClient().instruments() → list[Instrument]
Fetch cloudnet instruments.
APIClient().download(list[Metadata]) → list[Path]
Download files from the fetched metadata.
Parameters:
| name | type | default |
|---|---|---|
| metadata | list[RawMetadata] or list[ProductMetadata] |
|
| output_directory | PathLike or str |
|
| concurrency_limit | int |
5 |
| progress | bool or None |
None |
There's also an asynchronous version of this function:
cloudnet_api_client.adownload. It's useful for usage inside Jupyter notebook.
License
MIT
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file cloudnet_api_client-0.4.1.tar.gz.
File metadata
- Download URL: cloudnet_api_client-0.4.1.tar.gz
- Upload date:
- Size: 9.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.12.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
154830ab68a73fef3c0b07bbbfe166e1185d227f72da8145046c377208ca16a9
|
|
| MD5 |
6fb87ac06b2d087cf717025f2f916129
|
|
| BLAKE2b-256 |
74f41db22bc51144e839b676f4f05fd8c54a77ef57daab7904c7d12d0725d978
|
Provenance
The following attestation bundles were made for cloudnet_api_client-0.4.1.tar.gz:
Publisher:
publish.yml on actris-cloudnet/cloudnet-api-client
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
cloudnet_api_client-0.4.1.tar.gz -
Subject digest:
154830ab68a73fef3c0b07bbbfe166e1185d227f72da8145046c377208ca16a9 - Sigstore transparency entry: 191917012
- Sigstore integration time:
-
Permalink:
actris-cloudnet/cloudnet-api-client@17704b736560ca63dd250500fbed96b374aca387 -
Branch / Tag:
refs/tags/v0.4.1 - Owner: https://github.com/actris-cloudnet
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@17704b736560ca63dd250500fbed96b374aca387 -
Trigger Event:
push
-
Statement type:
File details
Details for the file cloudnet_api_client-0.4.1-py3-none-any.whl.
File metadata
- Download URL: cloudnet_api_client-0.4.1-py3-none-any.whl
- Upload date:
- Size: 10.1 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.12.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
3afc5162277915f4bf5caf638a44a263c82897535c97b90d70cea6e51dafbac8
|
|
| MD5 |
2b719547c657ece08a390ea58b119239
|
|
| BLAKE2b-256 |
0b09e6ceb11c5905cb221b522930a83460d49d1972b2786e53890db599d9bee0
|
Provenance
The following attestation bundles were made for cloudnet_api_client-0.4.1-py3-none-any.whl:
Publisher:
publish.yml on actris-cloudnet/cloudnet-api-client
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
cloudnet_api_client-0.4.1-py3-none-any.whl -
Subject digest:
3afc5162277915f4bf5caf638a44a263c82897535c97b90d70cea6e51dafbac8 - Sigstore transparency entry: 191917014
- Sigstore integration time:
-
Permalink:
actris-cloudnet/cloudnet-api-client@17704b736560ca63dd250500fbed96b374aca387 -
Branch / Tag:
refs/tags/v0.4.1 - Owner: https://github.com/actris-cloudnet
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@17704b736560ca63dd250500fbed96b374aca387 -
Trigger Event:
push
-
Statement type: