github marimo-team/marimo 0.13.0

latest releases: 0.13.4, 0.13.3, 0.13.2...
13 days ago

What's Changed

Release 0.13.0 introduces includes a big new feature: it's now possible to import functions and classes from marimo notebooks, as long as they meet certain criteria. This lets you write code like:

from my_notebook import my_function, my_class

This feature, contributed by @dmadisetti, is yet another way that marimo's pure Python format makes your notebook code reusable.

Reusable functions and classes

Starting with 0.13.0, you can import top-level functions and classes defined in a marimo notebook into other Python scripts or notebooks using normal Python syntax, as long as your definitions satisfy the following criteria:

  1. The cell must define just a single function or class.
  2. The defined function or class can only refer to symbols defined in the setup cell, or to other top-level symbols.

The setup cell is a new addition to marimo: it is an optional cell in which you can include modules used by functions and classes you'd like your notebook to expose.

When you create a cell containing just a single function or class, marimo will provide hints in the bottom-right that tell you if the criteria are met ...

image

... or if not what needs to be done to meet the criteria:

image

To learn more, visit our docs.

More legible markdown

Design is important to us; that's why markdown is now rendered with a maximum width of ~80 characters, improving legibility.

All changes

New Contributors

Full Changelog: 0.12.10...0.13.0

Don't miss a new marimo release

NewReleases is sending notifications on new releases.