Skip to main content

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

Python License


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:


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


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.1.1.tar.gz (197.3 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.1.1-py3-none-any.whl (251.8 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: snowflake_semantic_tools-0.1.1.tar.gz
  • Upload date:
  • Size: 197.3 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.1.1.tar.gz
Algorithm Hash digest
SHA256 368e53b14ef2780f2cf663ccc88c5eeae1ccbc150c1e044f7fa3e69d39910382
MD5 4e92e3aa56bc1863b9c486a46694d196
BLAKE2b-256 65fb7d238c0627b169d3c8b89ae04f35f6c92a7d241fa975f3c9e5d55a93c832

See more details on using hashes here.

Provenance

The following attestation bundles were made for snowflake_semantic_tools-0.1.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.1.1-py3-none-any.whl.

File metadata

File hashes

Hashes for snowflake_semantic_tools-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 cb0d711e22f7362711f0b67a8148493f36c79edf01efc6433d89e17c4a0cf4b7
MD5 f918947bc8b36706235d625672d576c6
BLAKE2b-256 3a77508a2377338a43167caf66149e87ab08b556297a342fd059b05504b15b94

See more details on using hashes here.

Provenance

The following attestation bundles were made for snowflake_semantic_tools-0.1.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