>Accessing Data>HESTIA Utilities

HESTIA Utilities


Pivoting Headers by Terms

After downloading data as CSV from the HESTIA platform, the format will look like this:

site.@idsite.measurements.0.term.@idsite.measurements.0.valuesite.measurements.1.term.@idsite.measurements.1.valuesite.measurements.2.term.@idsite.measurements.2.valuesite.dataPrivate
xvflrsandContent90siltContent6clayContent4false
gghtsandContent90siltContent6clayContent4false

It is possible to pivot some data based on the term.@id and move them as columns, such as:

site.@idsite.measurements.sandContent.valuesite.measurements.siltContent.valuesite.measurements.clayContent.valuesite.dataPrivate
xvflr9064false
gght9064false

Usage

  1. Install Python version 3 minimum
  2. Install the utils library: pip install hestia_earth.utils
  3. Run:
hestia-pivot-csv --input-file source.csv

This writes source-pivoted.csv beside the original. To choose the name yourself:

hestia-pivot-csv --input-file source.csv --output-file dest.csv

The input can be a CSV or a JSON file of nodes.