marimo-notebook
FeaturedWrite a marimo notebook in a Python file in the right format.
AI & Automation 957 stars
79 forks Updated today MIT
Install
Quality Score: 93/100
Stars 20%
Recency 20%
Frontmatter 20%
Documentation 15%
Issue Health 10%
License 10%
Description 5%
Skill Content
# Notes for marimo Notebooks
marimo uses Python to create notebooks, unlike Jupyter which uses JSON. Here's an example notebook:
```python
# /// script
# dependencies = [
# "marimo",
# "numpy==2.4.3",
# ]
# requires-python = ">=3.14"
# ///
import marimo
__generated_with = "0.20.4"
app = marimo.App(width="medium")
@app.cell
def _():
import marimo as mo
import numpy as np
return mo, np
@app.cell
def _():
print("hello world")
return
@app.cell
def _(np, slider):
np.array([1,2,3]) + slider.value
return
@app.cell
def _(mo):
slider = mo.ui.slider(1, 10, 1, label="number to add")
slider
return (slider,)
@app.cell
def _():
return
if __name__ == "__main__":
app.run()
```
Notice how the notebook is structured with functions can represent cell contents. Each cell is defined with the `@app.cell` decorator and the inputs/outputs of the function are the inputs/outputs of the cell. marimo usually takes care of the dependencies between cells automatically.
## Running Marimo Notebooks
```bash
# Run as script (non-interactive, for testing)
uv run <notebook.py>
# Run interactively in browser
uv run marimo run <notebook.py>
# Edit interactively
uv run marimo edit <notebook.py>
```
## Script Mode Detection
Use `mo.app_meta().mode == "script"` to detect CLI vs interactive:
```python
@app.cell
def _(mo):
is_script_mode = mo.app_meta().mode == "script"
return (is_script_mode,)
```
## Key Principle: Keep It Si...
Details
- Author
- autonomous-ai
- Repository
- autonomous-ai/openharness
- Created
- 1 months ago
- Last Updated
- today
- Language
- C
- License
- MIT
Similar Skills
Semantically similar based on skill content — not just same category
AI & Automation Listed
marimo-notebook
marimo ノートブックを正しいフォーマットでPythonファイルに作成するスキル。 「marimoノートブック作成」「インタラクティブノートブック」「Pythonノートブック」等のリクエストで発動。
347 Updated 3 weeks ago
minicoohei AI & Automation Featured
jupyter-to-marimo
Convert a Jupyter notebook (.ipynb) to a marimo notebook (.py).
957 Updated today
autonomous-ai Data & Documents Listed
notebooks
Author, execute, validate, and convert reproducible marimo or Jupyter notebooks. Use when delivering an analysis notebook with all cells run and figures embedded.
9 Updated 2 weeks ago
fmschulz