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.
Why Veloce¶
-
Fast by design
Built on raw
asynciowithorjsonandhttptools. 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, andSecurityScopesresolve from precompiled plans, includingyield-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_modelserialises and filters what goes back out. -
Honest tests
The in-memory
TestClientdrives 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.