This project was started by doing uv init marimo1 and then cd marimo1 to enter the project directory.
Then I added marimo to the project using uv add marimo. (That alters the pyproject.toml file.)
To go through the marimo intro tutorial, I did uv run marimo tutorial intro.
There are more tutorials besides intro:
dataflow: more on marimo's automatic executionui: how to use UI elementsmarkdown: how to write markdown, with interpolated values and LaTeXplots: how plotting works in marimosql: how to use SQLlayout: layout elements in marimofileformat: how marimo's file format worksmarkdown-format: for using.mdfiles in marimofor-jupyter-users: if you are coming from Jupyter
More examples at: https://www.github.com/marimo-team/marimo/tree/main/examples
To create or edit a marimo notebook named notebook1.py:
uv run marimo edit notebook1.pyTo run a marimo notebook named notebook1.py as an app:
uv run marimo run notebook1.pyIf you want to import a particular Python package in a marimo notebook,
you must first install that package into uv's virtual environment. For example,
if you want to import pandas as pd in a marimo notebook, you must first do
uv add pandas.
To export the notebook as a self-contained HTML file that runs using WebAssembly:
uv run marimo export html-wasm notebook1.py -o public --mode runTo determine the total disk usage of all files (recursively) in the public directory:
du -sh --si public(The --si flag makes the output SI, i.e. metric, e.g. Megabytes rather than Mebibytes.)
When I ran the above command in January 2025, the output was 38M, i.e. 38 Megabytes.
In my opinion, that's way too big for a tiny example like notebook1.py.
To determine the total number of files in the public directory (recursively):
find public -type f | wc -lWhen I ran the above command in January 2025, the output was 550, i.e. 550 files.
That's a lot of files for a tiny example like notebook1.py.
When I used a webserver to serve the public directory, it took over ten seconds
for the index.html page to load in my browser. That's unacceptable for my use case
(interactive nonfiction for the general public online). (It might be okay for
someone sharing a notebook with a colleague internally.)