Skip to main content

Python client for Climadjust API

Project description

climadjust.client

authenticate

 | authenticate()

API authentication. Needed to connect to the API

Datasets

Observation datasets

get_observation_datasets

 | get_observation_datasets(name=None, page=None, size=None, sort_field=None, sort_direction=None)

Get a paginated list of observation datasets

Arguments:

  • name: (optional) str dataset name
  • page: (optional) int page number
  • size: (optional) int number of results per page
  • sort_field: (optional) str field to sort results by (either "type" or "name")
  • sort_direction: (optional) str sort direction (either "ASC" or "DESC")

Returns:

list of observation datasets

get_observation_dataset_by_id

 | get_observation_dataset_by_id(ds_id: int)

Get an observation dataset. In case the dataset is being uploaded the uploaded state will also appear.

Arguments:

  • ds_id: int id of the observation dataset

Returns:

the selected dataset information

post_observation_dataset

 | post_observation_dataset(file, name, ds_format, variables)

Uploads an observation dataset

Arguments:

  • file: str path to the dataset to be uploaded
  • name: str dataset name
  • ds_format: str dataset format (either "NETCDF" or "VALUE_TEXT")
  • variables: list[dict] list of variables. Variable format should be: {"standardName": "tas", "customName": "tas", "standardUnit": "Celsius", "customUnit": "Celsius"}

Returns:

id of the uploaded dataset

get_validation

 | get_validation(ds_id)

Gets validation warning/errors and GEOJSON info from an uploaded dataset

Arguments:

  • ds_id: int id of the uploaded dataset

Returns:

dict of validation warning/errors and a GEOJSON with info from the dataset

delete_observation_dataset

 | delete_observation_dataset(id: int)

Delete existing observation dataset

Arguments:

  • id: int id of the dataset

Returns:

Projection datasets

get_projection_datasets

 | get_projection_datasets(type=None, name=None, page=None, size=None, sort_field=None, sort_direction=None)

Get a paginated list of projection datasets

Arguments:

  • name: (optional) str dataset name
  • page: (optional) int page number
  • size: (optional) int number of results per page
  • sort_field: (optional) str field to sort results by (either "type" or "name")
  • sort_direction: (optional) str sort direction (either "ASC" or "DESC")

Returns:

list of projection datasets

get_projection_datasets_by_id

 | get_projection_datasets_by_id(id: int)

Get a projection dataset info

Arguments:

  • id: int id of the projection dataset

Returns:

dict with dataset info

climadjust.clientMethods.experiment_mixin

get_experiments

 | get_experiments(page=None, size=None, sort_field=None, sort_direction=None)

Get a paginated list of experiments

Arguments:

  • page: (optional) int page number
  • size: (optional) int number of results per page
  • sort_field: (optional) str field to sort results by (either "id" or "name")
  • sort_direction: (optional) str sort direction (either "ASC" or "DESC")

Returns:

list of experiments

get_experiments_by_id

 | get_experiments_by_id(exp_id)

Get a specific experiment. In case the experiment is being uploaded the uploaded state will also appear.

Arguments:

  • exp_id: int id of the experiment

Returns:

the selected experiment information

post_experiment

 | post_experiment(name, temporalResolution, variables, scenarios, models, baconfiguration, spatialResolution, datasetProjection, datasetReference, spatialCoverage, outputFormat, validation, mask)

Arguments:

  • name: str experiment name
  • temporalResolution: str temporal resolution for the experiment (only "DAILY")
  • variables: list list of variables to perform the bias adjustment on
  • scenarios: list list of dictionaries, each dictionary contains the scenario name as well as the startDate and the endDate
  • models: list list of models / members to use
  • baconfiguration: list list of bias adjustment configurations for each variable (variable, method, and parameters)
  • spatialResolution: str spatial resolution for the experiment ("NATIVE")
  • datasetProjection: dict dictionary with the IDs of the projections datasets that will be used for the experiment
  • datasetReference: dict dictionary with the IDs of the reference datasets that will be used for the experiment
  • spatialCoverage: shapely.geometry.Polygon() Polygon with the spatial coverage over which to execute the experiment
  • outputFormat: str output format (for example "NETCDF", "GRIB", ...)
  • validation: str validation activity to perform (for example "NONE")
  • mask: str a string explaining if land-mask needs to be used (for example "none")

Returns:

id of the uploaded experiment

delete_experiment

 | delete_experiment(exp_id)

Delete existing experiment

Arguments:

  • id: int id of the expoeriment to be deleted

Returns:

Project details


Release history Release notifications | RSS feed

This version

1.0

Download files

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

Source Distribution

climadjust-1.0.tar.gz (8.6 kB view hashes)

Uploaded Source

Supported by

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