dbt extension for managing Snowflake Semantic Views and Cortex Analyst semantic models
Project description
Snowflake Semantic Tools
Build and deploy Snowflake Semantic Views from your dbt project
What is SST?
SST helps you build Snowflake Semantic Views—a standardized semantic layer that lives in Snowflake and powers AI and BI tools—all from within your dbt projects.
Why Semantic Views matter:
- Cortex Analyst & Agents - Semantic views give Snowflake's AI the context it needs to accurately answer natural language questions about your data
- BI Tools - Sigma, Tableau, and other tools can consume semantic views for consistent metrics and definitions across your organization
- Single source of truth - Define metrics, relationships, and business logic once in Snowflake, use everywhere
What SST does:
- Define semantics as code - Metrics, relationships, filters, verified queries as YAML in your dbt project
- Deploy to Snowflake - Generate native SEMANTIC VIEW objects from your definitions
- Enrich automatically - Pull column types, samples, and metadata from Snowflake schemas
- Validate before deploy - 100+ validation rules catch errors before they reach Snowflake
- Version control everything - Your semantic layer lives in git alongside your dbt models
Quick Start
Installation
pip install snowflake-semantic-tools
Setup
cd your-dbt-project
sst init # Interactive setup wizard
The wizard will:
- Detect your dbt project and profile
- Create
sst_config.ymlwith defaults - Set up the semantic models directory
- Generate example files
Basic Usage
# Validate your semantic models
sst validate
# Enrich specific models with metadata from Snowflake
sst enrich --models customers,orders
# Deploy to Snowflake (validate → extract → generate)
sst deploy
Key Features
- Interactive Setup -
sst initwizard configures your project in seconds - Metadata Enrichment - Auto-populate YAML with column & data types, sample values, synonyms, and enums
- Validation - Catch errors before deployment with comprehensive validation rules
- SQL Syntax Validation - Validate metrics and filters against Snowflake
- Schema Verification - Verify YAML columns exist in Snowflake with fuzzy matching
- Semantic Views - Generate native Snowflake SEMANTIC VIEWs
Documentation
See the docs/ directory for comprehensive documentation:
- Documentation Index - Complete documentation navigation
- Getting Started - Installation and first steps
- CLI Reference - All commands and options
- Semantic Models Guide - Writing metrics and relationships
- Validation Rules - Complete list of all validation checks
- Authentication - Snowflake connection setup
- Configuration Reference - sst_config.yml options
Requirements
- Python 3.10-3.11
- Snowflake account
- dbt project (dbt Core or dbt Cloud CLI)
Commands
| Command | Purpose |
|---|---|
sst init |
Interactive setup wizard |
sst validate |
Check for errors (no Snowflake needed) |
sst enrich |
Add metadata to YAML from Snowflake |
sst format |
YAML linter for consistency |
sst extract |
Load metadata to Snowflake tables |
sst generate |
Create semantic views |
sst deploy |
One-step: validate → extract → generate |
sst debug |
Show config and test connection |
sst migrate-meta |
Migrate meta.sst to config.meta.sst (dbt Fusion) |
Development Setup
Only needed if you're contributing code or developing locally.
# Clone the repository
git clone https://github.com/WhoopInc/snowflake-semantic-tools.git
cd snowflake-semantic-tools
# Install with Poetry (includes dev dependencies)
poetry install --with dev
# Verify installation
sst --version
# Run tests
pytest tests/unit/
# Format code
black snowflake_semantic_tools/
isort snowflake_semantic_tools/
# Run linting
flake8 snowflake_semantic_tools/
See CONTRIBUTING.md for detailed development guidelines.
Contributing
We welcome contributions! Please see CONTRIBUTING.md for:
- How to report issues
- Development setup instructions
- Code style guidelines
- Pull request process
All contributions must be reviewed by the maintainer before merging.
Support
- Documentation: See the docs/ directory
- Issues: GitHub Issues
License
This project is licensed under the Apache License 2.0 - see the LICENSE file for details.
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
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file snowflake_semantic_tools-0.2.4.tar.gz.
File metadata
- Download URL: snowflake_semantic_tools-0.2.4.tar.gz
- Upload date:
- Size: 258.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
9f63fffded3530366c1356611d0ae85f3dfd63e334c368af308acb7ba2906823
|
|
| MD5 |
03102167fdd091ec2fb46d53c9caa40e
|
|
| BLAKE2b-256 |
f4c187c9444958185b512a5780ec65433aa2a7e1f07df8767b617f92a546f3a1
|
Provenance
The following attestation bundles were made for snowflake_semantic_tools-0.2.4.tar.gz:
Publisher:
publish-to-pypi.yml on WhoopInc/snowflake-semantic-tools
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
snowflake_semantic_tools-0.2.4.tar.gz -
Subject digest:
9f63fffded3530366c1356611d0ae85f3dfd63e334c368af308acb7ba2906823 - Sigstore transparency entry: 908676939
- Sigstore integration time:
-
Permalink:
WhoopInc/snowflake-semantic-tools@fa7476ca4b2e457bd540aefb3c036cf59f9e042d -
Branch / Tag:
refs/tags/v0.2.4 - Owner: https://github.com/WhoopInc
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish-to-pypi.yml@fa7476ca4b2e457bd540aefb3c036cf59f9e042d -
Trigger Event:
push
-
Statement type:
File details
Details for the file snowflake_semantic_tools-0.2.4-py3-none-any.whl.
File metadata
- Download URL: snowflake_semantic_tools-0.2.4-py3-none-any.whl
- Upload date:
- Size: 326.9 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
c64c7cbbfbcde1adec6207520bc61e2b8a8466ac33782b56989501416dcc058e
|
|
| MD5 |
a3022f30cac89d410896772001f0d7c8
|
|
| BLAKE2b-256 |
7bb35d79571fd24d212a41de42bc5a3525276837329f8ce149a8aba0d6726369
|
Provenance
The following attestation bundles were made for snowflake_semantic_tools-0.2.4-py3-none-any.whl:
Publisher:
publish-to-pypi.yml on WhoopInc/snowflake-semantic-tools
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
snowflake_semantic_tools-0.2.4-py3-none-any.whl -
Subject digest:
c64c7cbbfbcde1adec6207520bc61e2b8a8466ac33782b56989501416dcc058e - Sigstore transparency entry: 908676952
- Sigstore integration time:
-
Permalink:
WhoopInc/snowflake-semantic-tools@fa7476ca4b2e457bd540aefb3c036cf59f9e042d -
Branch / Tag:
refs/tags/v0.2.4 - Owner: https://github.com/WhoopInc
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish-to-pypi.yml@fa7476ca4b2e457bd540aefb3c036cf59f9e042d -
Trigger Event:
push
-
Statement type: