Loading repository data…
Loading repository data…
violit-dev / repository
Pure Python Web Framework. Streamlit simplicity, no reruns.
🎉 Featured on OpenSourceProjects.dev: "Stop Overcomplicating Your Data Dashboards"
"Faster than Light, Beautiful as Violet." Structure of Streamlit × Performance of React.
Violit is a Python web framework built on a fine-grained reactive architecture. It preserves the highly productive, top-down Python authoring style loved by the Streamlit community, but eliminates the performance bottlenecks of the full script rerun model.
It starts naturally from data apps and dashboards, but is not limited to them. With built-in ORM/Auth support and Tailwind-style design primitives, Violit also scales well to more general web applications such as admin tools, internal platforms, CRUD systems, and user-facing product UIs.
pip install violit
This demo illustrates the kind of interaction Violit was built for: Python-first UI code with reactive updates that remain snappy and smooth, even as the interface grows more complex.
Violit is designed for developers who love the immediate productivity of Streamlit but need an architecture that scales gracefully as their applications evolve from tiny dashboards to feature-rich web apps.
vl.App(db=...).cls parameter.app.background(...) and app.interval(...).The fundamental difference lies not just in syntax, but in how the framework handles the DOM after a user interacts (clicks, types, or drags).
| Topic | Streamlit | Violit |
|---|---|---|
| Update Model | Full script rerun | Fine-grained reactive updates |
| Interaction Cost | The entire script may re-execute | Only explicitly dependent UI components update |
| Optimization Burden | Often requires workarounds for rerun constraints | Naturally handled by the signal-based architecture |
| App Growth Path | Ideal for quick, simple data views | Designed to scale into richer, stateful app flows |
| Runtime Modes | Browser-focused | WebSocket, Lite, Desktop Native |
| Styling | Basic theming | Themes + Tailwind-like utility styling |
Every Python UI framework has its own unique philosophy and strengths. This matrix compares the structural capabilities of popular frameworks to help you choose the right tool for your specific use case.
| Framework | No Full Rerun | Pure Python (Zero JS/HTML) | SEO / SSR Ready | Desktop Native (exe/app) |
|---|---|---|---|---|
| Streamlit | ❌ | ✅ | ❌ | ❌ |
| Dash / Panel | ✅(Callbacks) | ✅ | ❌ | ❌ |
| NiceGUI | ✅ | ✅ | ❌ | ✅ |
| Reflex | ✅ | ⚠️(React paradigm) | ✅ | ❌ |
| RIO | ✅(React-like) | ✅ | ❌ | ✅(Local mode) |
| Violit | ✅(Signals) | ✅ | ✅ | ✅(Built-in pywebview) |
The snippets below are intentionally minimal. The goal is to highlight how much structural boilerplate each framework requires to express the exact same tiny interaction.
import streamlit as st
name = st.text_input("Name", "Violit")
st.write(f"Hello, {name}")
from nicegui import ui
name = ui.input("Name", value="Violit")
ui.label().bind_text_from(name, "value", lambda v: f"Hello, {v}")
ui.run()
import reflex as rx
class State(rx.State):
name: str = "Violit"
def app():
return rx.vstack(
rx.input(value=State.name, on_change=State.set_name),
rx.text(State.name),
)
import rio
class Page(rio.Component):
name: str = "Violit"
def build(self) -> rio.Component:
return rio.Column(
rio.TextInput("Name", text=self.bind().name),
rio.Text(f"Hello, {self.name}"),
)
import violit as vl
app = vl.App()
name = app.text_input("Name", value="Violit")
app.text(lambda: f"Hello, {name.value}")
app.run()
When a widget owns its own state, bind the return value directly:
name = app.text_input("Name", value="Violit")
When you want a widget to edit an existing external app.state(...), use bind=:
api_key = app.state("")
app.text_input("API key", bind=api_key, type="password")
If both bind= and value= are provided, bind= wins and value= is ignored.
bind= only accepts a writable State.
Use key= for widget identity, not for external state sharing. Explicit widget keys must be unique within the same render scope.
Experience the core Violit philosophy: declare state, bind widgets, and let the runtime update only what's necessary.
import violit as vl
app = vl.App(title="Hello Violit", theme="violit_light_jewel")
count = app.state(0)
name = app.text_input("Project name", value="Violit")
app.title("Build apps in pure Python")
app.text(lambda: f"Hello, {name.value}")
app.metric("Clicks", count)
app.button("+1", on_click=lambda: count.set(count.value + 1))
app.run()
Browser tabs can use favicon=..., while native desktop windows continue to use icon=...:
app = vl.App(
title="Hello Violit",
icon="./my_app.ico",
favicon="./my_app.ico",
)
app.set_favicon("https://example.com/favicon.ico")
Violit bridges the gap between a quick prototype and a production-ready application by offering built-in persistence.
import violit as vl
from sqlmodel import SQLModel, Field
from typing import Optional
class Todo(SQLModel, table=True):
id: Optional[int] = Field(default=None, primary_key=True)
title: str
app = vl.App(db="./todo.db")
app.db.add(Todo(title="Ship first Violit app"))
items = app.db.all(Todo)
app.title("Todo List")
app.text(lambda: f"Total items: {len(items)}")
app.run()
This is where Violit truly separates itself from simple dashboard tools. You can model long-running tasks directly in your Python code without freezing the user interface.
import time
import violit as vl
app = vl.App()
progress = app.state(0)
def work():
for step in range(1, 6):
time.sleep(0.3)
progress.set(step * 20)
task = app.background(work)
app.button("Run task", on_click=task.start)
app.progress(progress)
app.run()
Tip: If you need periodic polling or refreshing, app.interval(...) is also natively supported.
Violit keeps UI customization practical and fast. You can use utility classes without dropping out of Python for every minor CSS adjustment.
app.button(
"Deploy",
cls="rounded-full bg-sky-500 px-6 py-3 text-white shadow-lg hover:bg-sky-600",
)
Under the hood, Violit utilizes a pragmatic, modern stack focused on performance and interactivity.
use_cdn=False keeps Font Awesome icons local-only by default; set use_cdn_fontawesome_only=True to allow remote fallback only for icons missing from the bundled local pack.Violit is evolving rapidly. The core reactive foundation is solid, and several full-stack features are already implemented. Our next steps focus on ecosystem expansion and customization.