marimo-export
The marimo-export Python package plans, prepares, writes, opens, and verifies
notebook exports from saved marimo notebooks or named live sessions.
uv adds the package to a Python project:
uv add marimo-export
The package requires Python 3.10 or newer, is tested on Python 3.10 through 3.14, and installs the marimo release pinned by its package metadata.
The examples use the repository's
report.py
and
report.export.yaml.
Download both files into the current directory before running them.
Run the CLI from PyPI
uvx marimo-export build report.py \
--spec report.export.yaml \
--output dist/report
uvx marimo-export verify dist/report
build prepares missing states, writes the export, verifies every declared
asset, and closes the notebook process it started.
Build from Python
from pathlib import Path
from marimo_export import ExportSpec, build
Path("dist").mkdir(exist_ok=True)
spec = ExportSpec.from_file("report.export.yaml")
result = build("report.py", spec=spec, output="dist/report")
print(result.path)
A matching later call with a new destination or replace=True can reuse the
prepared export before notebook startup.
Read the export
from marimo_export import open_export, verify_export
export = open_export("dist/report")
summary = export.state("monthly").output("summary").json()
verified = verify_export("dist/report")
print(dict(summary))
print(verified.states, verified.outputs)
{'days': 30, 'label': 'Last 30 days'}
2 2
Opening validates canonical index.json and leaves asset data lazy. Complete
verification reads every declared asset and returns exported-state,
state-output-pair, unique-asset, and verified-byte counts. The example has two
states and one output name, so verified.outputs is 2.
Capture a live session
After opening report.py in a running marimo server, capture() borrows the
named session and returns a leased PreparedExport:
from marimo_export import ExportSpec, capture
spec = ExportSpec.from_file("report.export.yaml")
with capture(
"http://127.0.0.1:2718",
session="SESSION_ID",
spec=spec,
) as prepared:
prepared.write("dist/report", replace=True)
replace=True replaces the complete destination directory. Keep unrelated
application files outside dist/report.
Use marimo-export inspect SERVER to find session IDs. The selected session
remains active after capture. The live notebook environment and the client must
load the same marimo-export implementation and exporter dependencies.
Install output exporters
Install the optional families selected by your ExportSpec:
uv add "marimo-export[charts,parquet,anywidget]"
The base package supports JSON, native marimo values, and custom exporter callables. The optional families add Altair and PNG charts, Parquet tables, and AnyWidget bundles.
Learn the complete API
Preparing an export executes notebook code with the notebook environment's file, credential, network, and package access.
Release files for marimo-export 0.0.2
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| marimo_export-0.0.2.tar.gz | 250.1 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| marimo_export-0.0.2-py3-none-any.whl | Python 3 | none | any | Details |
Total release size:582.7 kB
Release files / marimo_export-0.0.2.tar.gz
| Download URL | marimo_export-0.0.2.tar.gz |
|---|---|
| Size | 250.1 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
2373b6d6f7048ed4771eed0351ad66b6712626cf3841e1a9e98d7329af99bb4c
|
|
BLAKE2b-256 checksum How to use checksums |
b36ac48fc6d2eab0d35f32f04e470a341bdd9116904d383934e94d736b1dd901
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
uv/0.12.9 {"installer":{"name":"uv","version":"0.12.9","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}
|
Release files / marimo_export-0.0.2-py3-none-any.whl
| Download URL | marimo_export-0.0.2-py3-none-any.whl |
|---|---|
| Size | 332.6 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
0fdd14b0f734b4927a95ad76e57fac80998219ac7c145807794ed8e5f862c769
|
|
BLAKE2b-256 checksum How to use checksums |
98706f7347de876b1f8a940703d6888b0dc2b99ad6fc0034ac458fe01bdb2574
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
uv/0.12.9 {"installer":{"name":"uv","version":"0.12.9","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}
|