finds.dev

tiangolo/pydantic-sqlalchemy

Tools to convert SQLAlchemy models to Pydantic models

View on GitHub

★ 1,409PythonMITupdated Aug 2026

// the take

A small utility from tiangolo that converts SQLAlchemy declarative models into Pydantic models via sqlalchemy_to_pydantic(), useful for quickly exposing ORM models through FastAPI without hand-writing schemas. It's for people who already have SQLAlchemy models and want a fast way to bolt on request/response validation.

The core function is genuinely tiny and easy to read in one sitting, so there's no black box to debug when it breaks. It handles relationships by letting you compose generated models together (PydanticUserWithAddresses subclassing PydanticUser), which covers the common nested-serialization case. Test coverage and CI are in place for what is a very small surface area.

The README leads with a warning from the author to use SQLModel instead, and the project is explicitly marked 'still experimental' with no real progress since. Generated models lose IDE autocompletion and inline type errors because they're built dynamically at runtime rather than declared, which is the exact problem SQLModel was built to fix. There's no support for excluding fields, customizing validators, or handling anything beyond basic column types without dropping into config overrides most users won't discover from the docs. Last meaningful development was years ago even though the repo shows a recent push, so anyone using this on a current SQLAlchemy 2.x + Pydantic v2 stack should expect to hit compatibility gaps.

We read the README, the directory tree and a key source file in September 2026. Nobody pays to be listed. How we judge →

// at a glance

Stars
1,409
Forks
74
Language
Python
License
MIT
Last commit
29 Aug 2026

// nearby

If pydantic-sqlalchemy isn't quite it.

All repos →