Get help from the marimo community

Plain Text
@app.cell
def input_cell(mo):
    my_input = mo.ui.text()
    my_input
    return (my_input,)


@app.cell
def result_cell(my_input):
    my_input.value
    return


If I run input_cell, the result_cell will immediately be run after that (because my_input.value). I know that we can change the default value or use callback functions, but it could be a good idea to prevent dependent cells do not run and wait for the users actual input.
7 comments
M
H
Hello! My organization uses an internal network for some of our business processes, and many pages are secured with SSL/TLS certificates! We have an openAI compatible API that I’m trying to configure, however it requires a specific Certificate Authority bundle to verify the connection.

I wasn’t sure if it would be difficult to add in support for additional arguments/config keywords that get passed to the connection client, including custom CA bundles, ssl_verify arguments, etc.


As is right now, i think Marimo uses the OpenAI python package which itself uses httpx under the hood to build the connection. Httpx does support a specific argument for a ca bundle! As is, without being able to specify that bundle I get an error:

httpcore.ConnectError: [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed, unable to get local issuer certificate. (_ssl.c:1007)

My proposed solution would be allowing additional arguments in the config toml for ssl_verify and caBundlePath which would be passed to the appropriate OpenAI client creation segment in the code.
16 comments
R
M
k
Hey, I'm using mo.ui.radio for filtering a dataset as part of a larger ML model evaluation UI. I find that when I have a lot options using the inline option just makes a really wide element for the radio component.

It'd be a nice feature to have ncols, nrows or columns for the UI element to define a little radio grid or similar arguments
1 comment
M
Hi, when I use marimo without the sandbox feature I often end up installing packages via the integrated package manager - I use uv. If i were to install packages directly from the terminal using uv they would be added to pyproject.toml, it would be great to have packages added to the dependencies in pyproject toml when such file is available and if not running in a sandbox
3 comments
M
l
When I am developing a notebook that is destined to become a WASM notebook, it would be great to be able to edit it directly in the WASM environment and save the changes to disk, instead of developing in the Python environment, having to make sure it works in both.
14 comments
M
v
a
Off the back of https://discord.com/channels/1059888774789730424/1345036219884765244/1345083635476205568

Would it make sense to have marimo be installable via OS package managers (apt, brew, pacman, etc?). I've read before that system wide marimo is discouraged but I always (unless when developing apps) use marimo as a system wide tool

I imagine this would require some initial complexity distributing the marimo build to different package managers repositories but I think it could make sense
2 comments
M
l
Hello! I'm currently investigating Marimo for integration in a data analysis web app. Think something like a specialized Looker or Tableau. The goal is to embed Marimo in the app as a pane, allowing users to run Python and interact with the analytics app's data and functionality via Python. I've been trying out the Islands feature to set up this integration and have it minimally working (albeit without the ability to add/remove cells dynamically).

However, in order to make this happen, there needs to be a way to define functions or objects in the Python scope that can call into JS code to power the app. I imagine something like adding a global AppClient or similar that can be used to pull data, display output through the app's existing visualization tools, etc. Because of this, embedding the full Marimo app via an iframe doesn't seem like an option.

I've been digging through the docs and source code, but I've been unable to find a way to support something like this. I know that the the Pyodide instance is running on a worker thread and I can access the worker's scope from the Python side via import js, but there's not much of a way to access the main thread and hook functions there.

I found the window._marimo_private_IslandsPyodideBridge which I can access from the main thread, but after looking through the various properties it exposes I don't see any option to achieve what I'm looking for. I feel like I might be missing something there though.

Do you have any suggestions of how I might be able to achieve this kind of thing? I feel like this might be something that's out of scope of Marimo/islands goals, but I'm happy enough to write code, deal with internals, or even fork/contribute to Marimo if needed.
3 comments
M
a
I am developing a workflow that involves writing functions in marimo notebooks (with examples and pytests leveraging https://github.com/marimo-team/marimo/pull/3892) and then I make these functions available to 'normal' python by using a simple helper module e.g.
Plain Text
from foo_notebook import basic_defs
_, defs = basic_defs.run() # basic_defs is a mo.Cell

count_mins = defs['count_mins']
#etc...


This flow is quite great -- debugging works fine (I can set a break point in the marimo notebook and when debugging, the breakpoint works), vscode can find the unit tests, importing is snappy (ignores demo content), etc

The only thing I loose is IDE awareness of docstrings and (more importantly) parameter names, arity and type. Jupyter intellisense is not too bad since it pulls info from kernel runtime and so can see the docstring and parameter info, but normal IDE flows don't work. What worse is the AI completion starts making wild guesses.

Are there any suggestions for how to make this work better? I was thinking if I continue with this flow, maybe building a helper generator that calls writes stubs with parameters and docstrings and then delegates to the cell, but this seems quite suboptimal....
1 comment
A
I'd like to add something for marimo-agents to be able to collect information about all the cells + cell outputs above it

I don't think outputting to global variables works because this makes it hard to capture order of messages, or if i do an array then that doesn't update on cell deletion/reordering. Ideally, at runtime, I'd be able to call a method internally on the Cell on-run to get all the things prior to it.

(Use case: an AI agent could dynamically run using the context of all the things above it in the notebook)

I understand this may not fit marimo's vision and am happy to implement it for my own project or within marimo-core, but would just like to get an idea of any ways I could add this that would fit the existing development style @Myles Scolnick
So like I am a developper of an AI tool called Mantis, Mantis is a data visualization and cognitive cartography tool using LLM technology to visualize and interact with textual data.
The thing is we already have coding sandbox, but its not that good and we want now to replace this coding sandbox with MarimoNotebooks, and we want it to be fully integrated in the frontend, no use of the backend. Our app is based on panels (look at the image, as an example the narrator is a panel, the inspector is a panel...), and what we wanna do is add a marimo notebook panel. So how can we do that ? We've already looked at using pyodide to integrate that, but is there another way. Thanks

PS:Our app uses typescript and react for the frontend
15 comments
R
M
A
Hey,

Awesome product!

Looking for Marimo example files I can give to Claude AI as context for building an app idea I have. Need notebooks or code examples showing:
  • Marimo + LLM integration
  • Markdown processing workflows
  • State management
  • Multi-step UI patterns
Any .py files or markdown documentation links would be perfect. Thanks!​​​​​​​​​​​​​​​​
1 comment
M
hey, I thought it'd be very useful to have the data explorer show possible values for filters as well as perhaps showing those values when hovering over unique: {unique_count}

I often find myself going back and forth between the data explorer and the data panel on the left menu for this. I think it'd be neat to have the filter values directly in the data explorer
In my NLP workflow, I frequently need to visualize tables that contain long strings. Ideally, I'd have a table that contains cells that are wrapped and truncated (maybe to 2-3 rows), with the option of expanding particular cells by clicking on them. Streamlit's dataframe, for example, does what I need. This is a key feature I need to migrate.
It'd be nice to have to have a checkbox in SQL cells for caching with perhaps a timer (e.g 1 hr, 1 day, 7 weeks) where an expensive SQL query will not be executed within that time window if a cache entry exist for it - perhaps it doesn't encourage best practices (probably moving expensive queries to a data warehouse) but i could see it being useful in some instances
3 comments
M
l
Working in data visualisation, I created a brushable_widget python package (available at pypi) so that I can draw an SVG with circles, brush those circles, and get the selected IDs back into marimo (python).
What I really want to do, is build brushing/linking between 2 plots: having 2 plots next to each other showing different views on the same data. If you brush (select) points in the first plot, the points in the second plot are also highlighted; and vice versa.

The API is the following, where circles1 and circles2 are arrays of circles based on the same datapoints but different axes.
Plain Text
svg1 = SVG(width=200, height=200, elements=circles1)
svg2 = SVG(width=200, height=200, elements=circles2)

The SVGs are then wrapped in an anywidget and

Plain Text
plot1 = mo.ui.anywidget(BrushableWidget(svg=svg1.as_str(), selected_ids = []))
plot2 = mo.ui.anywidget(BrushableWidget(svg=svg2.as_str(), selected_ids = []))
mo.hstack([plot1, plot2])


When hovering over datapoints, the selected_ids trait of that widget is updated. And here's the thing: it should be propagated to the other widget.

I have tried 2 approaches, but each have issues:

Approach 1: traitlets.link((plot1, "selected_ids"),(plot2, "selected_ids"))
Problem: even though they are linked, a plot1.selected_ids is not updated in other marimo cells.

Approach 2: get_selected, set_selected = mo.state([])
Problem: you end up with infinite loops: set_selected(plot1.selected_ids), plot1.selected_ids = get_selected(), set_selected(plot2.selected_ids) and plot2.selected_ids = get_selected() will keep triggering each other.

Any ideas on how to get this working? (cc @manzt )
14 comments
M
J
Unlike jupyter notebooks, marimo cells are linked, nodes of a DAG. I like the fact that I can put a cell anywhere in the notebook and it will run but sometimes I miss having my cells outlined in order of execution - though I know there would be many ways of sorting parallel branches of a dag but this would be useful still, or maybe even a DAG editor (I know the canvas exist but maybe something more UX/dev focused)
1 comment
M
Hi,
I would like to implement E2E testing in some of my notebooks, and for now it's hard to locate and interact with HTML elements from a Marimo notebook since they don't have a stable ID or other data-* attributes to target...
Is there a way to do so or should it be a new feature completely?
1 comment
M
I’m developing a Marino app that is mounted in FastAPI. One of the requirements for this project is that the app needs to have different banners depending on the environment it is deployed. Currently, I’m doing something like:

Plain Text
import marimo as mo
import os 

ENV_ID = os.getenv(“ENV_ID”)

app = marimo.App(html_head_file=f"head_{ENV_ID}.html")


It works but the issue is that when in notebook editor mode, on save, marimo will remove the “import os” and ENV_ID set line. Not a blocker, just a bit cumbersome to put it back every time, but I’m wondering if there could be a formal way to support dynamic app configuration such as this.

Perhaps an app factory approach could work? Could specify path to the factory callable in .marimo.toml.

I think dynamic configuration would be really powerful for those of us using programmatic Marimo deployments.

I’m currently on marimo 0.10.14
6 comments
M
m
Hey everybody!
Marimo is an absolute pleasure to use, great work!

Something I have repeatedly found myself wanting to do:
I often have a couple of things I'd like to always have on the screen, e.g. a few buttons with to toggle different lines of recompute / reload or some visualizations.
I haven't found any way to "Freeze" cells at the top of the UI (correct me if this does exist!)
So I thought I may be able to approximate this with the new column layout feature
However, the actual code column should be much wider than the small reload buttons. Is this customizable in any way?
4 comments
M
w
To write maths and science more easily, I use some common latex packages, like amsmath, mhchem, siunitx...

These packages have a mathjax version or equivalent.
In jupyter I can require those in mardown cells or use a custom.js.

I must be blind but I couldn't find docs on how to do that with marimo.
6 comments
M
L
I often get asked if Marimo can do a wizard style UI to guide the user through the workflow. I'm thinking the closest it can do is https://docs.marimo.io/api/layouts/carousel.html. But in order to be a true wizard, I would like to prevent the user from moving on until a certain task has been completed (fill in form, press button etc.). Could you add this type of logic to the component?
1 comment
M
I want to give a hint to the user, that they need to press a submit button, if they have made changes to some parts of the inputs. To do this, I want to nudge them by changing the color of the button to red. I tried with callout, but it seems a bit excessive as it just places a large box around my element. Instead I want to make it more subtle, but still visibly different from the standard button color
1 comment
M
Likely Issue
Can't get marimo to display multiple dataframes in a single cell by default.

Context:
  • By default, jupyter prints only the output of the last evaluated expression in a single cell. Working with multiple data frames, its tiresome to only look at a single frame in one cell.
  • Known work around for jupyter: if you run the following script in cell, it starts displaying output of all the expressions.
Plain Text
from IPython.core.interactiveshell import InteractiveShell
InteractiveShell.ast_node_interactivity = "all"


Details
For the following sample code:
Plain Text
df1=pd.DataFrame([[1,2],[3,4]],columns=['col1','col2'])
df2=pd.DataFrame([[5,6],[7,8]],columns=['col3','col4'])
df1.sample(2)
df2.sample(2)

My expectation is that marimo renders 2 frames, one below another if I execute the same property update..

alternatively, I can achieve the same(render 2 dataframe in same cell) by using the output api.
Plain Text
mo.output.append(df1.sample(2))
mo.output.append(df2.sample(2))

I was wondering if there is a simpler way to do this for all expressions in a cell.

Apologies if I am missing something obvious.
2 comments
M
u
Say I have a python call that returns a dataframe. without assigning it to a variable within the notebook itself, is there a way I can register it as a data source? like from a module i'm importing?

Example:
Plain Text
def run_agent(input):
   for event in agent.run(input):
      # if is tabular
      df = pd.DataFrame(event.content)
      **mo.state.register_datasource(df, event.name + event.tool_args + "_df") # <------ saves df to var "nearest_gene_tool_chr15_88569444_df"**
      mo.output.append(df)
      ...
    ...
9 comments
M
R
A
Would be useful if time range is provided as part of datetime column filter
3 comments
M
l