finds.dev← search

// the find

ormar-orm/ormar

★ 1,806 · Python · MIT · updated Jun 2026

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.

View on GitHub → Homepage ↗

// want more like this?

We dig through GitHub every week and send a few repos picked for what you actually care about — each with an honest take like this one.

Get finds in your inbox → Search again →