Skip to main content

Python SDK for the Dominus gateway-first platform

Project description

Dominus SDK for Python

Async Python SDK for the Dominus gateway-first service plane.

What This Repo Ships

  • Python 3.9+ asyncio client for Dominus services
  • Namespace-first API with a small root shortcut surface
  • Gateway-scoped client mode for MCP and other user-JWT sessions
  • Local helpers for JWT verification, trace propagation, retries, and console capture
  • Current package version: 3.0.2

Install

pip install dominus-sdk-python
pip install dominus-sdk-python[jwt]
pip install dominus-sdk-python[dev]

Quick Start

import os
from dominus import dominus

os.environ["DOMINUS_TOKEN"] = "your-psk-token"

value = await dominus.secrets.get("DB_URL")
users = await dominus.db.query("users", filters={"status": "active"})
await dominus.redis.set("session:123", {"user": "john"}, ttl=3600)

run = await dominus.workflow.ensure(
    "wf://carebridge/report-cycle",
    subject="PCM47474562",
    company="summit-radiology",
)

timeline = await dominus.workflow.get_run_timeline(run["run_id"])

Session-Scoped Clients

Production MCP and other user-session callers should instantiate Dominus with gateway scope context instead of relying on the service-token flow:

from dominus import Dominus

client = Dominus(
    gateway_user_token=user_jwt,
    gateway_org_id=org_id,
    gateway_app_slug=app_slug,
    gateway_env=env,
)

me = await client.portal.me(user_token=user_jwt)

When these fields are set, _request(..., use_gateway=True) forwards the user JWT and selected scope headers directly through Gateway.

Transport Model

  • Default HTTP targets are the production gateway (https://gateway.getdominus.app); they do not change based on your app’s git branch or PyPI package variant. Set DOMINUS_GATEWAY_URL (or DOMINUS_BASE_URL / DOMINUS_JWT_URL) only for local or custom routing.
  • DOMINUS_TOKEN is exchanged for a JWT through POST /jwt/mint
  • Service JWTs are cached for 14 minutes with a 60-second refresh window
  • Auth-required worker routes still send base64-encoded JSON bodies as text/plain
  • Responses may arrive as legacy base64 JSON or raw JSON; the SDK accepts both
  • Gateway-routed namespaces translate /api/* to /svc/*
  • SSE and binary helpers bypass JSON decoding where appropriate

Namespace Inventory

Namespace Backing surface Purpose
secrets Warden Secrets CRUD
db DB Worker Database CRUD and metadata
secure DB Worker Audit-logged data access
redis Redis Worker Cache, hashes, TTL, counters
files B2 / storage surfaces File upload, fetch, listing, folders
auth Guardian + JWT routes RBAC, tenants, pages, secure tables, JWKS
ddl Smith / DDL worker Schema, migrations, provisioning
logs Logs Worker Structured logs and tail/query helpers
portal Portal Worker Login, sessions, profile, preferences, nav
courier Courier Worker Template email delivery
health Gateway Health and ping helpers
admin Admin Worker Admin category reseed/reset
ai Agent Runtime Agent, completion, RAG, artifacts, results, raw orchestration
workflow Workflow Manager + Authority Saved workflow CRUD and canonical run lifecycle
artifacts Artifact Worker Addressed V2 artifacts, bookmarks, watches
jobs Job Worker Enqueue, poll, dead-letter management
processor Processor Batch and single-job processing
sync Sync Worker KV synchronization
authority Dominus Authority Runs, companies, deploys, managed clients, context
fastapi Local decorators @jwt, @psk, @scopes(...)

Root Shortcuts

The root Dominus object still exposes a small compatibility surface for common operations:

  • get, upsert
  • list_tables, query_table, insert_row, update_rows, delete_rows
  • add_table, add_column, delete_table, delete_column
  • await dominus("secrets.get", key="DB_URL")

New code should prefer namespace APIs.

Documentation

Verification

pip install -e .[dev]
python -m pytest tests -q
python -m build

License

Proprietary - CareBridge Systems

Project details


Release history Release notifications | RSS feed

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

dominus_sdk_python-3.0.3.tar.gz (100.3 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

dominus_sdk_python-3.0.3-py3-none-any.whl (101.4 kB view details)

Uploaded Python 3

File details

Details for the file dominus_sdk_python-3.0.3.tar.gz.

File metadata

  • Download URL: dominus_sdk_python-3.0.3.tar.gz
  • Upload date:
  • Size: 100.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.11.15

File hashes

Hashes for dominus_sdk_python-3.0.3.tar.gz
Algorithm Hash digest
SHA256 090989c4f907dfde0d450958b51a09537b17e70bd27dc3c62180eba6526c35f2
MD5 83955d20dfba3ea0fb43e035440a1cec
BLAKE2b-256 42de548a9471e70cf5f1f255ad40880675956b6a270cbf0c6963cc4cd2bc0325

See more details on using hashes here.

File details

Details for the file dominus_sdk_python-3.0.3-py3-none-any.whl.

File metadata

File hashes

Hashes for dominus_sdk_python-3.0.3-py3-none-any.whl
Algorithm Hash digest
SHA256 95617608107501d4076b4d0022a374746da03661f4663bf8a6c0dd4445a52507
MD5 5aba426abedde0a5580bc7d55ff67443
BLAKE2b-256 f1d3240f6f87faf07e34ae455b534efed75aa3b3d10b2fc81a95b21b9f8a0d48

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page