pywire Docs
HTML-over-the-wire without the JavaScript hangover.
Overview
Section titled “Overview”pywire is a Python web framework for building interactive UIs without writing client JavaScript. You author single-file .wire components — Python on top, HTML below — and the server streams DOM patches over a WebSocket as your state changes.
If you’ve used Svelte or SolidJS, you’ll feel at home: signals are the primitive, the compiler is the runtime, and templates are HTML.
Why pywire
Section titled “Why pywire”The frontend ergonomics of Svelte. The simplicity of Python.
- Fine-grained reactivity. Wrap a value in
wire()and any template that reads it updates automatically — no hooks, no virtual DOM, no client routing. - One file, two languages.
.wiresingle-file components: a Python fence on top, HTML below. - Live by default. DOM diffs stream from the server. No JSON APIs to invent, no client state to sync.
How it works
Section titled “How it works”Install with pip:
pip install pywireDefine a component in counter.wire:
---count = wire(0)---<p>Count: {count}</p><button @click={count += 1}> Add One</button>Run the app — the server compiles .wire files to Python + HTML and opens a WebSocket. When count changes, only the changed nodes patch over the wire.
Ready to build something? Start with the Quickstart or work through the Interactive Tutorial.