add cases7_per_100k Value and remove WHO Source

master
Hofei90 4 years ago
parent 051535008f
commit 2d4cdbd5ea

@ -19,6 +19,7 @@ class CoronaDaten(BaseModel):
deaths = IntegerField(null=True)
quelle = TextField(null=True)
recoverd = IntegerField(null=True)
cases7_per_100k = FloatField(null=True)
ts = DateTimeField()
class Meta:

@ -15,6 +15,7 @@ class CoronaDaten:
deaths: int
recoverd: int
active: int
cases7_per_100k: float
def sende_daten(url, table, headers, daten):

@ -31,9 +31,6 @@ QUELLEN = {
"=json&where=Confirmed%20%3E%200&returnGeometry=false&spatialRel=esriSpatialRelIntersects&outFields"
"=*&orderByFields=Confirmed%20desc%2CCountry_Region%20asc%2CProvince_State%20asc&resultOffset=0"
"&resultRecordCount=250&cacheHint=true",
"who": "https://services.arcgis.com/5T5nSi527N4F7luB/arcgis/rest/services/Cases_by_country_Plg_V3/FeatureServer/0"
"/query?f=json&where=1%3D1&returnGeometry=false&spatialRel=esriSpatialRelIntersects&outFields"
"=*&orderByFields=cum_conf%20desc&resultOffset=0&resultRecordCount=125&cacheHint=true",
"rki": "https://services7.arcgis.com/mOBPykOjAyBO2ZKk/arcgis/rest/services/Coronaf%C3%A4lle_in_den_Bundesl%C3"
"%A4ndern/FeatureServer/0/query?f=json&where=1%3D1&returnGeometry=false&spatialRel"
"=esriSpatialRelIntersects&outFields=*&orderByFields=faelle_100000_EW%20desc&resultOffset=0"
@ -79,27 +76,12 @@ def jhu_daten_erstellen(quelle, daten):
datum["Confirmed"],
datum["Deaths"],
datum["Recovered"],
datum["Confirmed"] - datum["Deaths"] - datum["Recovered"]
datum["Confirmed"] - datum["Deaths"] - datum["Recovered"],
-1
))
return daten_dict
def who_daten_erstellen(quelle, daten):
daten_dict = {}
for data in daten:
datum = data["attributes"]
daten_dict[datum["ADM0_NAME"]] = (db.CoronaDaten(
datetime.datetime.fromtimestamp(datum["DateOfReport"] / 1000),
datum["ADM0_NAME"].lower().capitalize(),
quelle,
datum["cum_conf"],
datum["cum_death"],
-1,
-1
))
return daten_dict
def rki_daten_erstellen(quelle, daten):
daten_dict = {}
for data in daten:
@ -111,7 +93,8 @@ def rki_daten_erstellen(quelle, daten):
datum["Fallzahl"],
datum["Death"],
-1,
-1
-1,
round(datum.get("cases7_bl_per_100k", -1), 2)
))
return daten_dict
@ -127,7 +110,8 @@ def rki_landkreis_daten_erstellen(quelle, daten):
datum["cases"],
datum["deaths"],
-1,
-1
-1,
round(datum.get("cases7_per_100k", -1), 2)
))
return daten_dict
@ -135,8 +119,6 @@ def rki_landkreis_daten_erstellen(quelle, daten):
def daten_erstellen(quelle, daten):
if quelle == "jhu":
daten_db = jhu_daten_erstellen(quelle, daten)
elif quelle == "who":
daten_db = who_daten_erstellen(quelle, daten)
elif quelle == "rki":
daten_db = rki_daten_erstellen(quelle, daten)
elif quelle == "rki_landkreis":

Loading…
Cancel
Save