Skip to main content

🧹 dbt-cleaner

Find and drop Snowflake objects that no dbt manifest claims.

A terminal UI for data engineers who need to keep Snowflake clean across multiple dbt projects. dbt-cleaner compares live database objects against one or more manifest.json files and gives you an interactive way to review and generate DROP statements — with zero risk of accidentally nuking something dbt still owns.


✨ Features

🔍 Scans tables, views, materialized views, dynamic tables, external tables
📦 Supports multiple dbt projects targeting the same database
🗄️ Supports multiple target databases in a single session
🔒 Locked schemas — schemas with dbt objects are protected; only orphaned objects inside are listed
⚙️ Manual mode per schema — drop a whole schema or cherry-pick individual objects
👁️ Implicitly Dropped tab shows what CASCADE will remove before you commit
📝 Generates a ready-to-run .sql script with correct DROP statements per object type
🔌 Reads connections from ~/.snowflake/config.toml with env-var override support
🧩 Extensible connector protocol — adding Postgres or Databricks = one new file

📦 Installation

pip install dbt-cleaner

Or with uv:

uv tool install dbt-cleaner

Requires Python 3.13+.


🚀 Usage

Interactive TUI

dbt-cleaner

Pre-fill fields from the command line:

dbt-cleaner \
  --connection prod \
  --database ANALYTICS \
  --database REPORTING \
  --manifest path/to/project_a/manifest.json \
  --manifest path/to/project_b/manifest.json

CLI flags

Flag Short Description
--connection NAME -c Snowflake connection name from config.toml
--database DB -d Target database (repeatable)
--manifest PATH -m Path to manifest.json (repeatable)
--include-schema SCHEMA Only scan these schemas (repeatable)
--exclude-schema SCHEMA Skip these schemas (repeatable)

🖥️ Screen flow

Config screen  ──►  Analysis screen  ──►  Results screen  ──►  Preview screen
  connections         scans Snowflake       review orphans        SQL + save/print
  databases           parses manifests      cycle schema state
  manifests

Schema states (Results screen)

Icon State Action
○ Not selected No action
✓ Selected DROP SCHEMA … CASCADE
⚙ Manual Pick individual objects to drop
🔒 Locked Schema has dbt models — protected

Press Enter or Space to cycle state. Locked schemas cannot be changed.


🔑 Snowflake authentication

dbt-cleaner reads ~/.snowflake/config.toml:

[connections.prod]
account = "myorg-myaccount"
user = "deploy_user"
authenticator = "externalbrowser"

[connections.dev]
account = "myorg-myaccount"
authenticator = "PROGRAMMATIC_ACCESS_TOKEN"
token = "..."

Environment variable overrides follow the pattern SNOWFLAKE_CONNECTIONS_<NAME>_<PARAM>:

export SNOWFLAKE_CONNECTIONS_DEV_TOKEN="my-pat-token"
export SNOWFLAKE_CONNECTIONS_DEV_USER="deploy_user"

🧠 How orphan detection works

  1. Parses all supplied manifest.json files — model, snapshot, and seed nodes only (ephemeral models and sources are excluded)
  2. Fetches all objects from target databases via INFORMATION_SCHEMA
  3. Compares on (database, schema, identifier) — case-insensitive for unquoted identifiers
  4. Classifies schemas:
    • Orphan schema — zero dbt coverage → candidate for DROP SCHEMA CASCADE
    • Locked schema — at least one dbt object → only un-tracked objects listed individually

📄 License

MIT

Metadata

Release files for dbt-cleaner 0.1.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for dbt-cleaner 0.1.0
File Size Uploaded Provenance Actions
dbt_cleaner-0.1.0.tar.gz 18.9 kB With provenance Details for dbt_cleaner-0.1.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for dbt-cleaner 0.1.0
File Interpreter ABI Platform Actions
dbt_cleaner-0.1.0-py3-none-any.whl Python 3 none any Details for dbt_cleaner-0.1.0-py3-none-any.whl

Total release size: 40.3 kB

Release files / dbt_cleaner-0.1.0.tar.gz

Download URL dbt_cleaner-0.1.0.tar.gz
Size 18.9 kB
Tags Source
SHA-256 checksum
How to use checksums
98cbc28c2fcb97f3e32db0be84f87e2afeb57f50ace63b85ac3e653e77c322be
BLAKE2b-256 checksum
How to use checksums
dffd0277411d4ccdd663c90ef68ae1febab6429c498cb0ee9db09626652af74e
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.12

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Jun 18, 2026.

Transparency log

Release files / dbt_cleaner-0.1.0-py3-none-any.whl

Download URL dbt_cleaner-0.1.0-py3-none-any.whl
Size 21.4 kB
Tags Python 3
SHA-256 checksum
How to use checksums
d78f991cf4747d1410e843e6dda15a9d7cdc2a1724d89467db92942e49f74aac
BLAKE2b-256 checksum
How to use checksums
166822bbf07080d3e9994f737f6408c2093eb4dca959264d0374006b015c4995
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.12

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Jun 18, 2026.

Transparency log

Security for dbt-cleaner 0.1.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

Full provenance

All 2 files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for dbt_cleaner-0.1.0.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Jun 18, 2026.

Transparency log

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

0.1.0 This release

2 release files Full provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page