Outputs

Export functions

climagrid.outputs.exporters.to_csv(df, path, **kwargs)[source]

Write the DataFrame to a CSV file.

Parameters:
  • df (DataFrame) – climagrid environmental DataFrame.

  • path (str | Path) – Output file path (will create parent directories).

  • **kwargs – Passed to pandas.DataFrame.to_csv().

Returns:

Absolute path of the written file.

Return type:

Path

climagrid.outputs.exporters.to_parquet(df, path, **kwargs)[source]

Write the DataFrame to a Parquet file (column-oriented, compressed).

Parquet is recommended for time ranges > 30 days or > 100 assets.

Parameters:
  • df (DataFrame) – climagrid environmental DataFrame.

  • path (str | Path) – Output file path.

  • **kwargs – Passed to pandas.DataFrame.to_parquet().

Returns:

Absolute path of the written file.

Return type:

Path

climagrid.outputs.exporters.to_json_schema(path=None)[source]

Return (and optionally write) the climagrid column schema as JSON.

The schema file describes every column’s name, dtype, units, source, and description. Utility engineers and SCADA vendors can use this to auto-configure their data ingestion pipelines.

Parameters:

path (str | Path | None) – If provided, write the schema JSON to this path.

Returns:

The schema as a Python dictionary (also written to path if given).

Return type:

dict

climagrid.outputs.exporters.to_dataframe(df)[source]

Return the DataFrame as-is after schema validation.

Useful as a no-op endpoint that confirms the DataFrame conforms to the climagrid schema without writing to disk.

Return type:

DataFrame

Parameters:

df (DataFrame)