marimo export
Export marimo notebooks to various formats for sharing, deployment, or integration with other tools.Usage
Export Formats
- html - Interactive HTML with outputs
- html-wasm - Standalone WASM-powered HTML (runs Python in browser)
- pdf - PDF document or slides
- script - Flat Python script
- md - Markdown with code fences
- ipynb - Jupyter notebook
- thumbnail - Generate notebook thumbnail
- session - Export notebook session data
marimo export html
Export a notebook as an interactive HTML file with outputs.Usage
Options
—include-code / —no-include-code - Include notebook code in HTML- Type: Flag
- Default:
True
- If not provided, HTML is printed to stdout
- Default:
False - Uses watchdog if available, otherwise polls every 1s
- Requires
uv
- Default:
False
Examples
marimo export html-wasm
Export as a standalone WASM-powered HTML file that runs Python in the browser.Usage
Options
-o, —output PATH - Output directory or HTML file (required) —mode MODE - Notebook mode (required)- Choices:
edit,run edit: Code is editable in browserrun: Code is read-only
- Default:
False
- Default:
False
- Default:
False - Generates
index.jsandwrangler.jsoncfor easy deployment
Examples
Notes
- Uses Pyodide to run Python in the browser
- Must be served over HTTP (not
file://) - Not all Python packages are supported by Pyodide
- Creates
.nojekyllfile for GitHub Pages compatibility
marimo export pdf
Export a notebook as a PDF document or slides.Usage
Options
-o, —output PATH - Output PDF file (required) —include-outputs / —no-include-outputs - Run and include outputs- Default:
True
- Default:
True
- Default:
True - If disabled, tries standard PDF (pandoc + TeX) first, falls back to WebPDF
- Default:
True - Converts interactive widgets to static images
- Type: Float (1.0-4.0)
- Default:
4.0
- Choices:
static,live - Default:
static - Use
livefor outputs requiring Python connection
- Choices:
document,slides slides: Export as reveal.js slides- Auto-detected if notebook uses slides layout
Dependencies
Requires:nbformat, nbconvert, nbconvert[webpdf]
For rasterization: playwright
Examples
marimo export script
Export as a flat Python script in topological order.Usage
Options
-o, —output PATH - Output script file- If not provided, script is printed to stdout
Examples
marimo export md
Export as a code-fenced Markdown file.Usage
Options
-o, —output PATH - Output Markdown file —watch / —no-watch - Watch for changes —sandbox / —no-sandbox - Run in isolated environment -f, —force - Force overwriteExamples
marimo export ipynb
Export as a Jupyter notebook.Usage
Options
-o, —output PATH - Output .ipynb file —sort MODE - Cell sort order- Choices:
top-down,topological - Default:
topological
- Default:
False
Dependencies
Requires:nbformat
Examples
Common Options
These options are available for most export commands: —watch / —no-watch - Watch the notebook for changes and regenerate output- Uses
watchdogif installed, otherwise polls every 1 second - Requires
--outputto be specified
uv run --isolated
- Requires
uvto be installed - Useful for ensuring reproducible exports
Tips
- Use
--watchduring development for live previews - For production HTML exports, consider
html-wasmfor fully self-contained apps - PDF exports work best with
--as=slidesfor presentation notebooks - Use
--sandboxfor reproducible exports with isolated dependencies - Combine
--forcewith--watchto avoid prompts
Related Commands
- marimo run - Run notebooks as apps
- marimo convert - Convert notebooks from other formats