Glossary
Short definitions for terms that show up across Stario docs and code.
Package layout
Stario splits compile-time URL building from HTTP wire code:
| Import from | Use for |
|---|---|
stario | Daily handler types: App, Context, Writer, UrlPath, AssetManifest, StaticAssets, Span, Relay, exceptions |
stario.routing | URL language only (UrlPath, normalize_path) — safe in routes modules and templates without pulling HTTP |
stario.http | Request/response types, Router, normalized_location; embed Server from stario.http.server |
stario.staticassets | Same as root re-exports; explicit when documenting asset pipelines |
stario.responses / stario.cookies | Writer helpers |
stario.datastar | data, at, SSE, read_signals, ModuleScript |
stario.markup | HTML/SVG trees (from stario.markup import html as h) |
from stario import UrlPath and from stario.routing import UrlPath are equivalent.
For multi-file app conventions, see Structuring larger applications (general tree + chat-room reference layout).
Terms
| Term | Meaning |
|---|---|
App | The concrete HTTP application type (Router + __call__, on_error, create_task, app.shutdown, shutting_down). See Runtime. |
AssetManifest | Scans a static directory at construction (typically module level), fingerprints files, and builds URLs with href(). See Static assets. |
Attrs | Pre-rendered opening-tag attribute bytes from stario.markup helpers (classes, styles, data, aria) and from stario.datastar.data for Datastar attributes. See HTML. |
| Bootstrap | Async generator bootstrap(app, span) with a single yield, loaded by the CLI as module:callable; wires routes, assets, and shared services. See Application lifecycle. |
Context (c) | Per-request: app, req, span, route, state, plus disconnect/shutdown helpers (closing, alive()). See Request and context. |
| Datastar | Browser runtime plus stario.datastar (attributes, actions, signals, SSE). Datastar reference. |
| Handler | async def handler(c: Context, w: Writer) -> None. See Handlers, context, and the writer. |
| HTML | Document trees built with stario.markup. HTML reference. |
| Middleware | (inner: Handler) -> Handler; composed at registration time with app.use(pattern, *middleware). See Routing — Middleware. |
Relay | In-process pub/sub with dotted subjects; not a cross-process broker. Toolbox — Relay. |
| Route trie | Matcher for host segments, path segments, and HTTP method. Routing. |
Server | Asyncio listener around an App; import from stario.http.server. See Runtime — Server. |
| Signals | JSON-shaped client/server state in Datastar. Datastar. |
SSE | stario.datastar.SSE — one server-sent event stream per response, bound to a Writer. |
| Span / event / attribute | Telemetry primitives on the span handle. Telemetry. |
StaticAssets | Serves files from an AssetManifest; call register(app) to attach GET/HEAD routes. See Static assets. |
| Tracer | Creates spans and exports finished records; TTY, JSON, SQLite, NoOp, or custom. Telemetry. |
UrlPath | Typed path (and optional host) pattern; pass host= when creating the pattern (UrlPath("/api", host="…")), then call href() for URLs. See Routing. |
Writer (w) | Outbound HTTP: status, headers, body, streams. Responses — Writer. |