dbt extension for managing Snowflake Semantic Views and Cortex Analyst semantic models
Project description
Snowflake Semantic Tools
dbt extension for managing Snowflake Semantic Views and Cortex Analyst semantic models
What is SST?
SST integrates Snowflake's semantic layer into your dbt workflow. Define semantic views, metrics, and relationships in YAML alongside your dbt models, then deploy them as native Snowflake SEMANTIC VIEW objects.
What you can do:
- Define semantics in dbt - Metrics, relationships, filters as YAML in your dbt project
- Deploy to Snowflake - Create SEMANTIC VIEW objects for Cortex Analyst and BI tools
- Enrich metadata - Auto-populate YAML from Snowflake table schemas
- Validate before deploy - Catch errors without Snowflake connection
- Maintain as code - Version control your semantic layer with dbt
Quick Start
Installation
pip install snowflake-semantic-tools
Basic Usage
# Validate your semantic models
sst validate
# Enrich dbt models with metadata from Snowflake
sst enrich models/ --database PROD_DB --schema my_schema
# Deploy to Snowflake (validate → extract → generate)
sst deploy --db PROD_DB --schema SEMANTIC_VIEWS
Key Features
- Metadata Enrichment - Auto-populate YAML with column types, samples, and enums
- Validation - Catch errors before deployment (no Snowflake connection needed)
- Semantic Views - Generate native Snowflake SEMANTIC VIEWs
- Defer Database - Generate dev views that reference prod tables (like dbt defer)
- YAML Linter - Consistent formatting across your project
- Python API - Full programmatic access to all features
Documentation
See the docs/ directory for comprehensive documentation:
- Getting Started - Installation and first steps
- Validation Checklist - Complete list of all 98 validation checks
- CLI Reference - All commands and options
- User Guide - Enrichment and validation deep dives
- Semantic Models Guide - Writing metrics and relationships
- Authentication - Snowflake connection setup
Requirements
- Python 3.9+
- Snowflake account
- dbt project with YAML definitions
Commands
| Command | Purpose |
|---|---|
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 |
Installation
For users (recommended):
pip install snowflake-semantic-tools
For developers/contributors:
If you want to contribute or modify the code, see the Development Setup section below or CONTRIBUTING.md for detailed instructions.
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.1.0.tar.gz.
File metadata
- Download URL: snowflake_semantic_tools-0.1.0.tar.gz
- Upload date:
- Size: 197.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
915508379266db9fa5d542f30d733ace0bf4d141120da32d13586d84aa33f66d
|
|
| MD5 |
b432dd4dc89b955391f34bb4e3c2c819
|
|
| BLAKE2b-256 |
0804ab5f43b35e16eb505acc8f6b9e11f723899a54f48c648dbda8ea54224051
|
Provenance
The following attestation bundles were made for snowflake_semantic_tools-0.1.0.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.1.0.tar.gz -
Subject digest:
915508379266db9fa5d542f30d733ace0bf4d141120da32d13586d84aa33f66d - Sigstore transparency entry: 781929682
- Sigstore integration time:
-
Permalink:
WhoopInc/snowflake-semantic-tools@8b6a0105e5878322f8e69e4dae3ba0fa99ed771d -
Branch / Tag:
refs/tags/v0.1.0 - Owner: https://github.com/WhoopInc
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish-to-pypi.yml@8b6a0105e5878322f8e69e4dae3ba0fa99ed771d -
Trigger Event:
push
-
Statement type:
File details
Details for the file snowflake_semantic_tools-0.1.0-py3-none-any.whl.
File metadata
- Download URL: snowflake_semantic_tools-0.1.0-py3-none-any.whl
- Upload date:
- Size: 251.7 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 |
b2a66ac17139d1001ccb52ca4b1cd815cd1e16e8b27766c8b729d951028235d2
|
|
| MD5 |
a0fbbcbabd6eb0ddfccf5d37d95f4328
|
|
| BLAKE2b-256 |
19e57fcb85e9c987bb8f48c26cbc98756082672922a5b2163f5fe2a78e2dcc9f
|
Provenance
The following attestation bundles were made for snowflake_semantic_tools-0.1.0-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.1.0-py3-none-any.whl -
Subject digest:
b2a66ac17139d1001ccb52ca4b1cd815cd1e16e8b27766c8b729d951028235d2 - Sigstore transparency entry: 781929685
- Sigstore integration time:
-
Permalink:
WhoopInc/snowflake-semantic-tools@8b6a0105e5878322f8e69e4dae3ba0fa99ed771d -
Branch / Tag:
refs/tags/v0.1.0 - Owner: https://github.com/WhoopInc
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish-to-pypi.yml@8b6a0105e5878322f8e69e4dae3ba0fa99ed771d -
Trigger Event:
push
-
Statement type: