Results API

Module to connect to the database API to retrieve and operate on results data.

class owimetadatabase_preprocessor.results.io.ResultsAPI(api_subdir: str = '/results/routes/', **kwargs)

Bases: API

Class to connect to the results data API with methods to retrieve data.

__init__(api_subdir: str = '/results/routes/', **kwargs) None

Create an instance of the ResultsAPI class with the required parameters.

Parameters:
  • api_subdir – Optional: subdirectory of the API endpoint url for specific type of data.

  • kwargs – Additional parameters to pass to the API (see the base class).

Returns:

None

get_analyses(name: str | None = None) dict[str, DataFrame | bool | int64 | None]

Get all relevant analyses.

Parameters:

name – Optional: Name of the analysis.

Returns:

Dictionary with the following keys:

  • ”data”: Pandas dataframe with the analyses

  • ”exists”: Boolean indicating whether matching records are found

get_results(assetlocation: str | None = None, projectsite: str | None = None, analysis: str | None = None, short_description: str | None = None, **kwargs) dict[str, DataFrame | bool | int64 | None]

Get the results.

Parameters:
  • assetlocation – Optional: Title of the asset location.

  • projectsite – Optional: Title of the projectsite.

  • analysis – Optional: Title of the analysis.

  • short_description – Optional: Short description of the analysis.

Returns:

Dictionary with the following keys:

  • ”id”: ID of the specified model definition

  • ”multiple_modeldef”: Boolean indicating whether there are multiple model definitions

    for the asset location in general