If you love Flask but wish it had type hints, automatic OpenAPI docs, dependency injection, and better DX — Flask-Nova is for you.
The Problem with Vanilla Flask
Let’s say you want to build a simple JSON API with Flask. You’d probably write something like:
from flask import Flask, request, jsonify
app = Flask(__name__)
@app.route("/greet", methods=["POST"])
def greet():
data = request.get_json()
name = data.get("name")
return jsonify({"message": f"Hello, {name}!"})
It works. But now imagine:
- You want to validate the request data.
- You want OpenAPI docs for your frontend team.
- You want typed parameters from the URL or query.
- You want better error handling and testing.
- You want some structure, without rewriting everything.
Soon, your simple app becomes a tangle of decorators, manual checks, and custom logic. And if you want more modern tooling like FastAPI offers, you're suddenly looking at rebuilding everything using ASGI and leaving behind the familiar Flask ecosystem.
Flask-Nova is a modern framework built on top of Flask. It brings typed routing, OpenAPI generation, dependency injection, and other developer-friendly features — all while keeping your app fully compatible with the Flask and WSGI world.
What it gives you:
- Typed route parameters
- Automatic Swagger / OpenAPI docs
- Dependency injection via Depend()
- Clean logging and built-in exception handling
- Works with dataclass, pydantic, or plain classes
- No ASGI, no Starlette — just Flask
Why Not Just Use FastAPI?
FastAPI is amazing. But Flask-Nova isn’t trying to replace it.
Instead, Flask-Nova is for developers who:
- Still prefer Flask or are maintaining existing Flask apps
- Want FastAPI-like features but without switching to ASGI
- Need something lightweight, sync-friendly, and deployable anywhere (including platforms where ASGI isn’t easy to run) It’s like giving your old Flask app a supercharged dev experience without a full rewrite.
A Taste of Flask-Nova
from flask_nova import FlaskNova
from pydantic import BaseModel
app = FlaskNova(__name__)
class GreetRequest(BaseModel):
name: str
@app.post("/greet")
def greet(data: GreetRequest):
"""Greet someone
---
Returns a personalized greeting message.
"""
return {"message": f"Hello, {data.name}!"}
- Your request is validated.
- Your route is typed.
- Your docstring becomes OpenAPI docs (auto-generated).
- Swagger UI is available at /docs.
All this, without leaving Flask.
Built-in Tools That Matter
Dependency Injection
from flask_nova import Depend
def get_user():
return {"id": 1, "name": "Alice"}
@app.get("/me")
def me(user=Depend(get_user)):
return {"user": user}
OpenAPI from Docstrings
"""Get current time
---
description: Returns the current UTC time.
responses:
200:
description: Current time in ISO format.
"""
When Should You Use Flask-Nova?
Use Flask-Nova if:
- You like Flask and don’t want to switch to FastAPI
- You want a modern dev experience in a WSGI-compatible setup
- You’re building APIs, microservices, or internal tools with Python
- You want clean, typed code and real documentation — without the hassle
Try It Now
GitHub: https://github.com/treasuremani/flask-nova
Pypi: https://pypi.org/project/flask-nova/
Quickstart Docs: Coming soon!
Flask-Nova isn’t trying to compete with FastAPI — it’s for developers who want to stay in the Flask world while still enjoying modern Python features.
If that sounds like you, give it a try. Drop a star, ask a question, or submit feedback. Let’s build clean, modern APIs — the Flask way.
Top comments (0)