skillfed

dbt-sl-sdk

A client for dbt's Semantic Layer

dbt-sl-sdk v0.13.4 116.3K downloads/30d#12,213 on PyPI
License unclear Active released

What it is and what it does

dbt-sl-sdk is a Python client for dbt's Semantic Layer, a centralized metrics platform accessible through a REST API. The package wraps that API in a straightforward Python interface, handling connection pooling via session context managers and supporting both synchronous and asynchronous workflows. All query results come back as pyarrow tables, which you can then convert to other formats if needed.

The library is designed for developers who want to pull metric data into Python applications without writing raw HTTP calls. It includes features like lazy loading to avoid fetching nested object lists for large projects, optional telemetry that can be disabled, and a consistent API between sync and async variants. The package requires Python 3.9 or later and depends on pyarrow, mashumaro, adbc-driver-flightsql, adbc-driver-manager, and typing-extensions.

Use it for:

  • Query dbt metrics and dimensions programmatically from a Python application without manual API calls.
  • Build data pipelines that fetch metric data and convert pyarrow results to other formats.
  • Integrate dbt Semantic Layer queries into async applications using async variants for non-blocking I/O.
  • Explore metric definitions and their nested dimensions via lazy-loading mode for large projects.

Worth the install?

AI-flagged interpretation of the facts on this page — verify before relying

A Python client library for querying dbt's Semantic Layer via REST APIs, supporting both synchronous and asynchronous workflows with results returned as PyArrow tables.

Yes. The package is actively maintained, has low install friction, carries no known vulnerabilities, and fills a clear need for Python developers working with dbt's Semantic Layer. The sync/async flexibility and pyarrow integration are well-suited to modern data workflows. The only caveat is that license treatment is unclear, so verify licensing implications for your use case before committing to production.

Install

dbt-sl-sdk on PyPI

pip

pip install dbt-sl-sdk

uv

uv add dbt-sl-sdk

poetry

poetry add dbt-sl-sdk

Installing dbt-sl-sdk

Before you install

Low install friction with a pure-wheel distribution and five runtime dependencies. Actively maintained with a recent release within the last 79 days.

Quickstart

pip install "dbt-sl-sdk[sync]"

from dbt_sl_sdk import SemanticLayerClient

client = SemanticLayerClient(
    environment_id=123,
    auth_token="<your-token>",
    host="semantic-layer.cloud.getdbt.com",
)

with client.session():
    metrics = client.metrics()
    table = client.query(metrics=[metrics[0].name], group_by=["metric_time"])
    print(table)

Requires Python 3.9 or later. You must provide valid dbt Semantic Layer credentials (environment_id, auth_token, host).

Verify before relying

  • Whether the package's telemetry collection (platform information sent to dbt Labs by default) poses privacy concerns for your use case.
  • Performance characteristics when working with large metric definitions under lazy loading mode.
  • Specific license terms and any restrictions on commercial or proprietary use.

Package facts

License not declared (unclear)
Python support supports the current Python release (<3.14,>=3.9)
Install friction low — pure-Python wheel
Runtime dependencies 5 — adbc-driver-flightsql, adbc-driver-manager, mashumaro, pyarrow, typing-extensions
Maintenance actively maintained — 79 days since the last release
First released
Downloads 116,274/month — #12,213 on PyPI (30-day window, as of 2026-08-14)
Known vulnerabilities none known (OSV.dev, checked 2026-08-14)

Evidence: dbt_sl_sdk-0.13.4-py3-none-any.whl

Tags

dbt semantic layer python clientquery dbt metrics programmaticallydbt cloud api python sdksemantic layer rest api clientdbt metric query library
dbt-integrationsemantic-layer

More Front-Ends packages