Typed state
Choose the scope that matches the lifetime: page, session, user, app, or client-only.
Bretzel is a full-stack Python framework where the server owns the state and the browser follows—updating only the part of the page that changed.
The public Kanban board is isolated per browser session and resets periodically.
class Counter(SessionState): value: int = 0 def increment() -> None: Counter().value += 1 @refreshable def count() -> None: ui.heading(str(Counter().value)) ui.button("+1", on_click=increment)
Declare what a region reads. Change typed state anywhere on the server. Bretzel finds the dependent region, renders it, and swaps that fragment in the browser.
Choose the scope that matches the lifetime: page, session, user, app, or client-only.
A region follows the state fields it reads, so updates stay local instead of rerunning the app.
No manual refresh call. No second client store. Mutating state is enough.
Start with the live board, browse every component under the theme you pick, then explore the documentation and the source for all example apps.
Drag cards between columns, archive one, and try undo and redo.
Every component in real uses, with its Python code — and a theme studio that repaints them all.
Follow the quickstart and inspect the components and drag-and-drop modes.
The other examples are available to run from the repository.
Rich components and server-driven HTML, without turning your application into a JavaScript build project.
Declare broadcast= when an application should send state changes to other open windows over SSE. The public Kanban demo instead keeps each visitor's board in a separate session; its drag-and-drop, limits, and undo/redo work within that board.
Forms, overlays, navigation, data tables, server-rendered SVG charts, security headers, signed actions, OAuth/OIDC doors, and more.
bretzel describe exposes the exact API. bretzel check catches structural mistakes, including a deep application check.
It sits between script-style app tools and a hand-built frontend: a Python-native application model with explicit state and targeted rendering.
Bretzel does not keep a per-tab server-side UI object tree. Typed state and declared dependencies determine which HTML region is rendered and sent.
Bretzel serves HTML fragments directly instead of compiling your Python app into React. There is no Node or Bun build pipeline to operate.
Bretzel adds a typed state model, targeted reactive regions, and 100+ integrated components on top of the server-rendered approach.
Bretzel 0.1.0a2 is the latest public alpha. APIs may change, and the project currently has one maintainer. It is ready for people willing to build a small internal tool, find the rough edges, and shape the model with real feedback.
Install the alpha, generate an app, and run it locally. Start small; bring back the confusing parts.
pip install bretzel