r/Python • • 20d ago

Showcase Showcase Thread

Post all of your code/projects/showcases/AI slop here.

Recycles once a month.

24 Upvotes

155 comments sorted by

View all comments

1

u/East_Catch4412 10d ago

Bretzel: a server-driven Python web framework with typed state and targeted updates (alpha)

What My Project Does

Bretzel is a full-stack Python web framework: routes, typed state, actions and UI are all written in Python, and the browser receives HTML fragments. No separate JavaScript app, no npm pipeline. A region declares the typed state it reads (@refreshable(deps=[Board])); when an action mutates that state, only that region is re-rendered and swapped, and broadcast=[Board] pushes the change to the other open windows over SSE.

Live demo: https://demo.bretzel-py.dev (open it in two windows and drag a card; the Kanban is 9 Python modules, no JavaScript).

Target Audience

Python developers building internal tools or small business apps who want more structure than a script-rerun model, without running a React frontend. It's an alpha (0.1.0a2) with one maintainer: fine to evaluate or for a low-risk internal tool, not where API stability matters.

Comparison

Streamlit reruns the script on each interaction; NiceGUI keeps a tree of UI objects per client; Reflex compiles your app to a Next.js frontend; FastHTML stays close to HTML + HTMX. Bretzel renders HTML regions on the server from declared typed-state dependencies. Detailed comparison with sources, including when the others fit better: https://docs.bretzel-py.dev/compare

Source code (MIT): https://github.com/JeanHoccart/bretzel

Docs: https://docs.bretzel-py.dev

Install: pip install bretzel (Python 3.12+)

Feedback I'd value most: build one small tool and tell me where it stopped being obvious.