diff options
author | Dennis Eriksen <d@ennis.no> | 2023-11-09 13:57:26 +0100 |
---|---|---|
committer | Dennis Eriksen <d@ennis.no> | 2023-11-09 13:57:26 +0100 |
commit | 4ad7f2e5111ca9e27dcbe5781c87f249bc7377ad (patch) | |
tree | d605620535229e741f7e2da473086fe185f78e5f /scripts/entsoe.py | |
parent | small fixes (diff) | |
download | energyscripts-4ad7f2e5111ca9e27dcbe5781c87f249bc7377ad.tar.gz |
added new function to get env
which handles missing env better...
Diffstat (limited to 'scripts/entsoe.py')
-rw-r--r-- | scripts/entsoe.py | 3 |
1 files changed, 1 insertions, 2 deletions
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 |