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 (ODGS Core Engine).

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.3.0.tar.gz (17.6 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.3.0-py3-none-any.whl (17.9 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: odgs_snowflake_bridge-0.3.0.tar.gz
  • Upload date:
  • Size: 17.6 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.3.0.tar.gz
Algorithm Hash digest
SHA256 45165f3dc032ba78164535b67b790095a92987aaa8f9496c23216ea843fb9f82
MD5 f60819ba2b350d4db1f2b06b5bba3d48
BLAKE2b-256 c1eac84b04b8319cf4592d14a400e87db1f74548cae60326813d100d77549290

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for odgs_snowflake_bridge-0.3.0-py3-none-any.whl
Algorithm Hash digest
SHA256 a1db28ab73a01c03384769ff00439ddf90f4edac8247a0f41e7875033cdf3741
MD5 4f7631b747a3c7607410172da5cb1a6b
BLAKE2b-256 4627ff20c189807054e9c2faa401cf14313a48d5ab295d7d282c01da403e222f

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