What's Changed
Highlights
⚡️ **Reactive module autoreloading.** marimo now ships with the **most advanced module autoreloader** out of any interactive Python programming environment. When enabled (via the notebook settings menu), marimo automatically react to modifications made to packages and modules that your notebook imports. This lets you develop complex logic in Python modules, using an editor of your choice, and use the marimo notebook as a DAG or main script that orchestrates your logic.
Autoreloading comes in two flavors:
- **“detect”**: automatically marks cells affected by module modifications as stale, letting you know which cells need to be re-run.
- **“autorun”**: automatically re-runs cells affected by module modification.
Thanks MartinBernstorff, astrowonk for the feature request!
⛓ **Command-line arguments**. Give arbitrary command-line arguments to your notebook, and read them with [`mo.cli_args()`](https://docs.marimo.io/api/cli_args.html): this works in `edit` and `run` modes, and also while running as a script.
- `marimo edit notebook.py -- -arg1=foo -arg2=bar`
- `marimo run notebook.py -- -arg1=foo -arg2=bar`
- `python notebook.py -arg1=foo -arg2=bar`
Thanks twrightsman for the feature request!
📄 **Programmatic HTML export**. Long requested, finally here: use `marimo export html` at the command-line to export your notebooks as beautiful documents:
- to HTML: `marimo export html notebook.py -o notebook.html`
- with CLI args: `marimo export html notebook.py -o notebook.html -- -arg1=foo -arg2=bar`
Thanks egemenimre, scls19fr, bmeyers for the feature request!
🔎 **Check if running in a notebook.** Use `mo.running_in_notebook()` to tell whether Python is executing inside a marimo notebook. Use this when developing library code that integrates with marimo, or to tell whether your notebook file is running via the notebook kernel or as a Python script.
P.S. Check out our new guide on [integrating your objects with marimo](https://docs.marimo.io/guides/integrating_with_marimo/index.html).
Full changelog
* fix: latex line-height by mscolnick in https://github.com/marimo-team/marimo/pull/1136
* fix: send app-config in kernel ready response by mscolnick in https://github.com/marimo-team/marimo/pull/1133
* improvement: move html export logic to python code by mscolnick in https://github.com/marimo-team/marimo/pull/1135
* feat: reactive reloading of modified modules by akshayka in https://github.com/marimo-team/marimo/pull/1139
* refactor parse_dataclass.py by fuenfundachtzig in https://github.com/marimo-team/marimo/pull/1082
* chore: use ruff to auto add returns by mscolnick in https://github.com/marimo-team/marimo/pull/1143
* feat: marimo export html cli by mscolnick in https://github.com/marimo-team/marimo/pull/1141
* fix: use data urls for vfiles when running as a script by akshayka in https://github.com/marimo-team/marimo/pull/1145
* Update deploying_docker.md by jettil in https://github.com/marimo-team/marimo/pull/1147
* feat: mo.cli_args by mscolnick in https://github.com/marimo-team/marimo/pull/1146
* improvement: running as script - only start event loop when needed by akshayka in https://github.com/marimo-team/marimo/pull/1148
* feat: add cli args to html export by akshayka in https://github.com/marimo-team/marimo/pull/1151
* improvement: modernize filename dropdown by mscolnick in https://github.com/marimo-team/marimo/pull/1153
* fix: grid editor when bordered by mscolnick in https://github.com/marimo-team/marimo/pull/1154
* feat: CLI args when running as a script by akshayka in https://github.com/marimo-team/marimo/pull/1150
* feat: mo.running_in_notebook() by akshayka in https://github.com/marimo-team/marimo/pull/1155
* chore: add marimo shields by mscolnick in https://github.com/marimo-team/marimo/pull/1156
* chore: ignore /var tmp directory in homepage by akshayka in https://github.com/marimo-team/marimo/pull/1157
* fix: dont drop async prefix when re-formatting cell signature by akshayka in https://github.com/marimo-team/marimo/pull/1167
* docs: integrations guide by akshayka in https://github.com/marimo-team/marimo/pull/1158
* fix: fix plotly re-rendering and re-mounting state by mscolnick in https://github.com/marimo-team/marimo/pull/1169
* 0.4.1 by akshayka in https://github.com/marimo-team/marimo/pull/1168
New Contributors
* jettil made their first contribution in https://github.com/marimo-team/marimo/pull/1147
**Full Changelog**: https://github.com/marimo-team/marimo/compare/0.4.0...0.4.1