Tools/tiangolo/pydantic-sqlalchemy

pydantic-sqlalchemy

Tools to convert SQLAlchemy models to Pydantic models

1.4kemergingPythonMIT Licensetrending

The Lens

By Erik Loyd, SaaS CEO and former COO/CFO of an AWS Premier Partner.

Updated May 2026

pydantic-sqlalchemy does one small thing: it turns your SQLAlchemy database models into Pydantic models automatically. If you use both in a Python project, FastAPI is the common case, you otherwise end up hand-writing a second set of models that mirror your tables. This generates them for you. MIT-licensed and free.

It's a tiny utility from the author of FastAPI, and it's labeled experimental, not a polished library you build a system on. For a quick script or a small project where you want Pydantic schemas off your existing tables without the boilerplate, it saves real typing.

The catch: modern stacks mostly solve this differently now, with SQLModel (also from the same author) combining SQLAlchemy and Pydantic into one model, or by generating schemas directly. Reach for this only if you specifically have separate SQLAlchemy models and want Pydantic versions fast. Otherwise, SQLModel is probably the better starting point.

Free vs Self-Hosted vs Paid

fully free

Free: MIT, free. A small single-purpose library.

Self-hosted: It's a Python package you import. Nothing to host.

Paid: No paid version. There's nothing to buy.

Free and open source, but experimental. SQLModel is usually the better starting point now.

What to do by team size

Solo
free
Small team
free
Larger team
free
Self-hosting ops:trivial

Get tools like this every Wednesday

One featured tool, three on the radar. No fluff.

Score
73/100 · B+
Adoption12/30
Maintenance25/25
Community11/20
License15/15
Analysis10/10

A low score is not a verdict on quality. Young and niche tools start low by design. How we calculate scores

Trust Signals

Community discussions enabledNotable author: 31,369 followersAuthor also built: tiangolo/library-skills (518 stars)

License: MIT License

Use freely, including commercial. Just keep the license.

Commercial use: ✓ Yes

About

Owner
Sebastián Ramírez (User)
Stars
1,406
Forks
74

Also by Sebastián Ramírez

Explore Further

More tools in the directory