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/YOUR_GITHUB_USERNAME/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.2.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.2-py3-none-any.whl (17.5 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: dbt_vitals-0.1.2.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.2.tar.gz
Algorithm Hash digest
SHA256 3fbc537eeaef99146e12774d63a5c6230f1d09133da0d43941b7fc8b23281464
MD5 a6978344152fcd7b8a9083d94e2dd4e9
BLAKE2b-256 be61f92718f18efe8ac32327a6369e14598f2f5e572d98f43aeed7e14cb88f81

See more details on using hashes here.

File details

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

File metadata

  • Download URL: dbt_vitals-0.1.2-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.2-py3-none-any.whl
Algorithm Hash digest
SHA256 42e2524fb60c4b318a13e888dd16fde2531e0abc3dc5b2370501c05dc40b1020
MD5 ac7cc5ef399390abacb20307678de4a9
BLAKE2b-256 5d564ae463975a7f2f022accf94ded457f365a1749d4acec85a020cb0b4361a5

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