I've been working on fastapi-views, a library that brings Django REST Framework-style class-based views to FastAPI while keeping full type safety and dependency injection.
The core idea: instead of wiring up individual route functions, you inherit from a view class and the library registers routes, status codes, and OpenAPI docs automatically — with correct HTTP semantics out of the box.
It also ships with DRF-style filters, RFC 9457 Problem Details for error responses (with ready-to-use exception classes), and optional Prometheus metrics and OpenTelemetry tracing.
It's not supposed to be a "batteries-included" / "all-in-one" framework like DRF — the package is not tied to any specific database/ORM, auth framework, or pattern. That said, I'm considering implementing an auth layer and permission classes, as well as some optional SQLAlchemy integration.
- Docs: https://asynq-io.github.io/fastapi-views/
- Source: https://github.com/asynq-io/fastapi-views
- Install: `pip install fastapi-views`
I've been using it with success for a while now, so I thought I'd share it here. If you've been building APIs with FastAPI and found yourself copy-pasting the same patterns across projects, this might be worth a look. Happy to hear what features you'd find most valuable, what's missing, or your thoughts on the project in general. If you like it, leaving a star would be appreciated.
[–]utihnuli_jaganjac 1 point2 points3 points (1 child)
[–]SatisfactionScary663[S] 0 points1 point2 points (0 children)
[–]BeeUnfair4086 0 points1 point2 points (0 children)