Skip to content

comet_mpm.API

API(api_key: Optional[str] = None)

Main entry point for interacting with the Comet MPM API.

Provides high-level methods for working with models and workspaces.

Parameters:

  • api_key (Optional[str], default: None ) –

    The Comet API key for authentication

Initialize the Comet MPM API client.

Parameters:

  • api_key (Optional[str], default: None ) –

    The Comet API key for authentication

Functions

get_model

get_model() -> Optional[Model]

Get the default model for this dashboard in a Python Panel environment.

Returns:

  • Model ( Optional[Model] ) –

    A Model instance for the model

get_model_by_name

get_model_by_name(workspace_name: str, model_name: str) -> Optional[Model]

Get a model instance by workspace name and model name.

Parameters:

  • workspace_name (str) –

    Name of the workspace containing the model

  • model_name (str) –

    Name of the model to retrieve

Returns:

  • Model ( Optional[Model] ) –

    A Model instance for the specified model, if it exists, otherwise None

get_model_id

get_model_id(workspace_name: str, model_name: str) -> Optional[str]

Get the model ID for a given workspace and model name.

Parameters:

  • workspace_name (str) –

    Name of the workspace containing the model

  • model_name (str) –

    Name of the model to retrieve

Returns:

  • Optional[str]

    Optional[str]: The model ID if found, None otherwise

get_panel_height

get_panel_height() -> int

Get the panel height from configuration.

Returns:

  • int ( int ) –

    The panel height

get_panel_size

get_panel_size() -> Tuple[int, int]

Get the panel size (width, height) from configuration.

Returns:

  • Tuple[int, int]

    Tuple[int, int]: The panel size as (width, height)

get_panel_width

get_panel_width() -> int

Get the panel width from configuration.

Returns:

  • int ( int ) –

    The panel width

get_panel_workspace

get_panel_workspace() -> Optional[str]

Get the workspace name from panel options.

Returns:

  • Optional[str]

    Optional[str]: The workspace name from panel options, or None if not found

Nov. 5, 2025