CodeBox(
session_id: str | None = None,
api_key: str | Literal["local", "docker"] | None = None,
factory_id: str | Literal["default"] | None = None,
)Note: Async methods are available when appened with a (e.g. aexec()).
exec(code: str, kernel: Literal["ipython", "bash"] = "ipython") -> ExecResultstream_exec(code: str, kernel: Literal["ipython", "bash"] = "ipython") -> AsyncGenerator[str, None]
upload(remote_file_path: str, content: Union[BinaryIO, bytes, str]) -> RemoteFiledownload(remote_file_path: str) -> RemoteFilestream_download(remote_file_path: str) -> AsyncGenerator[bytes, None]list_files() -> list[RemoteFile]
healthcheck() -> Literal["healthy", "error"]show_variables() -> dict[str, str]restart() -> Nonekeep_alive(minutes: int = 15) -> Noneinstall(*packages: str) -> str