{"id":44693,"library":"dbt-sl-sdk","title":"dbt Semantic Layer SDK","description":"A Python client for dbt's Semantic Layer, enabling programmatic access to dbt Metrics and saved queries. Current version: 0.13.4, release cadence: monthly.","status":"active","version":"0.13.4","language":"python","source_language":"en","source_url":"https://github.com/dbt-labs/dbt-semantic-layer-sdk-python","tags":["dbt","semantic-layer","metrics","analytics"],"install":[{"cmd":"pip install dbt-sl-sdk","lang":"bash","label":"Install from PyPI"}],"dependencies":[{"reason":"HTTP client for API requests","package":"httpx","optional":false},{"reason":"Data validation and settings","package":"pydantic","optional":false},{"reason":"Backend interface for some queries","package":"dbt-server","optional":true}],"imports":[{"wrong":"from dbt_sl_sdk import SemanticLayerClient","symbol":"SemanticLayerClient","correct":"from dbtsl import SemanticLayerClient"}],"quickstart":{"code":"import os\nfrom dbt_sl_sdk import SemanticLayerClient\n\nclient = SemanticLayerClient(\n    environment_id=os.environ['DBT_ENVIRONMENT_ID'],\n    auth_token=os.environ['DBT_AUTH_TOKEN']\n)\nresult = client.query(\n    metrics=['order_total'],\n    group_by=['metric_time__day'],\n    where={'metric_time__day': '>= 2024-01-01'}\n)\nprint(result.to_pandas().head())","lang":"python","description":"Initialize client with environment ID and auth token, then query a metric."},"warnings":[{"fix":"Use `result.to_pandas()` or `result.rows` to access data.","message":"In version 0.11.0, the `query()` method changed from returning a list of dicts to returning a `QueryResult` object. Code using `result[0]` will break.","severity":"breaking","affected_versions":">=0.11.0"},{"fix":"Always provide a dictionary with field names as keys and string conditions as values.","message":"The `where` parameter in `query()` expects a dictionary, not a string. Passing a raw SQL string will raise a `ValueError`.","severity":"gotcha","affected_versions":"all"},{"fix":"Replace `auth_token` with `service_token` or use environment variable `DBT_SERVICE_TOKEN`.","message":"The `auth_token` parameter is deprecated as of 0.12.0. Use a service token instead.","severity":"deprecated","affected_versions":">=0.12.0"}],"env_vars":null,"search_vec":"'0.13.4':24 'access':15 'analyt':33 'cadenc':26 'client':7 'current':22 'dbt':1,9,17,28 'enabl':13 'layer':3,12,31 'metric':18,32 'month':27 'programmat':14 'python':6 'queri':21 'releas':25 'save':20 'sdk':4 'semant':2,11,30 'semantic-lay':29 'version':23","created_at":"2026-06-07T12:51:22.525071+00:00","updated_at":"2026-06-07T12:51:22.525071+00:00","problems":null,"ecosystem":"pypi","meta_description":null,"install_score":null,"quickstart_score":null,"quickstart_tag":null,"pypi_latest":null,"cli_name":null,"cli_version":null,"type":"library","homepage":null,"github":null,"docs":null,"changelog":null,"pypi":null,"npm":null,"openapi_spec":null,"status_page":null,"smithery":null,"categories":["analytics"],"base_url":null,"auth_type":null,"provenance":{"verified_status":"passing","verified_at":"2026-07-03","last_verified":"2026-07-03","next_check":"2026-08-02","install_tag":null}}