KnowledgeApr 2, 2026·2 min read

Marimo — Reactive Notebook for Python

Next-gen Python notebook that's reactive, reproducible, git-friendly, and deployable as an app. Replaces Jupyter. 20K+ stars.

TL;DR
Marimo replaces Jupyter with reactive execution, git-friendly .py files, and one-command deployment as a web app.
§01

What it is

Marimo is a Python notebook that rethinks how notebooks work. When you change a cell, all dependent cells re-execute automatically, like a spreadsheet. Notebooks are stored as plain .py files, making them git-friendly and diff-able. You can deploy any marimo notebook as an interactive web app with a single command.

Marimo targets data scientists, researchers, and Python developers who have hit Jupyter's limitations: hidden state bugs, non-reproducible execution order, and JSON-based .ipynb files that create messy git diffs.

§02

How it saves time or tokens

This workflow provides installation, notebook creation, and app deployment commands. Instead of configuring Jupyter servers and dealing with kernel management, you get a pip install and a single command to start editing. The reactive execution model eliminates the "run all cells" step that Jupyter requires after every change.

§03

How to use

  1. Install marimo:
pip install marimo
  1. Create and edit a notebook:
# Create a new notebook
marimo edit notebook.py

# Run as an interactive app
marimo run notebook.py

# Convert from Jupyter
marimo convert my_notebook.ipynb > notebook.py
  1. Write cells that react to each other:
import marimo as mo

# Cell 1: Create a slider
slider = mo.ui.slider(1, 100, value=50, label='Sample size')
slider

# Cell 2: Automatically re-runs when slider changes
import numpy as np
data = np.random.randn(slider.value)
mo.stat(f'Mean: {data.mean():.3f}, Std: {data.std():.3f}')
§04

Example

import marimo as mo
import pandas as pd

# Interactive data filtering
df = pd.read_csv('sales.csv')

# Dropdown filter - dependent cells re-run automatically
category = mo.ui.dropdown(
    options=df['category'].unique().tolist(),
    label='Category'
)
category

# This cell re-executes when category changes
filtered = df[df['category'] == category.value]
mo.ui.table(filtered)

# Chart also updates reactively
import altair as alt
chart = alt.Chart(filtered).mark_bar().encode(
    x='month', y='revenue'
)
mo.output.append(chart)
§05

Related on TokRepo

§06

Common pitfalls

  • Marimo enforces that each variable is defined in exactly one cell. This prevents hidden state bugs but requires restructuring existing Jupyter notebooks during conversion.
  • Reactive execution means changing a cell at the top of a chain re-runs all downstream cells. For expensive computations, use marimo's caching to avoid redundant work.
  • Some Jupyter extensions and magic commands do not work in marimo. Check the compatibility guide before migrating complex notebooks.

Frequently Asked Questions

How does marimo's reactivity work?+

Marimo builds a dependency graph between cells based on variable references. When you modify a cell, marimo identifies all cells that depend on its output variables and re-executes them in order. This is similar to how spreadsheet formulas update.

Can I convert existing Jupyter notebooks?+

Yes. Run marimo convert notebook.ipynb > notebook.py to convert a Jupyter notebook to marimo format. Some cells may need manual adjustment due to marimo's stricter variable scoping rules.

How do I deploy a marimo notebook as a web app?+

Run marimo run notebook.py to serve the notebook as an interactive web application. Users interact with UI elements (sliders, dropdowns, tables) without seeing the code. Deploy on any server that runs Python.

Is marimo compatible with existing Python libraries?+

Yes. Marimo works with pandas, numpy, matplotlib, plotly, altair, scikit-learn, and any other Python library. It provides additional UI components (sliders, tables, charts) but does not restrict library usage.

How does git work with marimo notebooks?+

Marimo notebooks are stored as plain .py files with standard Python syntax. Git diffs show meaningful code changes rather than JSON metadata. Merge conflicts are manageable because the format is human-readable.

Citations (3)
🙏

Source & Thanks

Created by marimo-team. Licensed under Apache-2.0.

marimo — ⭐ 20,000+

Discussion

Sign in to join the discussion.
No comments yet. Be the first to share your thoughts.

Related Assets