Skip to main content

A small package

Project description

dbt-run-api

Once installed allows DBT commands to be sent via an api call.

Installation:

pip install dbt-run-api

Set up:

After installing the package ensure your DBT project is set up correctly with all needed profile variables either explicitly defined or available as ENV-variables.

Execution:

Run server while in the same directory as your `dbt_project.yml':

uvicorn dbt_run_api:app

Ensure you DBT project has access to the database you have defined in profile.yml

Send call to endpoint:

curl --header 'Content-Type: application/json' \
     --request POST \
     http://localhost:8000/dbt \
    --data \
    '{  "cmd": "run",  "vars": {"test_var": "1", "date": "20240423"},  "target": "dev",  "threads" : 8,  "project-dir": "wab",  "profiles-dir": "wab",  "full-refresh": true}'

Notes:

  • commands are passed without dbt at the start. All dbt commands should be valid e.g run, test, et cetera.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

dbt_run_api-0.0.4.tar.gz (6.3 kB view hashes)

Uploaded Source

Built Distribution

dbt_run_api-0.0.4-py3-none-any.whl (3.5 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page