hestia_earth.utils.lookup.extract_grouped_data

hestia_earth.utils.lookup.extract_grouped_data(data, key)[source]

Extract value from a grouped data in a lookup table.

Example: - with data: Average_price_per_tonne:106950.5556;1991:-;1992:- - get the value for Average_price_per_tonne = 106950.5556

Parameters
  • data (str) – The data to parse. Must be a string in the format <key1>:<value>;<key2>:<value>

  • key (str) – The key to extract the data. If not present, None will be returned.

Returns

The value found or None if no match.

Return type

str