Open-source templates and libraries for building production-ready Python applications: web services, microservices, and the dependency injection that wires them together.
-
Project templates
Dockerized, batteries-included starting points for new web apps.
-
Dependency injection
The
modern-diandthat-dependsDI frameworks. -
Microservices, HTTP & messaging
Bootstrapping, HTTP clients, and FastStream broker tooling.
-
Utilities
Small, focused helpers for everyday Python projects.
The stack
The modern-python projects fit together into one coherent stack for building production Python services. Each project is independent, so use one piece or all of them.
- Start from a template.
fastapi-sqlalchemy-templateandlitestar-sqlalchemy-templategive you a dockerized, batteries-included app on FastAPI or Litestar, SQLAlchemy 2 and PostgreSQL, with dependency injection already wired. - Wire your dependencies with
modern-di: typed, scoped dependency injection with one wiring shared across web frameworks (FastAPI, Litestar, Starlette, Flask, aiohttp), task queues (Celery, arq, taskiq), RPC and messaging (gRPC, FastStream, aiogram), MCP servers (FastMCP), and CLIs (Typer). (that-depends, the older DI framework, is still maintained.) - Call other services reliably with
httpware, an httpx-based client with typed errors, typed response bodies, and a composable resilience chain (retry, bulkhead, circuit breaker). - Publish events reliably with
faststream-outbox, the transactional outbox pattern for FastStream + PostgreSQL. You write your domain row and outbox row in one transaction and relay to any broker with one decorator. - Instrument everything with
lite-bootstrap, which wires OpenTelemetry, Prometheus, Sentry, and structlog into FastAPI, Litestar, or FastStream in a few lines.
Every project is built with the same tooling
(uv, ruff,
ty) under the MIT license, to one shared
standard. Browse the full catalog below.
If you'd like help applying this stack to your own services, see services.
Project templates
fastapi-sqlalchemy-template: Dockerized FastAPI + SQLAlchemy 2 + PostgreSQL app template with DIlitestar-sqlalchemy-template: Dockerized Litestar + SQLAlchemy 2 + PostgreSQL app template with DI
Dependency injection
Which one should I use?
Start new projects on modern-di.
It has a minimal core plus framework integrations, listed in
its docs.
that-depends is the earlier,
async-first sibling and stays maintained. modern-di has migration guides
from that-depends
and
from dependency-injector.
modern-di: Powerful dependency-injection framework with IoC container and scopesthat-depends: Simple, typed dependency-injection framework for Python
Microservices, HTTP & messaging
lite-bootstrap: Lightweight bootstrap for production-ready Python microserviceshttpware: Typed, resilient HTTP clients for Python, sync and asyncjwks-client: Async JWKS client for verifying JWTs, with key caching, resilient fetching, and Litestar and FastAPI integrationsfaststream-redis-timers: FastStream integration for Redis-backed distributed timer schedulingfaststream-concurrent-aiokafka: Concurrent message-processing middleware for FastStream + aiokafkafaststream-outbox: FastStream transactional-outbox integration backed by a Postgres table
Utilities
compose2pod: Convert a Docker Compose file into a script that runs its services as a single Podman poddb-retry: Retry helpers for PostgreSQL / SQLAlchemy database operationseof-fixer: CLI tool that ensures text files end with exactly one newlinerelease-scope: Collect what sits between production and the default branch across GitLab services: tags, MRs, Jira keys, failed jobssqlalchemy-inbox: Transactional inbox ledger for SQLAlchemy asyncio on PostgreSQLsemvertag: Auto-tag GitHub & GitLab repos with semantic version tags from CI