Skip to content

Getting started

Katalogue ships two packages that share one core:

PackageUse it for
katalogue-cliInteractive use and shell scripting from a terminal
katalogue-sdkScripts, notebooks, services, and agents in Python

The CLI is a thin wrapper over the SDK, so both authenticate the same way and expose the same capabilities. This guide gets you from zero to your first result with either.

The CLI includes the SDK as a dependency. Install whichever you need:

Terminal window
# CLI (includes the SDK)
pip install katalogue-cli
# SDK only
pip install katalogue-sdk

(Or with uv: uv add katalogue-cli / uv add katalogue-sdk.)

The SDK and CLI talk to the Katalogue REST API using OAuth2 client credentials. You need the REST API enabled and an OIDC client with the right scopes. Follow Granting access to Katalogue to create a client and obtain a client ID and client secret.

You will configure three values:

SettingEnv varNotes
Client IDKATALOGUE_CLIENT_IDrequired
Client secretKATALOGUE_CLIENT_SECRETrequired; keep it out of shell history
Base URLKATALOGUE_URLyour instance, e.g. https://your-instance.katalogue.se

The token URL defaults to <base-url>/oidc/token and rarely needs setting (KATALOGUE_TOKEN_URL to override).

The quickest way to store credentials is auth login, which saves the client ID, base URL, and token URL to a config file and the secret to your OS keychain:

Terminal window
katalogue auth login # prompts for client ID, secret, and base URL
katalogue auth status # confirm what's set
katalogue system list # your first call

Prefer environment variables (e.g. in CI)? Set the three vars above and skip auth login:

Terminal window
export KATALOGUE_CLIENT_ID=...
export KATALOGUE_CLIENT_SECRET=...
export KATALOGUE_URL=https://your-instance.katalogue.se
katalogue system list

From here:

from katalogue import KatalogueClient, GetOptions
client = KatalogueClient() # reads KATALOGUE_CLIENT_ID / _SECRET / _URL from the environment
# List all systems
result = client.get("system")
print(result.data) # list of dicts
# All PII fields, just the columns you want
result = client.get("field", GetOptions(
filters=["is_pii=true"],
properties=["field_id", "field_name", "dataset_name"],
))
print(result.data)

From here:

Stuck? See Troubleshooting or the full documentation index.