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

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.

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 details)

Uploaded Source

Built Distribution

dbt_run_api-0.0.7-py3-none-any.whl (3.5 kB view details)

Uploaded Python 3

File details

Details for the file dbt_run_api-0.0.7.tar.gz.

File metadata

  • Download URL: dbt_run_api-0.0.7.tar.gz
  • Upload date:
  • Size: 6.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.10.14

File hashes

Hashes for dbt_run_api-0.0.7.tar.gz
Algorithm Hash digest
SHA256 eb0497e122b24cbe8b4f4a275e9b1cf8d7812eabd70070d9457b87c5812ddafd
MD5 862cef8bc9a63a3269347fdd439517c5
BLAKE2b-256 9942ef65ddac16b6b9d0816736853730a9a481f482c4d32dc4a840f828c818dd

See more details on using hashes here.

File details

Details for the file dbt_run_api-0.0.7-py3-none-any.whl.

File metadata

  • Download URL: dbt_run_api-0.0.7-py3-none-any.whl
  • Upload date:
  • Size: 3.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.10.14

File hashes

Hashes for dbt_run_api-0.0.7-py3-none-any.whl
Algorithm Hash digest
SHA256 757db20938f7db90c19fe4f16f5ef8898d8c06f0eca48c310e8f2ed4bd74d687
MD5 e52942c15eab30043b4ed223ead93fd5
BLAKE2b-256 1902969cbcf79f7348f1ee0d750b5bf3df8b1fc4d39ea26a5bc48e7558f53b30

See more details on using hashes here.

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