Skip to content

Tools API.

The DeepOriginClient can be used to access the tools API using:

from deeporigin.platform.client import DeepOriginClient

client = DeepOriginClient()

Then, the following methods can be used, for example:

tools = client.tools.list()

src.platform.tools.Tools

Tools API wrapper.

Provides access to tools-related endpoints through the DeepOriginClient.

Methods:

exists

exists(*, tool_key: str, tool_version: str) -> bool

Return whether a tool version pin resolves to an enabled definition.

The platform resolves tool_version at request time: exact semver ("3.2.3"), major-only ("1" → latest 1.x.x), or "latest".

Parameters:

Name Type Description Default
tool_key str

Tool identifier.

required
tool_version str

Version pin accepted by the platform tools API.

required

Returns:

Type Description
bool

True when the pin resolves and the definition is enabled.

get

get(*, tool_key: str, tool_version: str) -> dict

Return a single tool definition for the given key and version.

Uses GET /tools/protected/tools/{toolKey}/{toolVersion}/definitions.

Parameters:

Name Type Description Default
tool_key str

Tool identifier.

required
tool_version str

Exact version string to match.

required

Returns:

Type Description
dict

Tool definition dict (includes inputs, key, version, etc.).

get_by_key

get_by_key(*, tool_key: str) -> list[dict]

Get all versions of a tool definition by tool key.

Parameters:

Name Type Description Default
tool_key str

The key of the tool to get the definitions for.

required

Returns:

Type Description
list[dict]

List of tool definition dictionaries for all versions of the tool.

list

list() -> list[dict]

List all available tool definitions.

Returns:

Type Description
list[dict]

List of tool definition dictionaries from the API.