h2integrate.resource.utilities.nlr_developer_api_keys

h2integrate.resource.utilities.nlr_developer_api_keys#

Functions

get_nlr_developer_api_credential(which[, ...])

Get either the NLR API email or key with a fallback for the NREL credentials.

get_nlr_developer_api_email()

Load the API email (NLR_API_EMAIL) for the NLR Developer Network.

get_nlr_developer_api_key()

Load the API key (NLR_API_KEY) for the NLR Developer Network.

h2integrate.resource.utilities.nlr_developer_api_keys.get_nlr_developer_api_credential(which, env_path=None, set_vars=True)#

Get either the NLR API email or key with a fallback for the NREL credentials.

Parameters:
  • which (str) -- One of "email" or "key" to indicate which NLR API credential should be retrieved.

  • env_path (None | Path | str, optional) -- Filepath to file containing NLR API credentials. Defaults to None.

  • set_vars (bool)

Raises:
  • ValueError -- Raised if an invalid value was passed to which.

  • KeyError -- Raised if neither of the NLR or NREL credentials could be found.

Returns:

str -- API key or email for NLR Developer Network.

Return type:

str

h2integrate.resource.utilities.nlr_developer_api_keys.get_nlr_developer_api_key()#

Load the API key (NLR_API_KEY) for the NLR Developer Network.

Raises:

ValueError -- If NLR_API_KEY or NREL_API_KEY was not found as an environment variable

Returns:

str -- API key for NLR Developer Network. Should be length 40.

Return type:

str

h2integrate.resource.utilities.nlr_developer_api_keys.get_nlr_developer_api_email()#

Load the API email (NLR_API_EMAIL) for the NLR Developer Network.

Raises:

ValueError -- If NLR_API_EMAIL or NREL_API_EMAIL was not found as an environment variable

Returns:

str -- email corresponding to the API key for NLR Developer Network.

Return type:

str