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.5.tar.gz (21.6 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.5-py3-none-any.whl (33.0 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: dg_kit-0.1.5.tar.gz
  • Upload date:
  • Size: 21.6 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.5.tar.gz
Algorithm Hash digest
SHA256 b4e92211f425ce76e8a7f7ddb08b16cb61523dd8835695044ba0d3c91a949fe2
MD5 c63d38cfdb1a68447df72940669660ff
BLAKE2b-256 d2c2bcb7380ddd66b819d7291712f56219f27b3c1b6036d5dba4678e49547965

See more details on using hashes here.

File details

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

File metadata

  • Download URL: dg_kit-0.1.5-py3-none-any.whl
  • Upload date:
  • Size: 33.0 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.5-py3-none-any.whl
Algorithm Hash digest
SHA256 7db8aa22de1c3973fde0197fc8ee8f4ca7d72cd7538dae8854e024ccbda08772
MD5 40dfe8d3004e57b020c21f77013879b6
BLAKE2b-256 5cef1d520a84419f1d7b2b4668074fa6ba66728ce24f34331ac31920be09ed3f

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