Peewee is a lightweight ORM (Object-Relational Mapping) for Python

Peewee is a compact and easy-to-use ORM library for working with databases.

It supports SQLite, MySQL, and PostgreSQL, providing a convenient API for working with models, simplifying interaction with databases.

from peewee import *

db = SqliteDatabase('people.db')

class Person(Model):
    name = CharField()
    age = IntegerField()

    class Meta:
        database = db

db.connect()
db.create_tables([Person])

Person.create(name="Alice", age=30)

Link to doc

Comments (0)

Leave a comment