import peewee db = peewee.Proxy() class BaseModel(peewee.Model): class Meta: database = db class PiWatch(BaseModel): ts = peewee.DateTimeField(primary_key=True) name = peewee.TextField() cpu_percent = peewee.FloatField() cpufreq_current = peewee.FloatField() cpu_temp = peewee.FloatField() cpu_spannung = peewee.FloatField() vmemory_total = peewee.FloatField() vmemory_available = peewee.FloatField() vmemory_percent = peewee.FloatField() vmemory_used = peewee.FloatField() vmemory_free = peewee.FloatField() swapmemory_total = peewee.FloatField() swapmemory_used = peewee.FloatField() swapmemory_free = peewee.FloatField() swapmemory_percent = peewee.FloatField() disk_total = peewee.FloatField() disk_used = peewee.FloatField() disk_free = peewee.FloatField() disk_percent = peewee.FloatField() class Meta: table_name = "pi_watch" def create_table(): db.create_tables([PiWatch])