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
dbt
at the start. All dbt commands should be valid e.grun
,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.7.tar.gz
(6.4 kB
view hashes)
Built Distribution
Close
Hashes for dbt_run_api-0.0.7-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 757db20938f7db90c19fe4f16f5ef8898d8c06f0eca48c310e8f2ed4bd74d687 |
|
MD5 | e52942c15eab30043b4ed223ead93fd5 |
|
BLAKE2b-256 | 1902969cbcf79f7348f1ee0d750b5bf3df8b1fc4d39ea26a5bc48e7558f53b30 |