diff options
author | Dennis Eriksen <d@ennis.no> | 2023-11-02 12:44:44 +0100 |
---|---|---|
committer | Dennis Eriksen <d@ennis.no> | 2023-11-02 12:44:44 +0100 |
commit | 3eddd39a5aa52d40fbc2e0a12b463d270ddfeba2 (patch) | |
tree | b7f4559cf252a32990f5e462dc09b2a9ad23c9b4 /scripts/nb.py | |
parent | add comment about manual starttime (diff) | |
download | energyscripts-3eddd39a5aa52d40fbc2e0a12b463d270ddfeba2.tar.gz |
adding linting with ruff
Diffstat (limited to 'scripts/nb.py')
-rw-r--r-- | scripts/nb.py | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/scripts/nb.py b/scripts/nb.py index c3bbe40..2e2a7f9 100644 --- a/scripts/nb.py +++ b/scripts/nb.py @@ -1,16 +1,15 @@ #!/usr/bin/env python3 ''' Get exchange rates from nb ''' +import csv import os import sys -import csv import tempfile -from datetime import datetime -from datetime import timedelta -from tzlocal import get_localzone -import requests +from datetime import datetime, timedelta import common +import requests +from tzlocal import get_localzone # I'm not sure I understand Norges Banks json-model. It seems a lot easier to just get the CSV, and convert it to JSON. apiUrl = "https://data.norges-bank.no/api/data/EXR/B.EUR.NOK.SP?format=csv&locale=en" |