Replies: 1 comment 1 reply
This is actually incorrect. You cannot import a file like this, and I think But a good idea! We have thought about this and have even considered But since marimo files really are python (they can bootstrap themselves), I don't think sharing the namespace is that bad. |
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Proposal
Encourage (and eventually recognize)
*_mo.pyas the conventional file suffix for marimo notebooks, e.g.,analysis.mo.pyinstead ofanalysis.py.This is a naming convention, not a format change. The files remain valid Python. The double extension simply
makes marimo notebooks identifiable by filename alone.
Why this matters
1. Visibility in a codebase
In any project mixing regular Python modules with marimo notebooks, there's no way to tell them apart without opening
the file and checking for the
app = marimo.App()marker. A*_mo.pysuffix makes notebooks immediatelyrecognizable in file trees, search results, and
git log.2. Targeted tooling configuration
Today, configuring tools differently for notebooks vs regular Python requires manual file lists. With a distinct suffix:
[tool.ruff.per-file-overrides] "_.mo.py" = { ... }marimo lintonly on notebook files3. Agent and LLM workflows
AI agents working in a codebase need to distinguish notebooks from regular modules to apply the right editing
patterns (reactive cells,
mo.*output rules, no cross-cell variable reuse). A filename convention is the simplest, most universal signal,it works across every tool and context without parsing.
Compatibility
*_mo.pyfiles are still valid.pyfiles, Python, pip, and all existing tools handle them normally*.test.py,*.spec.ts,*.stories.tsx,*.module.cssmarimo edit,marimo run) would accept*_mo.pyfiles with no changes needed*.pynotebooks continue to work — this is opt-in adoption, not a breaking changeWhat "adopt" could look like
*_mo.pyin the getting-started guide andmarimo initoutputmarimo new analysiscreatesanalysis.mo.py_.mo.pyas a strong signal for marimo-specific behavior (lint rules, file watchers, etc.), falling back to content-based detection for plain*.pyfilesEdits:
*.mo.pyto_mo.pyAll reactions