ran black and isort for sorting imports and reformating

main
Nikola Sebastian Munder 2026-01-05 12:00:41 +01:00
parent 3098403b65
commit 30e8fbc33e
2 changed files with 23 additions and 19 deletions

View File

@ -1,7 +1,9 @@
import glob
import pandas as pd
import os
import pandas as pd
def main():
path = "./stundenwerte/*.csv"
files = glob.glob(path)

View File

@ -1,10 +1,12 @@
# script to get hourly counters from 2014-present
import requests
import gzip
import shutil
import os
import glob
import gzip
import os
import shutil
import pandas as pd
import requests
def main():
for year in range(2014, 2026):
@ -19,9 +21,9 @@ def main():
r = requests.get(url)
f.write(r.content)
os.makedirs("stundenwerte", exist_ok=True)
with gzip.open(f"hourly_archives/{filename}", 'rb') as f_in:
with gzip.open(f"hourly_archives/{filename}", "rb") as f_in:
f_name = "stundenwerte/" + filename.split(".")[0]
with open(f"{f_name}.csv", 'wb') as f_out:
with open(f"{f_name}.csv", "wb") as f_out:
shutil.copyfileobj(f_in, f_out)