Back to Marimo

Examples

examples/README.md

0.23.52.4 KB
Original Source

Examples

This folder contains example marimo notebooks, meant to teach you how to use marimo's features as well as inspire you to make awesome notebooks.

  • ๐Ÿ–ฑ๏ธ ui/: how to use UI elements or widgets
  • ๐Ÿ›ข๏ธ sql/: how to use SQL in marimo
  • โ›ฒ control_flow/: how to control cell execution and output display
  • ๐Ÿ“ markdown/: how to write markdown, including dynamic markdown
  • ๐Ÿ“ฝ๏ธ layouts/: how to present notebooks as slides, add sidebars, and more
  • ๐Ÿค– ai/: AI-related examples
  • ๐Ÿงช testing/: how to test marimo notebooks, and use marimo notebooks as tests
  • ๐Ÿ“ฆ third_party/: using popular third-party packages in marimo
  • โ˜๏ธ cloud/: using various cloud providers
  • ๐Ÿงฉ frameworks/: integrating with different frameworks (web/ASGI)
  • โœจ misc/: miscellaneous topical examples

[!TIP] New to marimo? Run marimo tutorial intro at the command line first!

[!TIP] Check out our public gallery of interactive notebooks to get inspired.

[!NOTE] Submit a pull request to add an example! We especially welcome library developers to add examples to third_party/.

Running examples

The requirements of each notebook are serialized in them as a top-level comment. Here are the steps to open an example notebook:

  1. Install uv
  2. Open an example with marimo edit --sandbox <notebook-url>.

For example:

bash
uvx marimo edit --sandbox https://github.com/marimo-team/marimo/blob/main/examples/misc/seam_carving.py

[!TIP] The --sandbox flag opens the notebook in an isolated virtual environment, automatically installing the notebook's dependencies ๐Ÿ“ฆ

You can also open notebooks without uv, in which case you'll need to manually install marimo first. Then run marimo edit <notebook.py>; however, you'll also need to install the requirements yourself.

More examples ๐ŸŒŸ

Every week, we highlight stellar examples and projects from our community. Check them out at our marimo spotlights repo!