marimo-toml-editor: The Best Way to Edit TOML in Marimo NotebooksIf you’ve been using Marimo, you already know it’s a game-changer for Python notebooks. Marimo notebooks are reactive, reproducible, and stored as pure Python scripts. They make data science, prototyping, and building interactive tools a breeze.
However, when working on complex projects or interactive tools, managing configuration is a common hurdle. Often, you need to tweak parameters, adjust settings, or manage metadata. And what’s the modern standard for human-readable configuration? TOML (Tom’s Obvious, Minimal Language).
Yesterday, I published marimo-toml-editor, a new Python package designed to bridge the gap between reactive Marimo notebooks and TOML configurations. Here’s why I built it and why I think it’s the best tool for the job.
Before marimo-toml-editor, managing TOML configuration inside a notebook usually meant one of two things:
Neither of these solutions felt right for the highly polished, interactive experience that Marimo provides. We needed an actual, interactive editor that natively plugged into Marimo’s reactive dataflow.
marimo-toml-editormarimo-toml-editor is a custom UI element built specifically for Marimo. It provides a sleek, interactive editor for TOML data directly within your notebook cell.
.value, and parse it into a Python dictionary using the standard library’s tomllib (or tomli for older Python versions).Getting started is as simple as installing the package:
pip install marimo-toml-editor
Once installed, you can drop it right into your Marimo notebooks:
import marimo as mo
from marimo_toml_editor import TomlEditor
# Initialize the editor with some default TOML content
default_content = """
[database]
server = "192.168.1.1"
ports = [ 8000, 8001, 8002 ]
connection_max = 5000
enabled = true
"""
# Render the widget
editor = mo.ui.anywidget(TomlEditor(initial_content=default_content))
editor
In another cell, you can reactively access the edited content:
import tomllib
# This cell will automatically re-run whenever the editor's content changes!
config_dict = tomllib.loads(editor.value)
mo.md(f"**Current Port:** {config_dict['database']['ports'][0]}")
Building interactive data tools has never been easier thanks to Marimo, and with marimo-toml-editor, handling configuration files is finally a first-class citizen in that ecosystem.
Give it a try during your next project, and let me know what you think! You can find the package on PyPI.
© 2025 Javier Rodríguez Martínez. All Rights Reserved.