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
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
dbtat the start. All dbt commands should be valid e.grun,test, et cetera.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file dbt_run_api-0.2.2.tar.gz.
File metadata
- Download URL: dbt_run_api-0.2.2.tar.gz
- Upload date:
- Size: 6.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.10.17
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
b013fd555f2cecd240f0beb540b125c905b2bd8084c08d442c1b74faf7ee5613
|
|
| MD5 |
80323eb7bc26f3200436a36ad0f2db82
|
|
| BLAKE2b-256 |
aa6b676608e3147d8d66ef0ff816cc26efcf222d18807fe042703d7eb6b142c2
|
File details
Details for the file dbt_run_api-0.2.2-py3-none-any.whl.
File metadata
- Download URL: dbt_run_api-0.2.2-py3-none-any.whl
- Upload date:
- Size: 3.9 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.10.17
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
34fce974145313cad56a2722288b600e369724fd23553a3ea94c846748352f00
|
|
| MD5 |
95e52362342be161ad5241a582495a85
|
|
| BLAKE2b-256 |
076840713d8417cab735f7d337ce60c8ca0359ebbc6a2fb72cb990ba62fba2c4
|