Skip to main content

Data Governance Kit provides programmatic access to data governance metadata with integrations for different Logical and Physical Modeling tools.

Project description

Data Governance Kit (dg_kit)

dg_kit provides programmatic access to governance metadata across logical models, physical models, and data catalogs. It is designed for CI checks, governance automation, and metadata synchronization workflows.

What it supports

  • Parse physical metadata from dbt projects.
  • Parse logical and business metadata from Oracle Data Modeler exports.
  • Validate model consistency with YAML-driven convention rules.
  • Synchronize a data catalog with a Notion data source.

Requirements

  • Python >=3.10

Installation

Install the package in editable mode:

pip install -e .

Optional extras:

pip install -e ".[dbt]"
pip install -e ".[notion]"

If you use uv:

uv sync --group dev

CLI usage

The package exposes a CLI entrypoint:

dg_kit <command> --config ./dg_kit.yml

Supported commands:

  • test validates LM/PM consistency and convention rules.
  • sync syncs the local model to the remote data catalog.
  • pull pulls the remote data catalog into a local checkpoint.

Environment variables (for sync and pull)

These commands require:

export NOTION_TOKEN=...
export DATA_CATALOG_ID=...

On PowerShell:

$env:NOTION_TOKEN="..."
$env:DATA_CATALOG_ID="..."

Example commands

dg_kit test --config ./dg_kit.yml --convention ./dg_kit.convention.yml
dg_kit sync --config ./dg_kit.yml
dg_kit pull --config ./dg_kit.yml

Configuration examples

dg_kit.yml:

name: sample_project
version: v1
logical_model:
  path: ./metadata/odm_versions
physical_model:
  path: ./warehouse/dbt_project
data_catalog:
  dc_checkpoint_path: ./.artifacts
  row_property_mapping:
    id: ID
    title: Name
    type: Type
    domain: Domain
  section_name_mapping:
    description: Description
    pk_attributes_references: PK attributes
    attributes_references: Attributes
    relations_references: Relations
    linked_documents: Linked documents
    responsible_parties: Responsible parties
    pm_mapping_references: Physical mapping
    source_systems: Source systems
    parent_entity_reference: Parent entity
    data_type: Data type
    sensitivity_type: Sensitivity type
    source_entity_reference: Source entity
    target_entity_reference: Target entity

dg_kit.convention.yml:

lm_mapping_layers:
  - core
rules:
  lm_x_pm_consistency:
    severity: error
    description: Logical and physical mappings must stay consistent.
  allowed_dependencies:
    severity: warning
    description: Restrict cross-layer dependencies.
    rules:
      core: [stage, core]
  regex_by_layer:
    severity: warning
    description: Enforce table naming conventions.
    rules:
      core_tables:
        layer: core
        regex:
          string: "^core_[a-z0-9_]+$"
technical_fields:
  core:
    - created_at
    - updated_at

Python API quick examples

Build physical model from dbt:

from pathlib import Path
from dg_kit.integrations.dbt.parser import DBTParser

pm = DBTParser(Path("path/to/dbt_project"), version="v1").parse_pm()
print(pm.version, len(pm.tables))

Parse one ODM version from a versioned project directory:

from pathlib import Path
from dg_kit.integrations.odm.parser import ODMVersionedProjectParser

parser = ODMVersionedProjectParser(Path("path/to/odm_versions"))
parser.parse_version("v1", pm)
lm = parser.get_model("v1")
print(lm.version, len(lm.entities))

Development

Run local quality checks:

./scripts/ci.sh

Run tests:

pytest

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

dg_kit-0.1.8.tar.gz (24.9 kB view details)

Uploaded Source

Built Distribution

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

dg_kit-0.1.8-py3-none-any.whl (36.8 kB view details)

Uploaded Python 3

File details

Details for the file dg_kit-0.1.8.tar.gz.

File metadata

  • Download URL: dg_kit-0.1.8.tar.gz
  • Upload date:
  • Size: 24.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for dg_kit-0.1.8.tar.gz
Algorithm Hash digest
SHA256 7626ac7eaec54e68b352833dae11e23f6473ecee5aaf75fa74b4d35054d7c5b4
MD5 8ac5daa97ae1efd692e19b73d02f3825
BLAKE2b-256 be0759eb0bad42816a6c7ef9ebcf2c70f6c630029094d4dc3a086a7b55c3d7a4

See more details on using hashes here.

File details

Details for the file dg_kit-0.1.8-py3-none-any.whl.

File metadata

  • Download URL: dg_kit-0.1.8-py3-none-any.whl
  • Upload date:
  • Size: 36.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for dg_kit-0.1.8-py3-none-any.whl
Algorithm Hash digest
SHA256 8da88b9da6ba197656416bc9a15106d3ba9c21d42b7563e2faf4dfba5906c900
MD5 5ec02d40f6afd6323cbf247e31f7c4c9
BLAKE2b-256 3e757bbd756e27dd767d390985b0de39684af5ddc4a1519628267f94396e1d91

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