feat: File now will be downloaded when running the script
This commit is contained in:
parent
5b3e104df4
commit
ae7d21b2a3
1 changed files with 20 additions and 2 deletions
22
plot.py
22
plot.py
|
@ -4,14 +4,33 @@ import pandas as pd
|
|||
|
||||
import datetime
|
||||
import re
|
||||
import requests as req
|
||||
|
||||
|
||||
einwohner_deutschland = 83190556
|
||||
|
||||
today = datetime.date.today()
|
||||
print_today = today.isoformat()
|
||||
|
||||
filename_now = datetime.datetime.now().strftime("%Y%m%d%H%M%S")
|
||||
|
||||
# DIN A4 Plots
|
||||
plt.rcParams["figure.figsize"] = [11.69, 8.27]
|
||||
|
||||
rki_file = pd.read_excel('Impfquotenmonitoring.xlsx', sheet_name=None, engine='openpyxl')
|
||||
|
||||
# Download
|
||||
|
||||
filename = '{}_Impfquotenmonitoring.xlsx'.format(filename_now)
|
||||
|
||||
r = req.get('https://www.rki.de/DE/Content/InfAZ/N/Neuartiges_Coronavirus/Daten/Impfquotenmonitoring.xlsx?__blob=publicationFile')
|
||||
|
||||
with open(filename, 'wb') as outfile:
|
||||
outfile.write(r.content)
|
||||
|
||||
|
||||
|
||||
|
||||
rki_file = pd.read_excel(filename, sheet_name=None, engine='openpyxl')
|
||||
|
||||
raw_data = rki_file['Impfungen_proTag']
|
||||
|
||||
|
@ -50,7 +69,6 @@ def plot_extrapolation_portion(percentage):
|
|||
fig, ax = plt.subplots(1)
|
||||
|
||||
print_percentage = int(percentage * 100)
|
||||
print_today = datetime.date.today().isoformat()
|
||||
|
||||
plt.title(
|
||||
'Tägliche Impfquote, kumulierte Impfungen und lineare Extrapolation bis {} % der Bevölkerung Deutschlands\n'
|
||||
|
|
Loading…
Reference in a new issue