Skip to content

async · ASGI-native · typed

Veloce

Fast, ergonomic async Python web framework. Routing, dependency injection, OpenAPI, WebSockets, templating, sessions, and a built-in test client — all in one tree.

Get started API reference

Why Veloce

  • Fast by design


    Built on raw asyncio with orjson and httptools. Handler signatures are inspected once at registration — no reflection on the request hot path.

  • Radix-tree routing


    Path parameters are matched and type-coerced during tree traversal, with built-in int, float, uuid, path, and custom converters.

  • Typed dependency injection


    Depends, Security, and SecurityScopes resolve from precompiled plans, including yield-style dependencies with teardown.

  • Batteries included


    OpenAPI 3.1, WebSockets, Server-Sent Events, background tasks, middleware, signed sessions, and signals — all in core.

  • Validated, both ways


    Pydantic v2 validates request bodies; response_model serialises and filters what goes back out.

  • Honest tests


    The in-memory TestClient drives the real ASGI surface — middleware, encoding, and cookies included.

A first look

from veloce import Veloce, Request

app = Veloce()


@app.get("/hello/{name}")
async def hello(name: str):
    return {"hello": name}


if __name__ == "__main__":
    app.run(host="0.0.0.0", port=8000)

Type-annotated path parameters are coerced automatically, dictionaries become JSON responses, and the route is registered on the radix tree at import time.

Read the getting-started guide