Stario needs Python 3.12 or newer. These docs use uv, but any tool that installs from PyPI works.
uv init --app my-appcd my-appuv add "stario>=5,<6"Or, in an existing project, pip install "stario>=5,<6".
Run an app#
Stario has its own server. main.py ends with asyncio.run(serve(bootstrap)), so the file runs itself.
uv run python main.py # runs onceuvx watchfiles 'uv run python main.py' . # restarts when a file changesThe server listens on http://127.0.0.1:8000. Set STARIO_PORT or STARIO_HOST to change that:
STARIO_PORT=8080 uv run python main.pyOptional: uvloop#
On Linux and macOS, uvloop is a faster event loop. Install the extra and run the app on it.
uv add "stario[uvloop]"import uvloopfrom stario import serve uvloop.run(serve(bootstrap))By the way#
Stario is not ASGI. It does not run under Uvicorn or Hypercorn.
serve()is the server.All settings are environment variables with a
STARIO_prefix. Configuration lists them.Telemetry is on by default. In a terminal you see one tree per request. Telemetry design explains why.
Next: Hello world writes the first app.