diff options
author | Dennis Eriksen <d@ennis.no> | 2024-10-07 20:43:26 +0200 |
---|---|---|
committer | Dennis Eriksen <d@ennis.no> | 2024-10-07 20:43:26 +0200 |
commit | bb0c09435efcd4d9a07b5c44af152e8e042a79a3 (patch) | |
tree | 43834533e5d6e234429638c827d2678376475d6a | |
parent | optimize and simplify (diff) | |
download | energyscripts-bb0c09435efcd4d9a07b5c44af152e8e042a79a3.tar.gz |
list moved
-rw-r--r-- | scripts/entsoe.py | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/scripts/entsoe.py b/scripts/entsoe.py index 1836229..9c721a2 100644 --- a/scripts/entsoe.py +++ b/scripts/entsoe.py @@ -78,15 +78,15 @@ for area in areas: items = 0 if "Publication_MarketDocument" in data_dict: - for lista in data_dict["Publication_MarketDocument"]["TimeSeries"]: + for lista in data_dict["Publication_MarketDocument"]["TimeSeries"]["Period"]: utctime = datetime.strptime( - lista["Period"]["timeInterval"]["start"], "%Y-%m-%dT%H:%MZ" + lista["timeInterval"]["start"], "%Y-%m-%dT%H:%MZ" ) utctime = utctime.replace(tzinfo=UTC) cettime = utctime.astimezone(CET) - items += len(lista["Period"]["Point"]) + items += len(lista["Point"]) - for item in lista["Period"]["Point"]: + for item in lista["Point"]: # the response contains timerange, but not timestamp for every price, so we must calculate it time = str(cettime + timedelta(hours=int(item["position"]) - 1)) |