Home
An unaffiliated python interface for dbt Cloud APIs
Documentation: https://dbtc.dpguthrie.com
Interactive Demo: https://dpguthrie-dbtc-streamlit-home-yy7c0b.streamlit.app/
Source Code: https://github.com/dpguthrie/dbtc
V2 Docs: https://docs.getdbt.com/dbt-cloud/api-v2
V3 Docs: https://docs.getdbt.com/dbt-cloud/api-v3#/operations/List%20Accounts
Quick Intro¶
Overview¶
dbtc is an unaffiliated python interface to various dbt Cloud API endpoints.
This library acts as a convenient interface to two different APIs that dbt Cloud offers:
- Cloud API: This is a REST API that exposes endpoints that allow users to programatically create, read, update, and delete resources within their dbt Cloud Account.
- Metadata API: This is a GraphQL API that exposes metadata generated from a job run within dbt Cloud.
Requirements¶
Python 3.7+
- Requests - The elegant and simple HTTP library for Python, built for human beings.
- Typer - Library for building CLI applications
Installation¶
Basic Usage¶
Python¶
The interface to both APIs are located in the dbtCloudClient
class.
The example below shows how you use the cloud
property on an instance of the dbtCloudClient
class to access methods that allow for programmatic control over dbt Cloud resources.
from dbtc import dbtCloudClient
client = dbtCloudClient()
project = client.cloud.get_project(account_id=1, project_id=1)
CLI¶
All of the methods available via the dbtCloudClient
class are also available through the command line via dbtc
.
The same code above can be written as follows using the CLI:
dbtc get-project --account-id=1 --project-id=1
License¶
This project is licensed under the terms of the MIT license.