Skip to main content

Stario - High-performance Python web framework

Project description

stario-logo

Real-time hypermedia for Python 3.14+


Documentation: stario.dev · Source: github.com/bobowski/stario


What is Stario?

Stario is a Python web framework for real-time hypermedia. While most frameworks treat HTTP as request → response, Stario treats connections as ongoing conversations — open an SSE stream, push DOM patches, sync reactive signals.

Why Stario?

  • Real-time first — SSE streaming, DOM patching, reactive signals built-in
  • Hypermedia — Native Datastar integration, no JavaScript frameworks needed
  • Simple — Go-style handlers (Context, Writer) → None
  • Fast — Built on httptools with zstd/brotli/gzip compression

Example: Multiplayer Counter

A real-time counter in a single file:

import asyncio
from stario import Stario, Context, Writer, Relay, RichTracer
from stario.html import Div, Button, H1
from stario.datastar import data, at

relay = Relay()
count = 0

async def home(c: Context, w: Writer) -> None:
    w.html(
        Div({"id": "app"},
            data.signals({"count": count}),
            data.init(at.get("/stream")),
            H1("Multiplayer Counter"),
            Div({"id": "count"}, data.text("$count"), str(count)),
            Button(data.on("click", at.post("/inc")), "+1"),
        )
    )

async def stream(c: Context, w: Writer) -> None:
    w.sync({"count": count})
    async for _ in w.alive(relay.subscribe("counter")):
        w.sync({"count": count})

async def increment(c: Context, w: Writer) -> None:
    global count
    count += 1
    w.empty()
    relay.publish("counter", None)

async def main():
    with RichTracer() as tracer:
        app = Stario(tracer)
        app.get("/", home)
        app.get("/stream", stream)
        app.post("/inc", increment)
        await app.serve()

if __name__ == "__main__":
    asyncio.run(main())

Get Started

Install with uv add stario or pip install stario, then run stario init to create a new project. Requires Python 3.14+.

See the documentation for tutorials, API reference, and how-to guides.


Stario: Real-time hypermedia, made simple.

Project details


Release history Release notifications | RSS feed

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

stario-2.0.1.tar.gz (102.0 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

stario-2.0.1-py3-none-any.whl (117.9 kB view details)

Uploaded Python 3

File details

Details for the file stario-2.0.1.tar.gz.

File metadata

  • Download URL: stario-2.0.1.tar.gz
  • Upload date:
  • Size: 102.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.9.24 {"installer":{"name":"uv","version":"0.9.24","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

File hashes

Hashes for stario-2.0.1.tar.gz
Algorithm Hash digest
SHA256 e7b659cf5171bf0603f5d9f5b0c585402055d204debeea3ad9bd2ac6d1a83c90
MD5 e75b973cd980a389d98a773e969b9f00
BLAKE2b-256 a4ace78e209f744bba42b84e21ddefd9b364b64c8b55e18f47215e7da819b554

See more details on using hashes here.

File details

Details for the file stario-2.0.1-py3-none-any.whl.

File metadata

  • Download URL: stario-2.0.1-py3-none-any.whl
  • Upload date:
  • Size: 117.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.9.24 {"installer":{"name":"uv","version":"0.9.24","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

File hashes

Hashes for stario-2.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 79875b0af1bf8e131a29c4ac609d8404ef43794989e965a684f6ec4e4ceb96d6
MD5 19171c9d26faf7bf472a69e624e1bd5a
BLAKE2b-256 2bb21962dd852089fd7b2597f9be64af561b9b75e27304e8bdd67689eb2d9b18

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page