Skip to content

ttmc/marimo1

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Notes on this Repository

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 execution
  • ui: how to use UI elements
  • markdown: how to write markdown, with interpolated values and LaTeX
  • plots: how plotting works in marimo
  • sql: how to use SQL
  • layout: layout elements in marimo
  • fileformat: how marimo's file format works
  • markdown-format: for using .md files in marimo
  • for-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.py

To run a marimo notebook named notebook1.py as an app:

uv run marimo run notebook1.py

If 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 run

To 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 -l

When 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.)

About

Some initial experiments with marimo

Resources

Stars

Watchers

Forks

Languages