Jupyter To Marimo

by marimo-team6454470960d3No license174 starsListed Oct 8, 2026Updated Oct 8, 2026Repository updated 7 weeks ago

Convert a Jupyter notebook (.ipynb) to a marimo notebook (.py).

Instructions onlySoftware Development
AI-generated overview

Converts Jupyter notebooks (.ipynb) into marimo notebooks (.py) and reviews the result.

What it does
Guides an agent through converting a Jupyter notebook to a marimo notebook using the marimo convert command, then reviewing and validating the generated Python file. It covers package metadata, cell arrangement, magic commands, UI controls, gating of expensive work, and secrets handling, with reference files for widgets and LaTeX. The deliverable is a cleaned-up marimo notebook plus validation via marimo check.
When to use it
Use when a Jupyter notebook needs to be migrated or ported to marimo. Also useful when reviewing or fixing an already converted marimo notebook for correctness, presentation, and interactive behavior.
Requirements
Requires the uv/uvx tooling to run marimo convert and marimo check, and access to the source .ipynb file. Ships no scripts; it is instructions only, with two reference documents on widgets and LaTeX.

Converting Jupyter Notebooks to Marimo

Convert first

Important: Run the converter before you read the source notebook:

bash
uvx marimo convert <notebook.ipynb> -o <notebook.py>

Read the .ipynb file only if conversion fails or the generated file omits required information. Treat the generated file as a first draft.

Run this command after conversion and after substantial edits:

bash
uvx marimo check <notebook.py>

Review the conversion

  • Verify all required packages in the PEP 723 metadata. The converter can miss some package-installation forms.
  • Remove residual installation cells and stale installation prose. Add version constraints only when required.
  • Use --sandbox when a notebook uses PEP 723 metadata.
  • Preserve the purpose and intended workflow of the source notebook.
  • Arrange cells for presentation. marimo determines execution order from variable definitions and references.
  • A cell can appear before a cell that defines its input.
  • Merge or split cells when the current boundaries reduce clarity.
  • Remove redundant Jupyter artifacts, such as unnecessary display() calls.
  • Review converted magic commands. Keep valid conversions, and resolve comments that report unsupported magics.
  • Put the value to render in the final expression of each cell.
  • Keep added UI and helper functions proportional to the notebook purpose.
  • Replace interactive input methods that wait for terminal input or do not work in the target interface. Use suitable UI controls, script parameters, or environment values.
  • Do not print, log, or save secrets. Consider EnvConfig for multiple environment values.
  • Identify expensive work and external side effects. If work must wait, gate it with mo.stop() and a suitable UI element.
  • Use a form if the user must submit multiple values together.
  • Define downstream values after the gate so the dependency graph defers dependent cells.
  • Present useful results with simple native components. Add live refresh only when the intended workflow requires it.
  • For ipywidgets, read references/widgets.md [blocked].
  • For LaTeX and MathJax, read references/latex.md [blocked].

Validate the result

  • Run marimo check again after all edits.
  • Run the notebook in each intended mode. Confirm that it has the intended behavior.
  • When practical, open the source and converted notebooks side by side and invite the user to review.
  • Compare content, controls, outputs, and workflow. Cell order and layout can differ.
  • Inspect changed files for secrets, generated data, caches, logs, and other runtime files.

Source and attribution

Source:marimo-team/skillsinskills/jupyter-to-marimoat commit6454470

License: No license

Content belongs to its original authors. SourceWeft indexes it from a public repository.

Report or request removal