You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

59 lines
1.3 KiB
Python

from peewee import *
database = Proxy()
class UnknownField(object):
def __init__(self, *_, **__): pass
class BaseModel(Model):
class Meta:
database = database
class CoronaDaten(BaseModel):
active = IntegerField(null=True)
confirmed = IntegerField(null=True)
country_region = TextField()
deaths = IntegerField(null=True)
quelle = TextField(null=True)
recoverd = IntegerField(null=True)
cases7_per_100k = FloatField(null=True)
ts = DateTimeField()
class Meta:
table_name = 'corona_daten'
indexes = (
(('ts', 'country_region'), True),
)
primary_key = CompositeKey('country_region', 'ts')
class CoronaStatistik(BaseModel):
ts = DateTimeField()
quelle = TextField()
country_region = TextField()
typ = TextField()
wert = FloatField()
class Intensivregister(BaseModel):
ts = DateTimeField()
bundesland = TextField()
covid_aktuell = IntegerField()
covid_aktuell_beatmet = IntegerField()
intensivbetten_belegt = IntegerField()
intensivbetten_frei = IntegerField()
intensivbetten_notfall = IntegerField()
class Meta:
primary_key = CompositeKey('ts', 'bundesland')
def create_tables():
database.create_tables([CoronaDaten, CoronaStatistik, Intensivregister])