Skip to main content

Its a static analysis and health scoring for dbt projects — test coverage, duplicate logic, and documentation checks.

Project description

dbt-vitals

Its a static analysis and health scoring for dbt projects — the "cargo clippy for dbt."

Unlike a SQL linter (indentation, keyword casing), dbt-vitals looks at your project's structure: dead models, missing tests, duplicated business logic, documentation coverage, and (given warehouse stats) incremental-model candidates. It parses manifest.json / catalog.json — the artifacts dbt already generates — so it needs no warehouse credentials of its own.

Overall Health
76/100
Warnings: 8   Critical: 0   Info: 4

What it checks

Module What it flags Needs catalog.json?
Lineage Dead/unused models, circular dependencies No
Testing Models missing unique/not_null on their likely primary key No
Duplicate Logic Repeated CASE WHEN blocks across models (candidates for a macro) No
Documentation Model/column description coverage % No
Incremental Candidates Large table-materialized models that could be incremental Yes

Local setup

Requires Python 3.9+.

git clone https://github.com/shivah12/dbt-vitals.git
cd dbt-vitals

python -m venv .venv
source .venv/bin/activate        # Windows: .venv\Scripts\activate

pip install -e ".[dev]"

Run the test suite against the bundled synthetic example project:

pytest

Try the CLI against the bundled example (no real dbt project needed):

dbt-vitals analyze . --manifest examples/sample_manifest.json --catalog examples/sample_catalog.json

Run it against a real dbt project:

cd /path/to/your/dbt/project
dbt compile               # or `dbt docs generate` to also get catalog.json
dbt-vitals analyze .

CLI options

dbt-vitals analyze <target_dir>          # target_dir defaults to "."
  --manifest PATH        # override manifest.json location
  --catalog PATH         # override catalog.json location
  --json                 # machine-readable output
  --ci-comment           # markdown summary for a PR comment
  --fail-under N         # exit 1 if health score < N (CI gating)

CI integration

.github/workflows/dbt-vitals.yml is included — it runs dbt-vitals on every PR, posts the health score as a comment, and fails the build if the score drops below a threshold. Adjust the dbt compile step for your adapter/profile.

Known limitations (by design, for v0.1)

  • Duplicate detection only looks at CASE WHEN expressions, not arbitrary repeated subqueries or joins.
  • Incremental candidates use a fixed row-count threshold, not a real cost/runtime estimate — that would require warehouse-specific query plans.
  • Primary key inference for the testing module is a naming heuristic (id, <model>_id, or any *_id column) since dbt's manifest has no first-class primary key concept.
  • No plugin system yet (warehouse-specific checks) — deliberately deferred, see the original scoping notes for why.

License

MIT — see LICENSE.

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_vitals-0.1.3.tar.gz (16.3 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

dbt_vitals-0.1.3-py3-none-any.whl (17.5 kB view details)

Uploaded Python 3

File details

Details for the file dbt_vitals-0.1.3.tar.gz.

File metadata

  • Download URL: dbt_vitals-0.1.3.tar.gz
  • Upload date:
  • Size: 16.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.1

File hashes

Hashes for dbt_vitals-0.1.3.tar.gz
Algorithm Hash digest
SHA256 496d6ddef540309c7bfcfde057cee3108817b4303da08b626df12a08987c1d05
MD5 e879b8dd57f58b4f151e0d8071f6f593
BLAKE2b-256 e00e6283689ea74b07341002b9063066a40caa126ae96b1dd4f2c9c843151163

See more details on using hashes here.

File details

Details for the file dbt_vitals-0.1.3-py3-none-any.whl.

File metadata

  • Download URL: dbt_vitals-0.1.3-py3-none-any.whl
  • Upload date:
  • Size: 17.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.1

File hashes

Hashes for dbt_vitals-0.1.3-py3-none-any.whl
Algorithm Hash digest
SHA256 232e3bf98c7618f08c6c807a60e0d8746f76c231cd6a9240b9c1088b9f955e8e
MD5 9bed6006a55be40c7a536c200ed7ba1d
BLAKE2b-256 cfd434aac09bf89b1ed027a298a7a5ebd8704632de98ebd1c48a3b9f469d9473

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page