Larz โบ Async Python web framework
Async, without giving up zero dependencies
Larz's app object is dual-protocol โ it runs under WSGI and ASGI โ so you can write
async def handlers and WebSockets, and run them with nothing extra installed.
pip install larz
@app.get("/feed")
async def feed(req):
data = await fetch_async() # await anything
return {"items": data}
app.run_async() # built-in asyncio server, no uvicorn needed
How it works
- Dual-protocol โ the same
appis a valid WSGI and ASGI callable; Larz detects which server is calling. - async or sync handlers โ
async defhandlers are awaited; plain ones run directly. Mix freely. - WebSockets โ first-class, with
@app.websocket. - Built-in async server โ
app.run_async()serves HTTP and WebSockets over pure asyncio; use uvicorn/hypercorn in production if you prefer.
Honest note: Larz is a young framework. For maximum async throughput and a vast
ecosystem, FastAPI is more mature. Choose Larz for zero dependencies, built-in monetization, and
self-hosting.
FAQ
Do I need uvicorn?
No โ Larz ships a built-in zero-dependency asyncio server (app.run_async) for HTTP and WebSockets. You can still use uvicorn/hypercorn since the app is a standard ASGI callable.
Can I mix async and sync handlers?
Yes. async def handlers are awaited and sync handlers run directly, so you can adopt async gradually.