Skip to main content
The ntro SDK is the Python interface to Ntropii. It’s what runbooks import (when they run inside Ntropii Tenant) and what the CLI and MCP server import (to talk to Ntropii Workspace on your behalf).

Install

Includes everything you need to call Ntropii Workspace: Client, all resource accessors, all Pydantic models, all exceptions.
In a runbook repo, pin ntro[workflow] in requirements.txt (worker installs this) and ntro[testing] in dev dependencies (CI / local iteration).

Quick start

Confirm it works:

Configuration

The SDK reads ~/.ntro/config.toml (or $NTRO_HOME/config.toml):
Run ntro auth login to populate this file interactively.

Resolution priority

When Client.from_config() runs, it resolves credentials in this order:
1

Explicit constructor args

Client(host=..., api_key=...) always wins. Useful in tests where you want zero environmental influence.
2

Environment variables

NTRO_HOST / NTRO_API_KEY. Useful in CI/CD where you don’t want a config.toml on disk.
3

Named connection

Client.from_config(connection="staging") reads [connections.staging] from the config file.
4

Default connection

Falls back to the connection named in default_connection_name.

Async vs sync

Every resource method is async-first with a _sync wrapper for scripts and notebooks:
The _sync variants call asyncio.run() internally — don’t use them inside an async function or you’ll get nested event-loop errors.

What’s next

Ntropii client

The full surface of ntro.workspace.Client — every resource accessor and exception.

Workflows overview

NtroWorkflow + @runbook.step — the SDK primitives runbooks compose.