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)

Data Governance Kit helps you access Data Governance information programmatically. It provides core objects that model Physical Model, Logical Model, Business Information, and related governance metadata. Integrations let you pull this data from tools like dbt, Oracle Data Modeler, and Notion, with more connectors planned in upcoming releases.

This toolkit is handy for building Data Governance CI gates, strengthening Data Ops practices, and keeping governance checks close to your delivery workflows.

Requirements

  • Python >= 3.10

Install

pip install -e .

Optional extras:

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

Quick Start

Parse an Oracle Data Modeler project

from dg_kit.integrations.odm.parser import ODMParser

parser = ODMParser("path/to/model.dmd")
bi = parser.parse_bi()
lm = parser.parse_lm()

print(lm.version, len(lm.entities))

Parse a dbt project into a physical model

from dg_kit.integrations.dbt.parser import DBTParser

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

Validate with conventions

from dg_kit.base.convention import Convention, ConventionValidator
from dg_kit.base.enums import ConventionRuleSeverity

convention = Convention("example")

@convention.rule(
    name="has-entities",
    severity=ConventionRuleSeverity.ERROR,
    description="Logical model must contain at least one entity",
)
def has_entities(lm, pm):
    return set() if lm.entities else {("no entities")}

issues = ConventionValidator(lm, pm, convention).validate()

Sync to Notion data catalog

from dg_kit.integrations.notion.api import NotionDataCatalog

catalog = NotionDataCatalog(
    notion_token="secret",
    dc_table_id="data_source_id",
)
rows = catalog.pull()
print(len(rows))

Development

Run tests:

pytest

Export requirements with uv:

uv export --extra dbt --extra notion --group test -o requirements.txt

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

Uploaded Python 3

File details

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

File metadata

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

File hashes

Hashes for dg_kit-0.1.0.tar.gz
Algorithm Hash digest
SHA256 0e7f2f288102cd73f4723fc033e9c9d0fc0e546dd255f4ea4987f2eada4cc15f
MD5 d497240de0cc73c1cea088f3e4d4205e
BLAKE2b-256 0ead34b79a1935daf55e04b32591163fa87e2786c3550f9a094de808cb4ae63c

See more details on using hashes here.

File details

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

File metadata

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

File hashes

Hashes for dg_kit-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 a5de901e31a9bdacf5281f40144040c9cb9ea430015d50e405d15a67de7c7022
MD5 2a7179126d3fab9790ed7ec6626be5fd
BLAKE2b-256 c7904459163d40997e0c6c8c6aa6c3cefe57b2f310b7791a585274163a8408d7

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