acept.pv_cap_api

Module for using the PV capacity factor API of the renewables.ninja API to build the PV capacity profile for a PLZ.

See https://www.renewables.ninja for more details. Note: The API is rate limited to 50 calls per hour and needs an API key. This key can be obtained from https://www.renewables.ninja and has to be set in /src/acept/personal_settings.py.

Set the API key in the following way in /src/acept/personal_settings.py:

renewables_token = "your_api_key"
raises FileNotFoundError:

if the file ‘personal_settings.py’ is not found.

raises ValueError:

if the ‘renewables_token’ is not set in /src/acept/personal_settings.py

Module Contents

Classes

PVQuery

Class containing the arguments for the PV capacity factor API call.

PVCapacityFactorCreator

Class for querying the PV capacity factor API of the renewables.ninja API. See https://www.renewables.ninja

class acept.pv_cap_api.PVQuery(plz: str, year: int = 2022, capacity: float = 1.0, system_loss: float = 0.1, tilt: float = 35, azim: float = 180)[source]

Class containing the arguments for the PV capacity factor API call.

Constructor for the PVQuery class.

Parameters:
  • plz (str) – The PLZ of the queried area.

  • year (int) – The year of the queried data.

  • capacity (float) – The maximum capacity of the PV system in kW.

  • system_loss (float) – The system loss of the PV system in %.

  • tilt (float) – The tilt of the PV system in degrees.

  • azim (float) – The azimuth of the PV system in degrees.

Raises:

ValueError – If the queried year is not between 1980 and 2022.

to_args_dict()[source]

Construct the arguments for the PV capacity factor API call as a dictionary.

Returns:

the arguments as a dictionary

class acept.pv_cap_api.PVCapacityFactorCreator[source]

Class for querying the PV capacity factor API of the renewables.ninja API. See https://www.renewables.ninja

MAX_CALLS_PER_HOUR = 50[source]

50 per hour

Type:

Rate limit of the renewables.ninja API as registered user

ONE_HOUR = 3600[source]

Number of seconds in one hour

create_pv_api_query(pv_query: PVQuery) str[source]

Query the PV capacity factor API of the renewables.ninja API with the given query and save the result in a temporary directory as a CSV file. Be aware that the API is rate limited to 50 calls per hour. See https://www.renewables.ninja/documentation for more details.

Parameters:

pv_query (PVQuery) – The PV capacity factor query.

Return type:

str