ASGI LIVE • v1.2.1

The Hybrid Power of Python Web

An ultra-high-performance hybrid web framework merging Flask context-locals, FastAPI validations, Falcon speed, and Sanic listeners into a single event loop.

pip install fenrir-framework

Why Developers Choose Fenrir

⚡ High-Speed ASGI Core

Built directly over modern ASGI specs, achieving massive throughput by eliminating overhead in routing pipelines.

🧩 Paradigm Hybridization

Seamlessly mix FastAPI annotations, Flask contexts, Sanic listeners, Falcon classes, and Bottle mounts inside the same app.

📖 Auto-Generated Specs

Enjoy instantly auto-generated Swagger UI and ReDoc endpoints derived from your Pydantic schemas and route annotations.

🔌 Real-time Comms

Native out-of-the-box support for async WebSockets and Server-Sent Events, making chat systems and streaming ticks a breeze.

Write Flask, FastAPI & Falcon in one file

demo_app.py — Fenrir Web Application
from pydantic import BaseModel
from fenrir import Fenrir, request, render_template

app = Fenrir(title="Fenrir Hybrid App")

# --- 1. FastAPI-Style Pydantic Route ---
class User(BaseModel):
    username: str
    email: str

@app.post("/api/register")
async def register(body: User):
    return {"status": "success", "user": body.model_dump()}

# --- 2. Flask-Style Request Context & Jinja Route ---
@app.get("/")
async def index():
    name = request.args.get("name", "Developer")
    return render_template("index.html", name=name)

# --- 3. Falcon-Style Class-Based Controller ---
class ItemResource:
    async def on_get(self, req, resp, item_id: int):
        resp.status = 200
        resp.media = {"item_id": item_id, "style": "Falcon Class"}

app.add_route("/items/<item_id:int>", ItemResource())

if __name__ == "__main__":
    app.run(host="127.0.0.1", port=8088)