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
Using XDG_STATE_HOME environment variable to support the Linux XDG Base Directory (#6048)
TDYQ-Liuec7670948c26
diff --git a/marimo/_utils/config/config.py b/marimo/_utils/config/config.pyindex 17b702f2d9..0b327a8a98 100644--- a/marimo/_utils/config/config.py+++ b/marimo/_utils/config/config.py@@ -3,13 +3,27 @@ from __future__ import annotationsimport osfrom dataclasses import asdict+from pathlib import Pathfrom tempfile import TemporaryDirectoryfrom typing import Any, Optional, TypeVarfrom marimo._utils.parse_dataclass import parse_rawfrom marimo._utils.toml import is_toml_error, read_toml-ROOT_DIR = ".marimo"++def xdg_state_marimo_dir() -> Path:+ if os.name == "posix":+ # for Linux/macOS/Unix+ _user_home = Path.home()+ _state_home = os.environ.get(+ "XDG_STATE_HOME", _user_home / ".local/state"+ )+ return Path(_state_home).relative_to(_user_home) / "marimo"+ else:+ return Path(".marimo")+++ROOT_DIR = xdg_state_marimo_dir()T = TypeVar("T")