Skip to main content

dbt-run-api

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

Installation:

pip install dbt-run-api

NOTE: currently the package comes with dbt-postgres. If you need another adapter then it would have to be install separately

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}'
curl --header 'Content-Type: application/json' \
     --request POST \
     http://localhost:8000/dbt \
    --data \
    '{  "cmd": "test"}'

Notes:

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

Metadata

Release files for dbt-run-api 0.2.2

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for dbt-run-api 0.2.2
File Size Uploaded
dbt_run_api-0.2.2.tar.gz 6.7 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for dbt-run-api 0.2.2
File Interpreter ABI Platform
dbt_run_api-0.2.2-py3-none-any.whl Python 3 none any Details

Total release size: 10.5 kB

Release files / dbt_run_api-0.2.2.tar.gz

Download URL dbt_run_api-0.2.2.tar.gz
Size 6.7 kB
Tags Source
SHA-256 checksum
How to use checksums
b013fd555f2cecd240f0beb540b125c905b2bd8084c08d442c1b74faf7ee5613
BLAKE2b-256 checksum
How to use checksums
aa6b676608e3147d8d66ef0ff816cc26efcf222d18807fe042703d7eb6b142c2
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.10.17

Release files / dbt_run_api-0.2.2-py3-none-any.whl

Download URL dbt_run_api-0.2.2-py3-none-any.whl
Size 3.9 kB
Tags Python 3
SHA-256 checksum
How to use checksums
34fce974145313cad56a2722288b600e369724fd23553a3ea94c846748352f00
BLAKE2b-256 checksum
How to use checksums
076840713d8417cab735f7d337ce60c8ca0359ebbc6a2fb72cb990ba62fba2c4
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.10.17

Release history Release notifications | RSS feed

This release

0.2.2 This release

2 release files

0.2.0

2 release files

0.0.11

2 release files

0.0.10

2 release files

0.0.9

2 release files

0.0.8

2 release files

0.0.7

2 release files

0.0.6

2 release files

0.0.4

2 release files

0.0.3

2 release files

0.0.2

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page