Skip to main content

Python SDK for dorc-engine HTTP API

Project description

dorc-client (Python)

Python SDK for DORC MCP service with capability-based Bearer token authentication.

Per CONTRACT.md: The SDK accepts a Bearer token (API key or JWT) and forwards it. The SDK does NOT generate tokens.

Install

pip install dorc-client

Quick Start

from dorc_client import DorcClient

# Create client with Bearer token (API key or JWT)
client = DorcClient(
    base_url="https://dorc-mcp-xxxxx.run.app",
    token="your-bearer-token-here",  # API key or JWT
)

# Health check (no auth required)
health = client.health()
print(health)  # {"status": "ok", "service": "dorc-mcp", "version": "0.1.0"}

# Validate content (Bearer token required)
result = client.validate(
    candidate_content="# My Canon Entry\n\nContent here...",
    content_type="text/markdown",
)
print(f"Run ID: {result.run_id}, Status: {result.pipeline_status}")

# Get run details
run = client.get_run(run_id=result.run_id)

# List chunks
chunks = client.list_chunks(run_id=result.run_id)

Environment Variables

  • DORC_MCP_URL: base URL of dorc-mcp (example: https://dorc-mcp-xxxxx.us-east1.run.app)
  • DORC_TOKEN (or DORC_JWT for backward compat): Bearer token (API key or JWT)

API Methods

  • health()GET /health (no auth)
  • healthz()GET /healthz (no auth)
  • validate(candidate_content, ...)POST /v1/validate (Bearer token required)
  • get_run(run_id)GET /v1/runs/{run_id} (Bearer token required)
  • list_chunks(run_id)GET /v1/runs/{run_id}/chunks (Bearer token required)

Note: Tenant is extracted from the token by MCP. You do NOT pass tenant_slug to these methods in MCP mode.

Project details


Download files

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

Source Distribution

dorc_client-0.2.0.tar.gz (16.6 kB view details)

Uploaded Source

Built Distribution

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

dorc_client-0.2.0-py3-none-any.whl (9.0 kB view details)

Uploaded Python 3

File details

Details for the file dorc_client-0.2.0.tar.gz.

File metadata

  • Download URL: dorc_client-0.2.0.tar.gz
  • Upload date:
  • Size: 16.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for dorc_client-0.2.0.tar.gz
Algorithm Hash digest
SHA256 d86d99d7b89268735f7abb350d1f9ea13bcd8ac296b45d975cc0f5587aa6f302
MD5 f7fb0217df1f92b45d945b4085cf9ab9
BLAKE2b-256 f77f00851b37f4bfccc57c2247451ca9d379c491423333da23a0e0cacc6c61b1

See more details on using hashes here.

Provenance

The following attestation bundles were made for dorc_client-0.2.0.tar.gz:

Publisher: publish-pypi.yml on dorc-io/dorc-clients

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file dorc_client-0.2.0-py3-none-any.whl.

File metadata

  • Download URL: dorc_client-0.2.0-py3-none-any.whl
  • Upload date:
  • Size: 9.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for dorc_client-0.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 1e00436816bf42a556624f6fc6eea9025317789069a0edbd140138715e3708a4
MD5 2f308fbcb088c1ca4f6a2620dd5ddac2
BLAKE2b-256 a74dcb70626a8bc4a796ba359c0add96eb93017b9fc6cba675bda67e898ffaa8

See more details on using hashes here.

Provenance

The following attestation bundles were made for dorc_client-0.2.0-py3-none-any.whl:

Publisher: publish-pypi.yml on dorc-io/dorc-clients

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

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