MCPcopy
hub / github.com/marimo-team/marimo / get_python

Method get_python

marimo/_cli/export/_common.py:52–65  ·  view source on GitHub ↗
(self, notebook_path: str)

Source from the content-addressed store, hash-verified

50 self._envs: dict[tuple[str, ...], tuple[str, str]] = {}
51
52 def get_python(self, notebook_path: str) -> str:
53 from marimo._cli.sandbox import (
54 build_sandbox_venv,
55 get_sandbox_requirements,
56 )
57
58 requirements = tuple(get_sandbox_requirements(notebook_path))
59 existing = self._envs.get(requirements)
60 if existing is not None:
61 return existing[1]
62
63 sandbox_dir, venv_python = build_sandbox_venv(notebook_path)
64 self._envs[requirements] = (sandbox_dir, venv_python)
65 return venv_python
66
67 def close(self) -> None:
68 from marimo._cli.sandbox import cleanup_sandbox_dir

Callers 2

_generate_thumbnailsFunction · 0.80

Calls 3

get_sandbox_requirementsFunction · 0.90
build_sandbox_venvFunction · 0.90
getMethod · 0.65

Tested by

no test coverage detected