pvlib.iotools.read_pvgis_tmy#

pvlib.iotools.read_pvgis_tmy(filename, pvgis_format=None, map_variables=True)[source]#

Read a file downloaded from PVGIS.

Parameters:
  • filename (str, pathlib.Path, or file-like buffer) – Name, path, or buffer of file downloaded from PVGIS.

  • pvgis_format (str, optional) – Format of PVGIS file or buffer. Equivalent to the outputformat parameter in the PVGIS TMY API. If filename is a file and pvgis_format is not specified then the file extension will be used to determine the PVGIS format to parse. For PVGIS files from the API with outputformat='basic', please set pvgis_format to 'basic'. If filename is a buffer, then pvgis_format is required and must be in ['csv', 'epw', 'json', 'basic'].

  • map_variables (bool, default True) – When true, renames columns of the Dataframe to pvlib variable names where applicable. See variable VARIABLE_MAP.

Returns:

  • data (pandas.DataFrame) – the weather data

  • months_selected (list) – TMY year for each month, None for basic and EPW

  • inputs (dict) – the inputs, None for basic and EPW

  • metadata (list or dict) – file metadata, None for basic

Raises:
  • ValueError – if pvgis_format is not specified and the file extension is neither .csv, .json, nor .epw, or if pvgis_format is provided as input but isn’t in ['csv', 'epw', 'json', 'basic']

  • TypeError – if pvgis_format is not specified and filename is a buffer

See also

get_pvgis_tmy