Skip to main content

Cloudnet API client

Project description

CI PyPI version

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"])
cac.download(metadata, "data/")

raw_metadata = client.raw_metadata("granada", date="2024-01", instrument_id="parsivel")
cac.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

* = only in 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.date object

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.datetime object

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
filename_prefix str None
filename_suffix str None
include_tag_subset set[str] None
exclude_tag_subset set[str] None

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.

cloudnet_api_client.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


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

cloudnet_api_client-0.2.1.tar.gz (9.3 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

cloudnet_api_client-0.2.1-py3-none-any.whl (9.7 kB view details)

Uploaded Python 3

File details

Details for the file cloudnet_api_client-0.2.1.tar.gz.

File metadata

  • Download URL: cloudnet_api_client-0.2.1.tar.gz
  • Upload date:
  • Size: 9.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.12.9

File hashes

Hashes for cloudnet_api_client-0.2.1.tar.gz
Algorithm Hash digest
SHA256 3b6faff7ea727ba0fdff86abe5c24a2cbbc0e7d55ab5389e911a24bddc98a652
MD5 3a33c2e0b6ff841a3afd44a81e7ade4b
BLAKE2b-256 14bfa4bb2f59204c8569eca118d72f611d953c30209ba3e366e60b8fc35de524

See more details on using hashes here.

Provenance

The following attestation bundles were made for cloudnet_api_client-0.2.1.tar.gz:

Publisher: publish.yml on actris-cloudnet/cloudnet-api-client

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file cloudnet_api_client-0.2.1-py3-none-any.whl.

File metadata

File hashes

Hashes for cloudnet_api_client-0.2.1-py3-none-any.whl
Algorithm Hash digest
SHA256 8b33ffa3e310bff249661b4aa7d37410407cf3e15a9ccc8c56953870e64fce07
MD5 17e83bfd357c9b1190f08b8a5cf759f6
BLAKE2b-256 0a13946d2a34697f55f6f2b523cbd9176d1ee825632ea4b54d970f64488d6a15

See more details on using hashes here.

Provenance

The following attestation bundles were made for cloudnet_api_client-0.2.1-py3-none-any.whl:

Publisher: publish.yml on actris-cloudnet/cloudnet-api-client

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page