FastAPI, Pydantic, Psycopg3: the holy trinity for Python web APIs

This page summarizes the projects mentioned and recommended in the original post on dev.to

InfluxDB – Built for High-Performance Time Series Workloads
InfluxDB 3 OSS is now GA. Transform, enrich, and act on time series data directly in the database. Automate critical tasks and eliminate the need to move data externally. Download now.
www.influxdata.com
featured
Stream - Scalable APIs for Chat, Feeds, Moderation, & Video.
Stream helps developers build engaging apps that scale to millions with performant and flexible Chat, Feeds, Moderation, and Video APIs and SDKs powered by a global edge network and enterprise-grade infrastructure.
getstream.io
featured
  1. litestar

    Light, flexible and extensible ASGI framework | Built to scale

    If I was starting from scratch with Python web API development today, I would probably look more closely at LiteStar, which seems to me to be a better architected and with a better project governance structure.

  2. InfluxDB

    InfluxDB – Built for High-Performance Time Series Workloads. InfluxDB 3 OSS is now GA. Transform, enrich, and act on time series data directly in the database. Automate critical tasks and eliminate the need to move data externally. Download now.

    InfluxDB logo
  3. asgiref

    ASGI specification and utilities

    Note 1: we are only interested in async libraries here, as FastAPI is ASGI.

  4. tortoise-orm

    Familiar asyncio ORM for python, built with relations in mind

    TortoiseORM: I personally really like this Django-inspired async ORM; it's clean and nice to use.

  5. Peewee

    a small, expressive orm -- supports postgresql, mysql, sqlite and cockroachdb

    Alternative ORMs: there are many such as peewee, PonyORM, etc.

  6. PonyORM

    Pony Object Relational Mapper

    Alternative ORMs: there are many such as peewee, PonyORM, etc.

  7. databases

    Discontinued Async database support for Python. 🗄

    SQLAlchemy Core: the core SQL query builder, without the mapping to objects part. There is also a higher level ORM built on this called databases that looks very nice. I do wonder how actively developed the project is however.

  8. PyPika

    PyPika is a python SQL query builder that exposes the full richness of the SQL language using a syntax that reflects the resulting query. PyPika excels at all sorts of SQL queries but is especially useful for data analysis.

    PyPika: I don't know much about this one.

  9. Stream

    Stream - Scalable APIs for Chat, Feeds, Moderation, & Video. Stream helps developers build engaging apps that scale to millions with performant and flexible Chat, Feeds, Moderation, and Video APIs and SDKs powered by a global edge network and enterprise-grade infrastructure.

    Stream logo
  10. asyncpg

    A fast PostgreSQL Database Client Library for Python/asyncio.

    asyncpg: this was the gold standard async database driver for Postgres, being one of the first to market and most performant. While all other drivers use the C library libpq to interface with Postgres, MagicStack opted to rewrite their own custom implementation and also deviate from Python DBAPI spec. If performance is your main criteria here, then asyncpg is probably the best option.

  11. psycopg

    New generation PostgreSQL database adapter for the Python programming language

    psycopg3: well psycopg2 was clearly the king of the synchronous database driver world for Python/Postgres. psycopg3 (rebranded to simply psycopg) is the next, fully async, iteration of this library. This library has really come into it's own in recent years & I wish to discuss it further. See this interesting blog from the author about the early days of psycopg3.

  12. pydantic

    Data validation using Python type hints

    Pydantic is bundled with FastAPI and is excellent for modelling, validating, and serialising API responses.

  13. sqlmodel

    SQL databases in Python, designed for simplicity, compatibility, and robustness.

    This is exactly the problem the creator of FastAPI tried to solve with the library SQLModel.

  14. attrs

    Python Classes Without Boilerplate

    This functionality allows you to map returned database data to any Python object, including standard lib dataclasses, models from the great attrs library, and yes, Pydantic models!

  15. field-tm

    Field Tasking Manager - coordinated field mapping.

    See the full codebase here. And ⭐ if you found this useful!

NOTE: The number of mentions on this list indicates mentions on common posts plus user suggested alternatives. Hence, a higher number means a more popular project.

Suggest a related project

Related posts

  • FastAPI in Prod: Handling DB migrations, auth, and more

    4 projects | dev.to | 18 Feb 2025
  • Python Design Patterns for Clean Architecture

    3 projects | dev.to | 16 Nov 2025
  • Piccolo: Powerful async ORM, query builder, and admin GUI

    1 project | news.ycombinator.com | 15 Jul 2025
  • Why Developers Are Choosing Tortoise ORM as Python’s Modern ORM

    1 project | dev.to | 11 May 2025
  • Django and Postgres for the Busy Rails Developer

    10 projects | news.ycombinator.com | 11 Dec 2024

Did you know that Python is
the 2nd most popular programming language
based on number of references?