// the find
ormar-orm/ormar
python async orm with fastapi in mind and pydantic validation
ormar is an async ORM for Python that uses a single model class as both the SQLAlchemy table definition and the Pydantic validation schema, eliminating the usual duplication between ORM models and API request/response types. It targets FastAPI specifically — you define one class and use it directly in route signatures. Still pre-1.0 after several years.
The single-model approach genuinely cuts boilerplate in FastAPI projects where you'd otherwise maintain parallel SQLAlchemy and Pydantic classes. The queryset API supports both Django-style string lookups and Python expression syntax (Book.author.name == 'x'), which is a nicer ergonomic than raw SQLAlchemy. Signal hooks (pre_save, post_delete, etc.) are available without plugins. The test suite is thorough and tests against real databases across Postgres, MySQL, and SQLite.
Still versioned at 0.x with explicit warnings to pin your dependency — that's a meaningful risk signal for production adoption given how long it's been in development. The single-model design is also its main trap: when your API shape diverges from your database shape (nested writes, partial updates, computed fields), you end up fighting the abstraction rather than just writing two classes. Complex queries with multiple joins or subqueries push you back toward raw SQLAlchemy core anyway, which defeats the point. Async support relies on the `databases` library underneath, which itself has had maintenance gaps.