marimo is an open-source reactive notebook for Python thatâs reproducible, git-friendly (stored as Python files), executable as a script, and deployable as an app.
Traditional Python notebooks excel when used as a visual Python console. But their REPL-like programming model, in which cells can be executed out of order and state persists hidden from view, is problematic for the important tasks that they are used for today.
When youâre running computational experiments, training models, transforming data, and even building tools and pipelines, itâs crucial to be able to reproduce, reuse, version, and share your work as real software artifacts.
The problem with notebooks
If youâve ever used Jupyter notebooks, youâve almost certainly spent hours chasing down bugs due to hidden state â where a variable no longer exists in your code, but still exists in program memory. Youâve almost certainly received a notebook from a colleague that utterly failed to reproduce â when you ran it, you saw outputs different from the ones serialized in the notebook (or maybe it didnât run at all!). You may have tried, and failed, to version your notebooks with git â you changed just one line of code, but the git diff showed an enormous change in the notebookâs JSON representation. You likely have directories cluttered with dozens of UntitledXX.ipynb
files â some of which are mostly copies of other notebooks, since it wasnât really possible to reuse your notebook code as you would regular Python. And you may even have built rudimentary tools in notebooks â but you had no way to make them usable by an audience that didnât know Python.
These problems with Jupyter notebooks are well-known and well-documented. For example, see a recent study by JetBrains that analyzed 10 million notebooks on GitHub and found that 36 percent of them werenât reproducible, as well as Joel Grusâ famous talk on why he dislikes notebooks.
Despite these shortcomings, notebooks are still widely used, and for good reason: the ability to iterate on data and models in memory, visualizing outputs along the way, provides a huge productivity boost over re-executing a script from beginning to end each time you change a line of code.
Building a new programming environment
I can empathize with the pains felt by notebook users because Iâve felt them myself.
My background is in both computer systems â I worked as an engineer at Google Brain, where I worked on TensorFlow and its runtime â and machine learning research â I have a PhD in machine learning and optimization from Stanford university.
I worked with Jupyter notebooks almost daily in my research; having seen engineers invent the future at Google Brain, I was convinced that there must be a way to build a better programming environment for working with data â one that made data tangible and actionable, while also solving the long list of problems that notebooks suffer from.
With feedback from beta users in research institutions and tech companies, I worked for over a year to build marimo, a reactive notebook for Python thatâs reproducible, git-friendly (stored as pure Python files), executable as a script, and deployable as an app.
marimo is now ready for broader use: itâs open source and available at GitHub. Itâs also available on PyPI. Get started with:
Or to create a new notebook, run:
A reactive programming environment
marimo guarantees your code, outputs, and program state are consistent. This solves many problems associated with traditional notebooks like Jupyter.
A reactive programming environment. Run a cell and marimo reacts by automatically running the cells that reference its variables, eliminating the error-prone task of manually re-running cells. Delete a cell and marimo scrubs its variables from program memory, eliminating hidden state.
Deterministic execution order. Notebooks are executed in a deterministic order, based on variable references instead of cellsâ positions on the page. Organize your notebooks to best fit the stories youâd like to tell.
UI elements. marimo comes with UI elements like sliders, a dataframe transformer, and interactive plots that are automatically synchronized with Python [3]. Interact with an element and the cells that use it are automatically re-run with its latest value. Reactivity makes these UI elements more useful and ergonomic than Jupyterâs ipywidgets.
Run apps. Every marimo notebook can be run as an interactive read-only web app, with code hidden: just use marimo run your_notebook.py
.
Execute as scripts. Because marimo notebooks are saved as Python files, you can run them as Python scripts.
Performant runtime. marimo runs only those cells that need to be run by statically analyzing your code. You can optionally disable expensive cells to prevent them from automatically running.
Batteries-included. marimo comes with GitHub Copilot, Black code formatting, HTML export, fast code completion, a VS Code extension, and many more quality-of-life features.
Inspiration
marimo is a reinvention of the Python notebook as a reproducible, interactive, and shareable Python program, instead of an error-prone JSON scratchpad.
We believe that the tools we use shape the way we think â better tools, for better minds. With marimo, we hope to provide the Python community with a better programming environment to do research and communicate it; to run computational experiments and scale them; to learn computer science and teach it.
Our inspiration comes from many places and projects, especially Pluto.jl, ObservableHQ, and Bret Victorâs essays. marimo is part of a greater movement toward reactive dataflow programming. From IPyflow, streamlit, TensorFlow, PyTorch, JAX, and React, the ideas of functional, declarative, and reactive programming are transforming a broad range of tools for the better.
Join the marimo community
Weâre a team of just two developers, and weâre just getting started. If youâre interested in helping shape marimoâs future, here are some ways you can get involved:
- đŹ Chat with us on Discord
- đ§ Subscribe to our newsletter
- âď¸ Join the waitlist for marimo Cloud
- âď¸ Start a GitHub discussion
- đŚ Follow us on Twitter
- đ Star us on GitHub