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 -X POST http://localhost:8000/dbt -H 'Content-Type: application/json' -d '{"cmd":"test", "parameters": {"--vars":"{\"test_var\":1}", "--project-dir":"./"}}'
Notes:
- the
/
are necessary when passing a nested json - commands are passed without
dbt
at the start. All dbt commands should be valid e.grun
,test
, et cetera.
Results in the server log:
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.2.tar.gz
(6.3 kB
view hashes)
Built Distribution
Close
Hashes for dbt_run_api-0.0.2-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 1652093ae4da1c828f88f066d0c10832c7fe5c2296156d009478f11dcd09e385 |
|
MD5 | c35cd27bcaadaed480094d403c39c297 |
|
BLAKE2b-256 | f99e8aa69144dbc310171473bbef19bf3caeded115ebd96eeab1cd5da202d3ae |