Name | workstream-dbt-core JSON |
Version |
0.2.0
JSON |
| download |
home_page | |
Summary | A CLI and Python library for integrating Workstream and dbt-core. |
upload_time | 2024-03-04 16:39:49 |
maintainer | |
docs_url | None |
author | Ted Conbeer |
requires_python | >=3.8,<4.0 |
license | Apache 2.0 |
keywords |
|
VCS |
|
bugtrack_url |
|
requirements |
No requirements were recorded.
|
Travis-CI |
No Travis.
|
coveralls test coverage |
No coveralls.
|
# workstream-dbt-core
A CLI and Python library for integrating dbt-core and Workstream.
## Installation
```bash
pip install workstream-dbt-core
```
## Usage
Installing this package installs a CLI app. You can learn about its commands and options using:
```bash
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.
```bash
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.
However, if you rely on dbt failures to cause workflow failures, this may not work for you. If you would like `workstream report` to exit with a nonzero code when dbt runs, tests, or sources fail, you can run it with the `--exit-nonzero` option:
```
dbt test || true
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:
```bash
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](https://python-poetry.org/). After cloning, install with:
```bash
poetry install
```
Then spawn a subshell with a virtual environment activated:
```bash
poetry shell
```
### Testing and Linting
This project uses pytest and ruff. With `poetry shell` activated, run tests with:
```bash
pytest
```
Format and lint with:
```bash
ruff format
ruff . --fix
```
or if you have make, lint and test with:
```bash
make
```
Raw data
{
"_id": null,
"home_page": "",
"name": "workstream-dbt-core",
"maintainer": "",
"docs_url": null,
"requires_python": ">=3.8,<4.0",
"maintainer_email": "",
"keywords": "",
"author": "Ted Conbeer",
"author_email": "tconbeer@users.noreply.github.com",
"download_url": "https://files.pythonhosted.org/packages/57/bc/59819f202caeba5599da370c47f0c6cb0f2156c875c97f8d8438d55c4bb3/workstream_dbt_core-0.2.0.tar.gz",
"platform": null,
"description": "# workstream-dbt-core\n\nA CLI and Python library for integrating dbt-core and Workstream.\n\n## Installation\n\n```bash\npip install workstream-dbt-core\n```\n\n## Usage\n\nInstalling this package installs a CLI app. You can learn about its commands and options using:\n\n```bash\nworkstream --help\n```\n\n### Reporting a dbt Invocation\n\nReport a dbt-core invocation to Workstream by posting artifacts from dbt's `target` directory\nto the Workstream API. The CLI defaults to searching for a directory named `target` in the\ncurrent working directory, but this is configurable with the `--target-path` or `-t` option.\n\n```bash\nworkstream report -t /path/to/dbt/target --client-id abc123 --client-secret xyz987\n```\n\n#### Exit Codes\n\nBy 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. \n\nHowever, if you rely on dbt failures to cause workflow failures, this may not work for you. If you would like `workstream report` to exit with a nonzero code when dbt runs, tests, or sources fail, you can run it with the `--exit-nonzero` option:\n\n```\ndbt test || true\nworkstream report --exit-nonzero\n```\n\n### Environment Variables\n\nAll 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:\n\n```bash\nWORKSTREAM_DBT_TARGET_PATH=\"/path/to/dbt/target\" WORKSTREAM_DBT_CLIENT_ID=\"abc123\" WORKSTREAM_DBT_CLIENT_SECRET=\"xyz987\" workstream report\n```\n\n## Contributing\n\nThis project is built with [Poetry](https://python-poetry.org/). After cloning, install with:\n\n```bash\npoetry install\n```\n\nThen spawn a subshell with a virtual environment activated:\n\n```bash\npoetry shell\n```\n\n### Testing and Linting\n\nThis project uses pytest and ruff. With `poetry shell` activated, run tests with:\n\n```bash\npytest\n```\n\nFormat and lint with:\n\n```bash\nruff format\nruff . --fix\n```\n\nor if you have make, lint and test with:\n\n```bash\nmake\n```\n",
"bugtrack_url": null,
"license": "Apache 2.0",
"summary": "A CLI and Python library for integrating Workstream and dbt-core.",
"version": "0.2.0",
"project_urls": null,
"split_keywords": [],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "62a8d46265a631e8cf63fe3664ab90676ce3093d7d88722be37599ccb2ac7eb5",
"md5": "db3a52b24cb2cb837158579fbc00310c",
"sha256": "c4d3f52465c5ebd18abce39dd8dcaa0e0b5ccbdeb9e22e01b6e141da52c0bf3a"
},
"downloads": -1,
"filename": "workstream_dbt_core-0.2.0-py3-none-any.whl",
"has_sig": false,
"md5_digest": "db3a52b24cb2cb837158579fbc00310c",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": ">=3.8,<4.0",
"size": 8019,
"upload_time": "2024-03-04T16:39:48",
"upload_time_iso_8601": "2024-03-04T16:39:48.435225Z",
"url": "https://files.pythonhosted.org/packages/62/a8/d46265a631e8cf63fe3664ab90676ce3093d7d88722be37599ccb2ac7eb5/workstream_dbt_core-0.2.0-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "57bc59819f202caeba5599da370c47f0c6cb0f2156c875c97f8d8438d55c4bb3",
"md5": "d0f3cf8a42dc3956006b801bc7b70611",
"sha256": "66237b8c71d1df648a4d68911cae5c23e9e9ea01a93cc0194b52bd4a73a0bbee"
},
"downloads": -1,
"filename": "workstream_dbt_core-0.2.0.tar.gz",
"has_sig": false,
"md5_digest": "d0f3cf8a42dc3956006b801bc7b70611",
"packagetype": "sdist",
"python_version": "source",
"requires_python": ">=3.8,<4.0",
"size": 6028,
"upload_time": "2024-03-04T16:39:49",
"upload_time_iso_8601": "2024-03-04T16:39:49.265849Z",
"url": "https://files.pythonhosted.org/packages/57/bc/59819f202caeba5599da370c47f0c6cb0f2156c875c97f8d8438d55c4bb3/workstream_dbt_core-0.2.0.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2024-03-04 16:39:49",
"github": false,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"lcname": "workstream-dbt-core"
}