Skip to content

peewee

A small Python ORM for working with PostgreSQL, MySQL, and SQLite databases.

Stars
12k
Forks
1.4k
Licence
MIT
Language
Python
Last update
5 days ago
Type
Library

What it is

Peewee is a Python library that maps database tables to Python classes, so you can read and write data with Python code instead of raw SQL. The description says it is small and expressive and supports PostgreSQL, MySQL, and SQLite, with asyncio support. The README was not included in full here, so details beyond this summary are limited.

  • Define database tables as Python model classes
  • Query and update records from a Python web app
  • Use the same model code against SQLite during development and a different database in production

Great for

  • Python developers who want a lightweight ORM instead of a large framework
  • Projects using SQLite, PostgreSQL, or MySQL
  • Developers building small web apps or services with Flask or FastAPI, based on the repository topics

Not ideal for

  • Teams that need features beyond what the available README summary describes, since the full README was not provided to verify them
  • Non-Python projects, because the library is written for Python
Step-by-step guide: how to use peeweeInstall, first run, examples, tips and FAQs

How to get it

  1. 1

    Install with a package manager

    You'll need: Python

    Clone the repository

    git clone https://github.com/coleifer/peewee
  2. 2

    Run it

    • Install the library following the project documentation at http://docs.peewee-orm.com/
    • Define a model class that maps to a database table
    • Connect to a database and run a simple query
  3. 3

    Get the most out of it

    • Read the official documentation at http://docs.peewee-orm.com/ for models, queries, and database backends
    • Use the asyncio support if your application is async, as mentioned in the description

Downloads

Strengths

  • Small codebase with a focused scope, according to its description
  • Supports several major relational databases
  • Has asyncio support and an MIT license

Trade-offs

  • The README provided was truncated, so many details could not be checked
  • Using an ORM adds an abstraction layer that you need to learn alongside SQL

How it compares

ProjectStarsTypeLevelUpdatedBest for
peewee (this)12kLibrarybeginner5 days agoPython developers who want a lightweight ORM instead of a large framework
sqlalchemy12.3kLibraryintermediate4 days agoPython developers building applications backed by a SQL database
typeorm36.7kLibraryintermediate8 days agoNode.js or TypeScript developers building apps backed by a relational database
sequelize30.3kLibraryintermediate5 days agoNode.js backend developers who use a relational SQL database
sqlmodel18.5kLibrarybeginner4 days agoPython developers building FastAPI applications that use a SQL database
libsql17.3kLibraryintermediate20 days agoDevelopers who already use SQLite and want extra features like embedded replicas

Stats synced from GitHub. The assessment above was drafted with AI from the project's README on 2026-10-29 and may miss recent changes — check the README before relying on a command. MIT licence: free to use, modify and distribute, including commercially, as long as you keep the copyright notice.