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.0.tar.gz (197.1 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.0-py3-none-any.whl (251.7 kB view details)

Uploaded Python 3

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

Hashes for snowflake_semantic_tools-0.1.0.tar.gz
Algorithm Hash digest
SHA256 915508379266db9fa5d542f30d733ace0bf4d141120da32d13586d84aa33f66d
MD5 b432dd4dc89b955391f34bb4e3c2c819
BLAKE2b-256 0804ab5f43b35e16eb505acc8f6b9e11f723899a54f48c648dbda8ea54224051

See more details on using hashes here.

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

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.0-py3-none-any.whl.

File metadata

File hashes

Hashes for snowflake_semantic_tools-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 b2a66ac17139d1001ccb52ca4b1cd815cd1e16e8b27766c8b729d951028235d2
MD5 a0fbbcbabd6eb0ddfccf5d37d95f4328
BLAKE2b-256 19e57fcb85e9c987bb8f48c26cbc98756082672922a5b2163f5fe2a78e2dcc9f

See more details on using hashes here.

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

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