A Databricks-first Python UI framework for building secure dashboards, portals, and web apps with pure Python.
Project description
BricksFlowUI
Canonical package name:
bricksflowuiInstall with:
pip install bricksflowuiImport with:
import brickflowui as dbStart here:
Release Notes
- PyPI package name is now
bricksflowui - CLI commands supported:
brickflowuiandbricksflowui - Standard Python import remains
brickflowui - Source distributions and wheels include bundled frontend assets plus docs/examples
Databricks-first, React-style Python UI library for building composable, production-ready Databricks Apps โ without writing a single line of JavaScript.
What is BricksFlowUI?
BricksFlowUI lets data engineers build beautiful, interactive Databricks Apps in pure Python. It ships a pre-built React frontend and communicates over WebSocket, so you get:
- โก No full-script reruns โ only changed components re-render (unlike Streamlit)
- ๐งฉ React-style component model โ composable functions, hooks, one-way data flow
- ๐ Databricks-native โ reads
DATABRICKS_APP_PORT, Unity Catalog helpers, SQL warehouse wrappers - ๐จ Beautiful dark theme โ Databricks-inspired design system, no CSS required
Quick Start
pip install bricksflowui
# Scaffold a new app
brickflowui new my_app
cd my_app
# Run locally
brickflowui dev
# โ open http://localhost:8050
Or manually:
# app.py
import brickflowui as db
app = db.App(title="My Databricks App")
@app.page("/", title="Home", icon="Home")
def home():
count, set_count = db.use_state(0)
return db.Column([
db.Text("Counter", variant="h1"),
db.Text(f"Count: {count}", variant="h3"),
db.Button("Increment", on_click=lambda: set_count(count + 1)),
], padding=6)
if __name__ == "__main__":
app.run()
Core Concepts
Components
Every UI element is a plain Python function returning a VNode:
import brickflowui as db
# Layout
db.Column(children, gap=4, padding=6)
db.Row(children, gap=2, justify="between")
db.Grid(children, cols=3, gap=4)
db.Card(children, title="My Card")
# Typography
db.Text("Hello!", variant="h1") # h1, h2, h3, h4, body, caption, label, code
# Controls
db.Button("Click me", on_click=handler, variant="primary")
db.Input(name="q", label="Search", on_change=setter)
db.Select(name="w", options=[{"label": "A", "value": "a"}], on_change=setter)
db.Checkbox(name="x", label="Enable", on_change=setter)
db.Toggle(name="y", label="Dark mode", on_change=setter)
db.Slider(name="s", min=0, max=100, on_change=setter)
# Data
db.Table(data=rows, columns=[{"key": "id", "label": "ID"}], pagination=20)
db.Badge("Active", color="green")
db.Alert("Something went wrong", type="error")
db.Progress(value=65, max=100)
db.Stat(label="Queries", value="248K", delta="+12%", delta_type="increase")
# Charts
db.AreaChart(data=rows, x_key="date", y_keys=["value"], colors=["#FF3621"])
db.BarChart(data=rows, x_key="category", y_keys=["count"])
db.LineChart(data=rows, x_key="day", y_keys=["metric"])
db.DonutChart(data=rows, value_key="count", label_key="name")
# Navigation
db.Tabs([db.TabItem("Tab A", [db.Text("Content A")]), ...])
db.Sidebar([db.NavItem("Home", "/", icon="Home"), ...], brand_name="My App")
db.Modal(visible=True, title="Confirm", children=[...], on_close=handler)
# Forms
db.Form(action="/api/submit", success_redirect="/", children=[
db.Input(name="username", label="Username"),
db.Button("Submit", html_type="submit"),
])
# Databricks-specific
db.CatalogBrowser(on_select=handler)
db.WarehouseSelector(on_select=handler)
db.JobTrigger(job_id="123", label="Run Pipeline")
State (Hooks)
@app.page("/")
def my_page():
count, set_count = db.use_state(0) # local state
data = db.use_memo(load_data, deps=[count]) # memoized compute
db.use_effect(lambda: print("mounted"), []) # side effects
theme = db.use_context("theme") # session context
return db.Button(str(count), on_click=lambda: set_count(count + 1))
Multi-page Apps
app = db.App(title="Ops Hub")
@app.page("/", title="Dashboard", icon="LayoutDashboard")
def dashboard(): ...
@app.page("/tables", title="Tables", icon="Database")
def tables(): ...
@app.page("/settings", title="Settings", icon="Settings")
def settings(): ...
Auth And Access Control
import brickflowui as db
app = db.App(
title="Ops Hub",
auth_mode="hybrid", # "app", "user", or "hybrid"
auth_provider=db.HeaderAuthProvider(),
)
@app.page("/", title="Home")
def home():
principal = db.current_principal()
return db.Text(f"Hello {principal.display_name or principal.subject}")
@app.page("/admin", title="Admin", access="user", roles=["admin"])
def admin():
user = db.require_role("admin")
return db.Text(f"Welcome, {user.subject}")
@app.route("/api/profile", methods=["GET"], access="user")
async def profile():
user = db.require_auth()
return {"user": user.subject, "roles": list(user.roles)}
access supports:
publicรขโฌโ anyone can access itauthenticatedรขโฌโ any authenticated principaluserรขโฌโ requires a signed-in user identityappรขโฌโ restricted to the shared application identity
Branding And Themes
app = db.App(theme="branding.yaml")
Example branding.yaml:
branding:
title: "Acme Ops Portal"
logo: "/static/acme-logo.svg"
favicon: "/static/acme-favicon.ico"
colors:
primary: "#FF5F2E"
primary_hover: "#D9481C"
background: "#F7F7F5"
surface: "#FFFFFF"
text: "#18181B"
text_muted: "#71717A"
border: "#E4E4E7"
typography:
font_family: "'IBM Plex Sans', sans-serif"
base_size: "15px"
spacing:
unit: "6px"
borders:
radius: "14px"
Supported theme model sections:
branding:title,logo,faviconcolors:primary,primary_hover,background,surface,text,text_muted,border,success,warning,error,linktypography:font_family,font_mono,base_sizespacing:unitborders:radius
You can also keep using the lower-level internal keys like primary-hover, bg, text-muted, sans, and base-size if you prefer.
Custom API Routes
@app.route("/api/submit", methods=["POST"])
async def submit_handler():
from fastapi.responses import JSONResponse
return JSONResponse({"status": "ok"})
Databricks Integration
SQL Queries
from brickflowui.databricks import sql
# Returns a pandas DataFrame
df = sql.query("SELECT * FROM catalog.schema.table LIMIT 100")
# Returns list[dict] (for db.Table component)
rows = sql.query_to_records("SELECT id, name FROM my_table")
return db.Table(data=rows)
Set environment variables (or use app.yaml):
DATABRICKS_HOST=https://adb-xxx.azuredatabricks.net
DATABRICKS_TOKEN=dapiXXXXXXXX
DATABRICKS_WAREHOUSE_ID=your-warehouse-id
Unity Catalog
from brickflowui.databricks import uc
catalogs = uc.list_catalogs()
schemas = uc.list_schemas("main")
tables = uc.list_tables("main", "gold")
rows = uc.get_table("main", "gold", "fact_orders", limit=50)
Deploying to Databricks Apps
app.yaml
command:
- python
- app.py
env:
- name: DATABRICKS_WAREHOUSE_ID
value: your-warehouse-id
Then in the Databricks workspace:
- Create a new Databricks App
- Upload your project as a ZIP (include
app.py,app.yaml,requirements.txt) - The app binds to
DATABRICKS_APP_PORTautomatically
requirements.txt
bricksflowui>=0.1.0
# bricksflowui[databricks] # for SQL + Unity Catalog
CLI Reference
| Command | Description |
|---|---|
brickflowui new <name> |
Scaffold a new app |
brickflowui dev |
Run local dev server (hot reload) |
Project Structure
brickflowui/
โโโ __init__.py # Public API
โโโ app.py # App class
โโโ vdom.py # Virtual DOM + diff algorithm
โโโ state.py # Hooks (use_state, use_effect, use_memo)
โโโ components.py # All component primitives
โโโ server.py # FastAPI ASGI + WebSocket server
โโโ cli/
โ โโโ main.py # CLI (typer)
โ โโโ templates/ # App scaffolding templates
โโโ databricks/
โ โโโ env.py # DATABRICKS_* env helpers
โ โโโ sql.py # SQL connector wrappers
โ โโโ uc.py # Unity Catalog helpers
โโโ frontend/
โโโ dist/ # Pre-built React bundle (served automatically)
examples/
โโโ counter/ # Minimal Counter example
โโโ demo_app/ # Full multi-page dashboard demo
โโโ app.py
โโโ app.yaml
โโโ requirements.txt
Architecture
Python App (app.py)
โ
โ Component tree (VNode)
โผ
BrickflowUI Runtime
โ FastAPI ASGI Server
โ WS /events โโโโ JSON patches โโโโโถ React Frontend
โ GET / โโโโ HTML shell โโโโโโ
โ GET /static/* โโโโ React bundle โโโโ
โ
โผ
Databricks Runtime
(DATABRICKS_APP_PORT, SQL warehouse, Unity Catalog)
License
MIT ยฉ BrickflowUI Contributors
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file brickflowui-0.1.0.tar.gz.
File metadata
- Download URL: brickflowui-0.1.0.tar.gz
- Upload date:
- Size: 53.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
74bf5da6f8abc05212289b39a47ec21c8db88a7c6f12fa211224246afddcfaeb
|
|
| MD5 |
1714a1d6e2fdc98e4df20c942dca5a3c
|
|
| BLAKE2b-256 |
d13a0d9a64fe54407db148d3f18721b2327ef61273e300d8723ca106344e185e
|
Provenance
The following attestation bundles were made for brickflowui-0.1.0.tar.gz:
Publisher:
publish.yml on AjayAJ2000/brickflowUI
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
brickflowui-0.1.0.tar.gz -
Subject digest:
74bf5da6f8abc05212289b39a47ec21c8db88a7c6f12fa211224246afddcfaeb - Sigstore transparency entry: 1192075400
- Sigstore integration time:
-
Permalink:
AjayAJ2000/brickflowUI@7b469c42728d449dd266da20603acf7ce3fb8ee5 -
Branch / Tag:
refs/heads/main - Owner: https://github.com/AjayAJ2000
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@7b469c42728d449dd266da20603acf7ce3fb8ee5 -
Trigger Event:
workflow_dispatch
-
Statement type:
File details
Details for the file brickflowui-0.1.0-py3-none-any.whl.
File metadata
- Download URL: brickflowui-0.1.0-py3-none-any.whl
- Upload date:
- Size: 39.1 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
585a2e3595092d80add6cbd0e2b1c67f9022640d57fa7f61dc44f66fed905da7
|
|
| MD5 |
7658a591e063fbf843d338fd9afa42e6
|
|
| BLAKE2b-256 |
ba720ea201d3806e404fc28b3052f14624473beb42780a7954341d90846fb5f7
|
Provenance
The following attestation bundles were made for brickflowui-0.1.0-py3-none-any.whl:
Publisher:
publish.yml on AjayAJ2000/brickflowUI
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
brickflowui-0.1.0-py3-none-any.whl -
Subject digest:
585a2e3595092d80add6cbd0e2b1c67f9022640d57fa7f61dc44f66fed905da7 - Sigstore transparency entry: 1192075401
- Sigstore integration time:
-
Permalink:
AjayAJ2000/brickflowUI@7b469c42728d449dd266da20603acf7ce3fb8ee5 -
Branch / Tag:
refs/heads/main - Owner: https://github.com/AjayAJ2000
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@7b469c42728d449dd266da20603acf7ce3fb8ee5 -
Trigger Event:
workflow_dispatch
-
Statement type: