Calmcode - marimo: introduction

Reactive Notebooks with Marimo

1 2 3 4 5 6 7

Jupyter is a great notebook environment, but there are alternatives these days. Many of them are mere reskins of the original idea but recently we came across a refreshing take on the concept. It's called marimo and the whole point of the environment is that everything reactive. This means that you can write code and see changes immediately without manually running cells.

That means that if your first cell contains this code:

x = 1

And your second cell contains this code:

y = 2

That a third cell with the code x + y will immediately show the sum of these two numbers, even if you change a cell in between. In Jupyter you would have to manually rerun the cells to see the updated result. It is a different take on how to work with a notebook and we felt that it might be worth exploring.

If you are curious about marimo, you can pip install it locally and get started by running:

marimo edit marimo-demo.py

This will start a notebook environment in your browser and you can start writing code immediately. All the code you write will be saved to the marimo-demo.py file.