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(orDORC_JWTfor 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
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
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
d86d99d7b89268735f7abb350d1f9ea13bcd8ac296b45d975cc0f5587aa6f302
|
|
| MD5 |
f7fb0217df1f92b45d945b4085cf9ab9
|
|
| BLAKE2b-256 |
f77f00851b37f4bfccc57c2247451ca9d379c491423333da23a0e0cacc6c61b1
|
Provenance
The following attestation bundles were made for dorc_client-0.2.0.tar.gz:
Publisher:
publish-pypi.yml on dorc-io/dorc-clients
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
dorc_client-0.2.0.tar.gz -
Subject digest:
d86d99d7b89268735f7abb350d1f9ea13bcd8ac296b45d975cc0f5587aa6f302 - Sigstore transparency entry: 779612010
- Sigstore integration time:
-
Permalink:
dorc-io/dorc-clients@0f662ab95c4496969f70056345dec215a4c70efe -
Branch / Tag:
refs/tags/v0.2.0 - Owner: https://github.com/dorc-io
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish-pypi.yml@0f662ab95c4496969f70056345dec215a4c70efe -
Trigger Event:
push
-
Statement type:
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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
1e00436816bf42a556624f6fc6eea9025317789069a0edbd140138715e3708a4
|
|
| MD5 |
2f308fbcb088c1ca4f6a2620dd5ddac2
|
|
| BLAKE2b-256 |
a74dcb70626a8bc4a796ba359c0add96eb93017b9fc6cba675bda67e898ffaa8
|
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
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
dorc_client-0.2.0-py3-none-any.whl -
Subject digest:
1e00436816bf42a556624f6fc6eea9025317789069a0edbd140138715e3708a4 - Sigstore transparency entry: 779612011
- Sigstore integration time:
-
Permalink:
dorc-io/dorc-clients@0f662ab95c4496969f70056345dec215a4c70efe -
Branch / Tag:
refs/tags/v0.2.0 - Owner: https://github.com/dorc-io
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish-pypi.yml@0f662ab95c4496969f70056345dec215a4c70efe -
Trigger Event:
push
-
Statement type: