Skip to content

Publish indicator and its metadata with Google Sheets

For some metrics we combine different sources to create a single variable, also known as an OWID Maintained Metric (OMM). In these cases we should create a publicly available Google Sheet that contains for each data point the sources used, the values, and any notes that are relevant to the data point.

To this end, we have implemented the function etl.data_helpers.misc.export_table_to_gsheet, which exports a spreadsheet with all the source details to a Google Sheet.

This function works best for single variables that have been heavily annotated, e.g. a source or note for each country-year row.

Pre-requisites

Note, that in order to use it you need to Google API credentials set up.

All output GSheets should be stored in this shared folder, which only GCDL can access, but the public have read access to individual sheets. By default, the function will automatically save to this folder.

This function is only run locally

The export_table_to_gsheet function is not run in staging or production environments. It is only run locally, so you must run it on your local machine to create the GSheet.

Examples

Learn how to use it from the existing examples in ETL: