A reactive notebook for Python — run reproducible experiments, query with SQL, execute as a script, deploy as an app, and version with git. Stored as pure Python. All in a modern, AI-native editor.
Python artificial-intelligencedagdata-sciencedata-visualizationdataflowdeveloper-toolsmachine-learningnotebookspipelinepythonreactivesqlweb-app
fix: marimo export script with headers (#6320)
Myles Scolnick23c133c22481
diff --git a/marimo/_server/export/exporter.py b/marimo/_server/export/exporter.pyindex 1e650f2daa..6515f5135c 100644--- a/marimo/_server/export/exporter.py+++ b/marimo/_server/export/exporter.py@@ -16,6 +16,7 @@ from typing import ()from marimo import _loggers+from marimo._ast import codegenfrom marimo._ast.app import InternalAppfrom marimo._ast.cell import Cell, CellImplfrom marimo._ast.names import DEFAULT_CELL_NAME, is_internal_cell_name@@ -163,11 +164,15 @@ class Exporter:)graph = app.graph+ header = codegen.get_header_comments(filename) if filename else ""codes: list[str] = ["# %%\n" + graph.cells[cid].codefor cid in dataflow.topological_sort(graph, graph.cells.keys())]- code = f'\n__generated_with = "{__version__}"\n\n' + "\n\n".join(codes)+ code = (+ f'{header}\n__generated_with = "{__version__}"\n\n'+ + "\n\n".join(codes)+ )download_filename = get_download_filename(filename, "script.py")return code, download_filename