> For the complete documentation index, see [llms.txt](https://v2.dataos.info/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://v2.dataos.info/references/interfaces/apis/getting-started/sdks/python-sdk.md).

# Python SDK

The Python SDK wraps the Data Product API with typed models and a simple client.

It builds the base URL for you. It also sets `Accept: application/json` on every request.

{% file src="/files/ZaIf4cy9lPhbUUXjm3xt" %}

### Install

```bash
pip install vulcan_sdk-0.1.0-py3-none-any.whl
```

### Create a client

```python
from vulcan_sdk import VulcanClient

client = VulcanClient(
    fqdn="example.dataos.io",
    dp_name="b2b_saas",
    access_token="<your-dataos-api-token>",
    tenant="public",
)
```

Base URL:

```
https://{fqdn}/vulcan/tenants/{tenant}/data-products/{tenant}-{dp_name}/api/v1
```

### Available clients

<table><thead><tr><th width="210.541015625">Client</th><th>Methods</th></tr></thead><tbody><tr><td><code>client.metadata</code></td><td><code>.get()</code> · <code>.get_semantic()</code> · <code>.download_powerbi()</code> · <code>.download_tableau()</code></td></tr><tr><td><code>client.activity</code></td><td><code>.list_plans()</code> · <code>.get_plan(id)</code> · <code>.get_plan_git_diff(id)</code> · <code>.list_runs()</code> · <code>.get_run(id)</code> · <code>.list_models()</code> · <code>.get_model_runs(name)</code></td></tr><tr><td><code>client.dq</code></td><td><code>.get_summary()</code> · <code>.list_rules()</code> · <code>.get_rule(id)</code> · <code>.get_rule_by_name(model, dim, name)</code></td></tr><tr><td><code>client.query</code></td><td><code>.submit_statement(sql)</code> · <code>.get_statement(id)</code> · <code>.get_statement_result(id)</code> · <code>.submit_semantic_rest(query)</code> · <code>.submit_semantic_sql(sql)</code> · <code>.get_metric(name)</code> · <code>.get_usage_metrics()</code></td></tr><tr><td><code>client.perspectives</code></td><td><code>.list()</code> · <code>.get(slug)</code> · <code>.get_result(slug)</code> · <code>.create(slug, req)</code> · <code>.update(slug, req)</code> · <code>.delete(slug)</code></td></tr><tr><td><code>client.notifications</code></td><td><code>.list()</code></td></tr><tr><td><code>client.followers</code></td><td><code>.follow()</code> · <code>.unfollow()</code> · <code>.get_follow_status()</code> · <code>.list()</code> · <code>.get_analytics()</code></td></tr></tbody></table>

### Query example

```python
import time

stmt = client.query.submit_statement("SELECT country, COUNT(*) AS users FROM users GROUP BY 1")

while stmt.status.upper() not in {"SUCCESS", "FAILED"}:
    time.sleep(2)
    stmt = client.query.get_statement(stmt.id)

result = client.query.get_statement_result(stmt.id)
print(result.cols)
for row in result.rows:
    print(row)
```

### Error handling

```python
from vulcan_sdk import VulcanError

try:
    plan = client.activity.get_plan("bad-id")
except VulcanError as e:
    print(e.status_code, e.detail)
```

### Notes

* Built on `uplink` and Pydantic v2.
* Supports Python 3.8+.
* Returns typed models for IDE autocomplete.


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://v2.dataos.info/references/interfaces/apis/getting-started/sdks/python-sdk.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
