/dbt_cloud_api_client

dbt cloud api client

Primary LanguagePythonMIT LicenseMIT

PyPI version PyPI Supported Python Versions CI codecov

dbt cloud api client

dbt cloud api client

Usage:

Install Client.

pip install dbt-cloud-api-client

Example.

import time

from dbt_cloud_api_client.client import DbtCloudClient
...

client = DbtCloudClient(token='<token>')

account = client.get_account_by_name('<ACCOUNT_NAME>')

job = account.get_job_by_name('<JOB NAME IN DBT CLOUD>')
run = job.run('Job triggered from python.')

while not run.is_finished():
    print('{} - {}'.format(run.id, run.status))
    run.reload()
    # print(run.data) # display all details of run.
    # sleep for a period of time
    time.sleep(60)
print('{} - {}'.format(run.id, run.status))

Contributing

Install tox

pip install tox