Typed Python client for the Rocky SQL transformation engine
Project description
rocky-sdk
A typed Python client for the Rocky SQL transformation engine.
rocky-sdk wraps the rocky CLI binary (subprocess + --output json) behind a
typed RockyClient. Each method builds the right argv, runs the binary, parses
the JSON output, and returns a Pydantic model. Failures surface as RockyError
subclasses carrying structured fields (exit code, stderr tail, version strings)
rather than opaque messages.
It is for human Python callers: notebooks, scripts, and orchestrators. The
dagster-rocky integration is a thin
Dagster adapter built on this client. For AI agents, use rocky mcp; for a
language-agnostic HTTP surface, use rocky serve.
Install
pip install rocky-sdk
The rocky binary is not bundled. Install it separately and put it on $PATH
(or pass binary_path=). See the
releases page. The SDK requires
engine v1.34.0 or newer.
Usage
from rocky_sdk import RockyClient
client = RockyClient(config_path="rocky.toml")
# Read-only inspection — all return typed Pydantic models
result = client.compile()
for diag in result.diagnostics:
print(diag.severity, diag.message)
lineage = client.lineage("customer_orders", column="email")
catalog = client.catalog()
# Execute a pipeline; stream live progress to a callback
run = client.run(filter="tenant=acme", log_callback=print)
print(run.summary)
Errors
from rocky_sdk import RockyClient
from rocky_sdk.exceptions import RockyVersionError, RockyCommandError, RockyTimeoutError
client = RockyClient(config_path="rocky.toml", timeout_seconds=600)
try:
client.run(filter="tenant=acme")
except RockyTimeoutError as exc:
print("timed out after", exc.timeout_seconds, "s")
print(exc.stderr_tail)
except RockyCommandError as exc:
print("exit", exc.returncode)
print(exc.stderr_tail)
RockyError is the base of the hierarchy:
| Exception | Raised when |
|---|---|
RockyBinaryNotFoundError |
the rocky binary is missing |
RockyVersionError |
the binary is older than the SDK's minimum |
RockyTimeoutError |
a command exceeds timeout_seconds |
RockyCommandError |
a command exits non-zero |
RockyPartialFailure |
a non-zero run still returned a parseable partial result (only with allow_partial=False) |
RockyOutputParseError |
stdout was not the expected JSON shape |
RockyServerError |
a rocky serve HTTP request failed |
RockyGovernanceError |
a governance_override would silently full-revoke |
Example
A runnable end-to-end script lives at examples/quickstart.py. With the rocky binary on your PATH:
python examples/quickstart.py
It spins up a throwaway DuckDB playground (no credentials) and walks through compile, DAG, lineage, a real run, and typed error handling.
License
Apache-2.0
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 rocky_sdk-0.1.1.tar.gz.
File metadata
- Download URL: rocky_sdk-0.1.1.tar.gz
- Upload date:
- Size: 171.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.13
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
0c07a2194d280b8eec7dbd72c767afde2beadb264c148472e5133e2fb9920618
|
|
| MD5 |
bc1effb8bde582b82c4bcb1af528cbfa
|
|
| BLAKE2b-256 |
ea2bc706ab757295f92d6702f6b68b109b6923da17d27d4a6765703cae76228b
|
Provenance
The following attestation bundles were made for rocky_sdk-0.1.1.tar.gz:
Publisher:
sdk-release.yml on rocky-data/rocky
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
rocky_sdk-0.1.1.tar.gz -
Subject digest:
0c07a2194d280b8eec7dbd72c767afde2beadb264c148472e5133e2fb9920618 - Sigstore transparency entry: 1815569954
- Sigstore integration time:
-
Permalink:
rocky-data/rocky@282d94022f7970f3535d410fcaa4d219c5d4138b -
Branch / Tag:
refs/tags/sdk-v0.1.1 - Owner: https://github.com/rocky-data
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
sdk-release.yml@282d94022f7970f3535d410fcaa4d219c5d4138b -
Trigger Event:
push
-
Statement type:
File details
Details for the file rocky_sdk-0.1.1-py3-none-any.whl.
File metadata
- Download URL: rocky_sdk-0.1.1-py3-none-any.whl
- Upload date:
- Size: 175.0 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.13
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
497ac4695d94536b9613263b75c38b24d1529bbfd197a4398c6455162b74fedd
|
|
| MD5 |
e8680dff8315795921e34ff4fb880cc6
|
|
| BLAKE2b-256 |
41b13c75852c4fbaa4ab33a0928a3fffe2441c8c60c3e703fb0eac3a4dfb64d5
|
Provenance
The following attestation bundles were made for rocky_sdk-0.1.1-py3-none-any.whl:
Publisher:
sdk-release.yml on rocky-data/rocky
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
rocky_sdk-0.1.1-py3-none-any.whl -
Subject digest:
497ac4695d94536b9613263b75c38b24d1529bbfd197a4398c6455162b74fedd - Sigstore transparency entry: 1815570195
- Sigstore integration time:
-
Permalink:
rocky-data/rocky@282d94022f7970f3535d410fcaa4d219c5d4138b -
Branch / Tag:
refs/tags/sdk-v0.1.1 - Owner: https://github.com/rocky-data
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
sdk-release.yml@282d94022f7970f3535d410fcaa4d219c5d4138b -
Trigger Event:
push
-
Statement type: