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-difamily of DI frameworks and integrations. -
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. Use one piece or all of them — each is independent.
- Start from a template.
fastapi-sqlalchemy-templateandlitestar-sqlalchemy-templategive you a dockerized, batteries-included app — FastAPI or Litestar, SQLAlchemy 2, 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), and CLIs (Typer). (that-depends, its production-proven predecessor, 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: write your domain row and outbox row in one transaction, relay to any broker with one decorator. - Instrument everything with
lite-bootstrap— OpenTelemetry, Prometheus, Sentry, and structlog wired into FastAPI, Litestar, or FastStream in a few lines.
Every project is built with the same tooling
(uv, ruff,
ty) under the MIT license. Browse the full
catalog below.
Project templates
fastapi-sqlalchemy-template— dockerized web application with DI on FastAPI, SQLAlchemy 2, PostgreSQL.litestar-sqlalchemy-template— dockerized web application on Litestar, SQLAlchemy 2, PostgreSQL.
Dependency injection
Which one should I use?
Start new projects on modern-di
— a minimal core plus the integrations listed below.
that-depends is the earlier,
async-first sibling and stays maintained. Coming from it? modern-di ships a
migration guide
— and one
from dependency-injector.
modern-di— powerful DI framework with scopes.modern-di-aiogram—modern-diintegration for aiogram.modern-di-aiohttp—modern-diintegration for aiohttp.modern-di-arq—modern-diintegration for arq.modern-di-celery—modern-diintegration for Celery.modern-di-fastapi—modern-diintegration for FastAPI.modern-di-faststream—modern-diintegration for FastStream.modern-di-flask—modern-diintegration for Flask.modern-di-grpc—modern-diintegration for gRPC.modern-di-litestar—modern-diintegration for Litestar.modern-di-pytest—modern-diintegration for pytest.modern-di-starlette—modern-diintegration for Starlette.modern-di-taskiq—modern-diintegration for taskiq.modern-di-typer—modern-diintegration for Typer.that-depends— predecessor DI framework, still actively maintained.
Microservices, HTTP & messaging
lite-bootstrap— lightweight package for bootstrapping new microservices.httpware— HTTP client framework with sync/async clients, middleware chain, and built-in resilience (retry, bulkhead).faststream-redis-timers— FastStream broker integration for Redis-backed distributed timer scheduling.faststream-concurrent-aiokafka— concurrent message processing middleware for FastStream withaiokafka.faststream-outbox— FastStream broker integration for the transactional outbox pattern with Postgres.
Utilities
compose2pod— convert a Docker Compose file into a script that runs its services as a single Podman pod.db-retry— retry helpers for database operations.eof-fixer— automatically fix newlines at the end of files.semvertag— auto-tag your GitHub/GitLab repo with semantic version tags from CI.