Skip to main content

Python SDK Overview

The Qarion Python SDK (qarion-sdk) is the official client library for the Qarion Lightweight AI and Data Governance platform. It provides a clean, typed interface around the Qarion REST API so you can manage data products, quality checks, connectors, issues, and alerts from Python code.

Key Features

  • Async and Sync clients — choose QarionClient for asynchronous workflows or QarionSyncClient for scripts and notebooks. Both expose identical resource accessors.
  • Typed models — all API responses are parsed into Pydantic models, giving you autocomplete and validation out of the box.
  • Automatic retries — transient failures are retried automatically (configurable).
  • Context-manager lifecycle — open and close HTTP connections cleanly with async with / with.
  • Comprehensive exception hierarchy — every HTTP error maps to a typed exception you can catch explicitly.

Architecture

The client instantiates a shared HTTP transport and exposes resource accessors — lightweight objects that group related API calls. Every resource is available in both async and sync variants, keeping the interface consistent regardless of your runtime.

Quick Example

import asyncio
from qarion import QarionClient

async def main():
async with QarionClient(api_key="qk_...") as client:
spaces = await client.spaces.list()
products = await client.products.list("my-space")
result = await client.quality.trigger("my-space", "row-count-check")
print(f"Check passed: {result.is_passed}")

asyncio.run(main())

Or synchronously:

from qarion import QarionSyncClient

with QarionSyncClient(api_key="qk_...") as client:
spaces = client.spaces.list()
products = client.products.list("my-space")

Both clients expose the same methods — the sync variant simply drops await and uses with instead of async with.

Available Resources

AccessorDescription
client.productsData products CRUD, refreshes, and lineage
client.qualityQuality checks, executions, and external results
client.connectorsConnector management and metadata sync
client.spacesSpaces listing and membership
client.issuesIssue tracking and ticket management
client.alertsCentral alerts feed and product banner alerts
client.searchMulti-entity search across spaces and organizations

Next Steps

  1. Installation & Configuration — install the package and configure your credentials.
  2. Error Handling — understand the exception hierarchy.
  3. Data Models — explore the typed response models.