A CLI and Python library for integrating Workstream and dbt-core.
Project description
workstream-dbt-core
A CLI and Python library for integrating dbt-core and Workstream.
Installation
pip install workstream-dbt-core
Usage
Installing this package installs a CLI app. You can learn about its commands and options using:
workstream --help
Reporting a dbt Invocation
Report a dbt-core invocation to Workstream by posting artifacts from dbt's target
directory
to the Workstream API. The CLI defaults to searching for a directory named target
in the
current working directory, but this is configurable with the --target-path
or -t
option.
workstream report -t /path/to/dbt/target --client-id abc123 --client-secret xyz987
Exit Codes
By default, workstream report
will always exit with a 0 code, even if it encounters critical errors, so that it doesn't interrupt later steps in your pipeline. If you would like workstream report
to exit with a nonzero code on error, you can run it with the --exit-nonzero
option:
workstream report --exit-nonzero
Environment Variables
All CLI options can also be set using environment variables. Vars start with the prefix WORKSTREAM_DBT_
and then share their name with their associated option. The following command is equivalent to the previous one:
WORKSTREAM_DBT_TARGET_PATH="/path/to/dbt/target" WORKSTREAM_DBT_CLIENT_ID="abc123" WORKSTREAM_DBT_CLIENT_SECRET="xyz987" workstream report
Contributing
This project is built with Poetry. After cloning, install with:
poetry install
Then spawn a subshell with a virtual environment activated:
poetry shell
Testing and Linting
This project uses pytest and ruff. With poetry shell
activated, run tests with:
pytest
Format and lint with:
ruff format
ruff . --fix
or if you have make, lint and test with:
make
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
Hashes for workstream_dbt_core-0.1.1.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | a7e375d785d39299c646f50aa1f04622acd629d4a28fc2c095344d38fcc3b955 |
|
MD5 | d8a1a8a41de8669071ea7c88df56ad32 |
|
BLAKE2b-256 | 0025188f10711a995af668b5f2679084dd0717ec8ebb756f39a0571014143ee9 |
Hashes for workstream_dbt_core-0.1.1-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 9e8c519cbd60ef1d7a80192207e0b44dbeb4d205a664112263e5c6c6a22d360a |
|
MD5 | 3ae435139d9e42759dfa775b8b024208 |
|
BLAKE2b-256 | 54ff2b4ec9cc2a1987b403a2ff4448ee73ffb22f1f0c8a07b81070199a0717b4 |