From 8bb4261706ff99d12951d89c10f5dcd80ead2dea Mon Sep 17 00:00:00 2001 From: Doug Guthrie Date: Sat, 6 Apr 2024 16:06:25 -0700 Subject: [PATCH] Deployed 545e7c0 to 0.11 with MkDocs 1.5.3 and mike 2.0.0 --- 0.11/guide/intro/index.html | 21 +++++++++++++++++++++ 0.11/search/search_index.json | 2 +- 0.11/sitemap.xml.gz | Bin 127 -> 127 bytes 3 files changed, 22 insertions(+), 1 deletion(-) diff --git a/0.11/guide/intro/index.html b/0.11/guide/intro/index.html index f6c7dde..7a55870 100644 --- a/0.11/guide/intro/index.html +++ b/0.11/guide/intro/index.html @@ -739,6 +739,7 @@

Interfaces
from dbtc import dbtCloudClient
@@ -786,6 +787,26 @@ 

Interfacesnode_name = node['name'] ...

+

sl

+
from dbtc import dbtCloudClient
+
+client = dbtCloudClient(environment_id=1)
+
+query_result = client.sl.query(
+    metrics=['total_revenue', 'total_profit', 'total_customers'],
+    group_by=['customer__region', 'customer__nation', 'metric_time__quarter'],
+)
+
+# As a default the `result` attribute will be a pandas.DataFrame
+query_result.result
+
+# Also view the SQL
+query_result.sql
+
+# Or do something based on the status of the query
+if query_result.status == 'SUCCESSFUL':
+    ...
+

CLI

This package also comes with a command-line utility, dbtc. All of the methods available through the cloud or metadata properties on the dbtCloudClient class are available through the command line as well.

The command line interface also accepts additional environment variables:

diff --git a/0.11/search/search_index.json b/0.11/search/search_index.json index 9f6812f..fbe7a2c 100644 --- a/0.11/search/search_index.json +++ b/0.11/search/search_index.json @@ -1 +1 @@ -{"config":{"lang":["en"],"separator":"[\\s\\-]+","pipeline":["stopWordFilter"]},"docs":[{"location":"","title":"Home","text":"

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

"},{"location":"#quick-intro","title":"Quick Intro","text":""},{"location":"#overview","title":"Overview","text":"

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:

"},{"location":"#requirements","title":"Requirements","text":"

Python 3.7+

"},{"location":"#installation","title":"Installation","text":"pip install dbtc Successfully installed dbtc restart \u21bb"},{"location":"#basic-usage","title":"Basic Usage","text":""},{"location":"#python","title":"Python","text":"

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\n\nclient = dbtCloudClient()\n\nproject = client.cloud.get_project(account_id=1, project_id=1)\n
"},{"location":"#cli","title":"CLI","text":"

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\n
"},{"location":"#license","title":"License","text":"

This project is licensed under the terms of the MIT license.

"},{"location":"changelog/","title":"Changelog","text":""},{"location":"changelog/#0112","title":"[0.11.2]","text":""},{"location":"changelog/#fixed","title":"Fixed","text":""},{"location":"changelog/#0111","title":"[0.11.1]","text":""},{"location":"changelog/#fixed_1","title":"Fixed","text":""},{"location":"changelog/#0110","title":"[0.11.0]","text":""},{"location":"changelog/#added","title":"Added","text":""},{"location":"changelog/#0100-2024-02-08","title":"[0.10.0] - 2024-02-08","text":""},{"location":"changelog/#added_1","title":"Added","text":""},{"location":"changelog/#090-2024-01-11","title":"[0.9.0] - 2024-01-11","text":""},{"location":"changelog/#removed","title":"Removed","text":""},{"location":"changelog/#added_2","title":"Added","text":"