Skip to main content

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

Python License


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.yaml with 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 init wizard 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:


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


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

snowflake_semantic_tools-0.2.1.tar.gz (244.6 kB view details)

Uploaded Source

Built Distribution

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

snowflake_semantic_tools-0.2.1-py3-none-any.whl (310.5 kB view details)

Uploaded Python 3

File details

Details for the file snowflake_semantic_tools-0.2.1.tar.gz.

File metadata

  • Download URL: snowflake_semantic_tools-0.2.1.tar.gz
  • Upload date:
  • Size: 244.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for snowflake_semantic_tools-0.2.1.tar.gz
Algorithm Hash digest
SHA256 7ca4e7a2213a0e51e277ad2b52c1046612ada3b5396c4f35d3a55c4e60d72edb
MD5 e3d98e606f9e9548c57b82d8d2089561
BLAKE2b-256 30a260c2192c88f5c7a165b1cedeb5652b49f41abd5a69f7eb8e7d7b728fcf2e

See more details on using hashes here.

Provenance

The following attestation bundles were made for snowflake_semantic_tools-0.2.1.tar.gz:

Publisher: publish-to-pypi.yml on WhoopInc/snowflake-semantic-tools

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file snowflake_semantic_tools-0.2.1-py3-none-any.whl.

File metadata

File hashes

Hashes for snowflake_semantic_tools-0.2.1-py3-none-any.whl
Algorithm Hash digest
SHA256 c9588979deb9948c388cdf821977d2192a80d14f119bbd055dde390606ba3482
MD5 26c7760375390247c32c78a2d5a5dba2
BLAKE2b-256 005d9a5b8818fcc35f92bf29e26138d57393a7c4ada5855672f68a1a929b1555

See more details on using hashes here.

Provenance

The following attestation bundles were made for snowflake_semantic_tools-0.2.1-py3-none-any.whl:

Publisher: publish-to-pypi.yml on WhoopInc/snowflake-semantic-tools

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

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