Reactive Data Notebooks with marimo in Python (2026) — notebooks that re-run dependents like a spreadsheet, stored as plain Python you can git diff.
If you already push data with DuckDB + Polars or compare engines in Polars vs Pandas, marimo is the interactive layer that stays reproducible.
TL;DR
- Reactive: change a cell → dependents update (no hidden Jupyter state)
- Files are
.py— scripts, apps, and notebooks in one artifact marimo editto author,marimo runto ship a read-only app- SQL cells return DataFrames (Polars preferred)
Install
pip install "marimo[recommended]"
# or: uv add "marimo[recommended]"
marimo tutorial intro
Create and edit
marimo edit analysis.py
# later, as an app (code hidden from the browser):
marimo run analysis.py
# or as a script:
python analysis.py
Tiny reactive sketch
import marimo as mo
import polars as pl
# Cell A
df = pl.DataFrame({
"region": ["North", "South", "East", "West"],
"sales": [1200, 980, 760, 640],
})
# Cell B — re-runs when df changes
summary = df.group_by("region").agg(pl.col("sales").sum())
# Cell C — SQL over a Python frame (requires marimo[sql] / recommended)
# sales_sql = mo.sql("SELECT region, sales FROM df WHERE sales >= 800")
Why teams switch in 2026
- No “forgot to re-run cell 3” bugs
- PR-friendly pure Python notebooks
- Same file is a dashboard via
marimo run
Convert existing Jupyter work with marimo convert notebook.ipynb -o notebook.py.
Production tips
- Start every notebook with
import marimo as mo - Keep side effects (writes, emails) in explicit cells
- Use
uv/venvper project; install plotting/SQL extras as needed - For heavy ETL, keep transforms in Polars/DuckDB modules and call them from cells
Wrap-up
marimo makes notebooks feel like software: reactive dataflow, Git-native files, and a one-command app path — a better default for 2026 data work than classic Jupyter for anything you want to reuse.