Skip to content

ki-kyvos/kyvos-sdk-python

Repository files navigation

kyvos-sdk-python

Standalone Python SDK for the Kyvos REST API. Handles authentication, connection/dataset/DRD/SM/dashboard CRUD, column refresh, folder management, and query execution. Includes retry logic, structured logging, and both XML and JSON payload modes.

Installation

pip install kyvos-sdk-python

Quick Start

from kyvos_sdk import KyvosService
from kyvos_sdk.config import KyvosConfig

# Configure via KyvosConfig or constructor params
svc = KyvosService(
    base_url="http://localhost:8080/api/v1",
    username="admin",
    password="admin",
)
svc.initialize()

# Create a connection
conn_id, created = svc.create_or_update_connection_xml(
    name="MyConnection",
    host="localhost", port=5432, database="mydb",
    username="postgres", password="secret",
)

# Create a folder
folder_id, folder_name = svc.create_folder("My Datasets", "RDATASET")

# Create a semantic model
svc.create_semantic_model_xml(smodel_xml="<CUBE>...</CUBE>")

Authentication

The SDK supports two authentication modes:

  1. Token-based: Pass auth_token to the constructor (uses sessionid header)
  2. Username/Password: Pass username and password; the SDK calls POST /rest/login automatically
# Token-based
svc = KyvosService(base_url="...", auth_token="session-12345")

# Username/password (auto-login on 401)
svc = KyvosService(base_url="...", username="admin", password="admin")

Features

  • Connection management — Create/update connections (XML + JSON modes)
  • Dataset CRUD — Create datasets from table specs, refresh columns
  • DRD management — Create dataset relationship diagrams, resolve IDs
  • Semantic model lifecycle — Create, add measures, publish
  • Dashboard creation — Create dashboards from specs
  • Folder management — Create and list folders
  • Query execution — Run MDX/SQL queries via MCP client
  • Retry logic — Exponential backoff with tenacity
  • Structured logging — Standard Python logging throughout

Documentation

License

Apache 2.0 — See LICENSE for details.

About

Kyvos REST API client SDK for Python

Resources

License

Code of conduct

Contributing

Stars

0 stars

Watchers

0 watching

Forks

Packages

 
 
 

Contributors

Languages