Open source of the month: peewee ORM - A small, expressive Python ORM.
Peewee is a lightweight and straightforward ORM that is both easy to learn and intuitive to use. It features a small set of expressive concepts, which simplifies the learning curve without sacrificing functionality.
• publicFor July, I want to highlight peewee ORM. The author isn't currently accepting sponsorships or donations.
Python ORM Choices
For a modern Python application, there's several ORM libraries to choose from. For the Django-inclined, it has own built-in ORM. More recently, SQLModel has appeared on the scene, which makes use of Python type annotations, and is designed to work well with the author's own web framework, FastAPI. There is is even a Python client for the increasingly popular TypeScript ORM, Prisma. For most projects however, the library of choice remains SQLAlchemy.
SQLAlchemy Woes
Alchemy is a powerful tool that's been around for a while, and has been battle-tested by a number of large projects. If you're new to it however, it can be complex to pick up. The library has a lot of features, and there's a number of ways of doing things. Many find the syntax verbose and less intuitive compared to other ORMs, making code harder to write and maintain.
Why peewee?
In the author's own words:
"Peewee is a simple and small ORM. It has few (but expressive) concepts, making it easy to learn and intuitive to use."
Given this, I'd highly recommend it for small-medium sized Python projects. What's more, at the time of writing, peewee is actively maintained, and has been since 2013.