ran black and isort for sorting imports and reformating
parent
3098403b65
commit
30e8fbc33e
|
|
@ -1,7 +1,9 @@
|
||||||
import glob
|
import glob
|
||||||
import pandas as pd
|
|
||||||
import os
|
import os
|
||||||
|
|
||||||
|
import pandas as pd
|
||||||
|
|
||||||
|
|
||||||
def main():
|
def main():
|
||||||
path = "./stundenwerte/*.csv"
|
path = "./stundenwerte/*.csv"
|
||||||
files = glob.glob(path)
|
files = glob.glob(path)
|
||||||
|
|
|
||||||
|
|
@ -1,10 +1,12 @@
|
||||||
# script to get hourly counters from 2014-present
|
# script to get hourly counters from 2014-present
|
||||||
import requests
|
|
||||||
import gzip
|
|
||||||
import shutil
|
|
||||||
import os
|
|
||||||
import glob
|
import glob
|
||||||
|
import gzip
|
||||||
|
import os
|
||||||
|
import shutil
|
||||||
|
|
||||||
import pandas as pd
|
import pandas as pd
|
||||||
|
import requests
|
||||||
|
|
||||||
|
|
||||||
def main():
|
def main():
|
||||||
for year in range(2014, 2026):
|
for year in range(2014, 2026):
|
||||||
|
|
@ -19,9 +21,9 @@ def main():
|
||||||
r = requests.get(url)
|
r = requests.get(url)
|
||||||
f.write(r.content)
|
f.write(r.content)
|
||||||
os.makedirs("stundenwerte", exist_ok=True)
|
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]
|
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)
|
shutil.copyfileobj(f_in, f_out)
|
||||||
|
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue