ODS Tools#

On this page:#


Introduction#


ODS Tools is a Python package designed to manage ODS - Open Data Standards data, and ensure that this is complying with the ODS schema. It includes a range of tools for working with Oasis data files, including loading, conversion, and validation. This package is in accordance with ODS.

As a separate service, the package include functionality to manage Model Settings and Analysis Settings that are used to perform an analysis.

ODS tools comprises primarily of two parts:


Management of analysis settings#


ODS Tools manages two settings files: model_settings.json and analysis_settings.json. These are used in both the Platform and MDK for running models.

  • analysis_settings.json is the main user input. This is used to configure execution options, selected output reports, and (depending on the model) lookup and keys generation.

  • model_settings.json presents all valid inputs set in an analysis_settings.json (along with some default values if no input is given). The intended use of this is that a UI, such as OasisUI, picks up the available options and render them as widgets and input fields to generate an analysis_settings.json file.


Management of exposure data#


This part of ODS Tools is to manage OED data through an ELT step. ELT is crucial as it checks the incoming data and makes sure it’s in the correct format. This is achieved through several functionalities:

  • It loads the data from a range of sources (which are currently: data stream, csv and parquet files, pandas dataframe). This is then stored all as a pandas dataframe.

  • It sets the columns in the dataframe to correct type. More information on the columns and type can be found in the Open Exposure Data Spec spreadsheet.

  • It performs checks to ensure the data is correct by validating that the OED data according to the OED schema in the Open Exposure Data Spec spreadsheet. This currently checks source_coherence, required_fields, unknown_column, valid_values, perils, occupancy_code, construction_code, country_and_area_code

  • It checks the currencies in the exposure data. Only one currency is required for the exposure, so there is built in functionality to convert to one currency type if required.

  • It provides capability to convert the exposure to different format if required (csv and parquet are the one currently implemented).

More information of these capabilities can be found here.


Installation and Application#


ODS Tools can be installed via pip by running the following command:


pip install ods-tools

Once installed, ODS Tools can be used via the command line interface to quickly convert oed files.

Example :


ods_tools convert --location path_to_location_file --path output folder

Note

See ods_tools convert --help for more options.