From 4ad7f2e5111ca9e27dcbe5781c87f249bc7377ad Mon Sep 17 00:00:00 2001 From: Dennis Eriksen Date: Thu, 9 Nov 2023 13:57:26 +0100 Subject: added new function to get env which handles missing env better... --- scripts/entsoe.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'scripts/entsoe.py') diff --git a/scripts/entsoe.py b/scripts/entsoe.py index fc34274..2c825c2 100644 --- a/scripts/entsoe.py +++ b/scripts/entsoe.py @@ -1,7 +1,6 @@ #!/usr/bin/env python3 """ Get energyprices from Entsoe """ -import os import sys from datetime import datetime, timedelta @@ -22,7 +21,7 @@ from tzlocal import get_localzone # > respond to your request. # 1: https://transparency.entsoe.eu/content/static_content/Static%20content/web%20api/Guide.html#_authentication_and_authorisation # 2: https://transparency.entsoe.eu/content/static_content/download?path=/Static%20content/API-Token-Management.pdf -apiKey = os.environ["el_entsoe_token"] +apiKey = common.env("el_entsoe_token") # https://transparency.entsoe.eu/content/static_content/Static%20content/web%20api/Guide.html apiUrl = "https://web-api.tp.entsoe.eu/api?securityToken=" + apiKey -- cgit v1.2.3