Skip to content

API design

pmav99 edited this page Oct 8, 2022 · 1 revision

Searvey deals with:

  • metadata for sea stations managed by various providers across the globe
  • the actual data from these stations

Metadata API

The functions that retrieve metadata should return a pandas DataFrame.

Searvey provides two APIs for metadata:

  1. A high level API which allows you to retrieve the common subset of the metadata (regardless of the Provider).

  2. A low level API which allows you to retrieve the full metadata/data from each provider.

The API consists of the following functions:

  • high: get_stations()
  • low:
    • get_ioc_stations()
    • get_coops_stations()

When we want to add support for a new provider we need to:

  1. Add a function for the low-level API (e.g. get_usgs_stations() for USGS)
  2. Update get_stations() so that it calls the low level function.

Data API

The functions that retrieve data should return xarray Datasets.

Ideally, we would like to have a high and a low level API for data, too. Nevertheless, we are not there yet. We currently only have the low level API:

  • get_ioc_data()
  • get_coops_data()

Creating the high level API for data retrieval requires to understand what each provider returns and think how to consolidate that into a single data structure. So, there is work to be done!

Clone this wiki locally