Marimo — Reactive Notebook for Python
Next-gen Python notebook that's reactive, reproducible, git-friendly, and deployable as an app. Replaces Jupyter. 20K+ stars.
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.
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.
How to use
- Install marimo:
pip install marimo
- 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
- 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}')
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)
Related on TokRepo
- AI tools for research -- Tools for data analysis and research
- AI coding tools -- Developer productivity tools
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
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.
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.
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.
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.
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)
- Marimo GitHub— Marimo is a reactive Python notebook with git-friendly storage
- Marimo Documentation— Reactive execution model with automatic cell dependency tracking
- Marimo App Deployment— Deploy notebooks as interactive web applications
Related on TokRepo
Source & Thanks
Created by marimo-team. Licensed under Apache-2.0.
marimo — ⭐ 20,000+
Discussion
Related Assets
Conda — Cross-Platform Package and Environment Manager
Install, update, and manage packages and isolated environments for Python, R, C/C++, and hundreds of other languages from a single tool.
Sphinx — Python Documentation Generator
Generate professional documentation from reStructuredText and Markdown with cross-references, API autodoc, and multiple output formats.
Neutralinojs — Lightweight Cross-Platform Desktop Apps
Build desktop applications with HTML, CSS, and JavaScript using a tiny native runtime instead of bundling Chromium.