Skip to main content

Bridge: Snowflake Data Dictionary → ODGS Runtime Enforcement Schemas

Project description

ODGS Snowflake Bridge

License ODGS

Transform your Snowflake Data Dictionary into active ODGS runtime enforcement schemas.

Snowflake stores your data. ODGS enforces the rules.


What It Does

The ODGS Snowflake Bridge connects to your Snowflake account, reads INFORMATION_SCHEMA metadata, and transforms table/column definitions into ODGS-compliant JSON schemas for the Universal Interceptor.

Snowflake INFORMATION_SCHEMA      ODGS
┌──────────────┐     Bridge      ┌──────────────┐
│ Databases    │ ──────────────→ │ JSON Schema  │
│ Schemas      │   reads tables, │ + Interceptor│
│ Tables       │   outputs ODGS  │ = Enforcement│
│ Columns      │                 └──────────────┘
└──────────────┘

Three Rule Types Generated

Column Property Rule Type Example
NOT NULL constraint NOT_NULL TXN_ID != None
Data type TYPE_CHECK type(AMOUNT) == 'numeric'
VARCHAR(N) length MAX_LENGTH len(CURRENCY) <= 3

Supports 35+ Snowflake data types including VARIANT, OBJECT, and ARRAY semi-structured types.

Install

pip install odgs-snowflake-bridge

🏢 Enterprise & Public Sector: EU AI Act Compliance

This open-source package connects your physical data infrastructure to the ODGS validation engine. However, if you are operating a High-Risk AI System and require strict liability indemnification under the EU AI Act (Articles 10 & 12), you need cryptographic provenance.

Metric Provenance offers the commercial Enterprise Infrastructure for ODGS:

  • Certified Sovereign Packs: Pre-compiled, cryptographically signed Ed25519 rule bundles for DORA, EU AI Act, and Basel.
  • The S-Cert Sovereign Registry: An air-gapped Enterprise Certificate Authority that mints immutable, JWS-sealed audit logs.

👉 Discover the Sovereign CA Enterprise Node & Packs

Quick Start

Python API

from odgs_snowflake import SnowflakeBridge

bridge = SnowflakeBridge(
    account="xy12345.eu-west-1",
    user="odgs_service",
    password="...",
    organization="acme_corp",
)

# Sync all tables → ODGS metric definitions
bridge.sync(
    database="PRODUCTION",
    output_dir="./schemas/custom/",
    output_type="metrics",
)

# Sync column constraints → enforcement rules
bridge.sync(
    database="PRODUCTION",
    schema_filter="FINANCE",
    output_dir="./schemas/custom/",
    output_type="rules",
    severity="HARD_STOP",
)

CLI

# Using environment variables
export SNOWFLAKE_ACCOUNT=xy12345.eu-west-1
export SNOWFLAKE_USER=odgs_service
export SNOWFLAKE_PASSWORD=...

odgs-snowflake sync \
    --org acme_corp \
    --database PRODUCTION \
    --schema FINANCE \
    --type rules \
    --severity HARD_STOP

# SSO / Browser auth
odgs-snowflake sync \
    --account xy12345.eu-west-1 \
    --user user@company.com \
    --authenticator externalbrowser \
    --org acme_corp \
    --database PRODUCTION

Output

{
  "$schema": "https://metricprovenance.com/schemas/odgs/v4",
  "metadata": {
    "source": "snowflake",
    "tables_processed": 8,
    "items_generated": 47
  },
  "items": [
    {
      "rule_urn": "urn:odgs:custom:acme_corp:rule:transactions_amount_not_null",
      "severity": "HARD_STOP",
      "constraint_type": "NOT_NULL",
      "target_table": "PRODUCTION.FINANCE.TRANSACTIONS",
      "content_hash": "a1b2c3..."
    }
  ]
}

🆕 v4.1.0: Bi-Directional Write-Backs

The ODGS Snowflake bridge now supports Bi-Directional Sync (Plane 4). It can parse your secure sovereign_audit.log offline and push compliance results back directly into your Snowflake table comments using ALTER TABLE ... SET COMMENT.

This creates a seamless feedback loop for Data Stewards without compromising the Air-Gapped nature of the core ODGS protocol.

odgs-snowflake write-back \
    --log-path ./sovereign_audit.log \
    --account xy12345.eu-west-1 \
    --user odgs_service \
    --password YOUR_PASSWORD

Authentication

Method CLI Flags Environment Variables
Password --user + --password SNOWFLAKE_USER + SNOWFLAKE_PASSWORD
SSO / Browser --authenticator externalbrowser
Account --account SNOWFLAKE_ACCOUNT

Requirements

  • Python ≥ 3.9
  • odgs ≥ 4.0.0 (core protocol)
  • snowflake-connector-python ≥ 3.0.0
  • Snowflake account with INFORMATION_SCHEMA access

Related


License

Apache 2.0 — Metric Provenance | The Hague, NL 🇳🇱

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

odgs_snowflake_bridge-0.2.0.tar.gz (16.5 kB view details)

Uploaded Source

Built Distribution

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

odgs_snowflake_bridge-0.2.0-py3-none-any.whl (17.8 kB view details)

Uploaded Python 3

File details

Details for the file odgs_snowflake_bridge-0.2.0.tar.gz.

File metadata

  • Download URL: odgs_snowflake_bridge-0.2.0.tar.gz
  • Upload date:
  • Size: 16.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.9

File hashes

Hashes for odgs_snowflake_bridge-0.2.0.tar.gz
Algorithm Hash digest
SHA256 2a7a78e3dd492e0ea401efdf458090ef3dab35599f9246338bfb2a41262200ca
MD5 d9afadb66c1eb60cb1ce334a1001b8d1
BLAKE2b-256 e25f451acba6f6f5da235358edb52b0026e8d49949591b3926db7d03f056ad94

See more details on using hashes here.

File details

Details for the file odgs_snowflake_bridge-0.2.0-py3-none-any.whl.

File metadata

File hashes

Hashes for odgs_snowflake_bridge-0.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 05bae451de4a1977b769673fac001b8803643deffd6ffe273be817c44991d1f9
MD5 1fffabba27aa45f4d478af2110134743
BLAKE2b-256 c8e01a87f9bcf1484373f33221952f74c088e4a1b0ca4c936e608ddccd8434f9

See more details on using hashes here.

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