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.3.tar.gz (21.3 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.3-py3-none-any.whl (32.8 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: dg_kit-0.1.3.tar.gz
  • Upload date:
  • Size: 21.3 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.3.tar.gz
Algorithm Hash digest
SHA256 8b676746dc134c2a8654dddc9cfea1bb50edbb1a12ea8ce3d010f54af5104e2f
MD5 afd7c9927911abf3f5ce10e7f4c02a89
BLAKE2b-256 21504f93c4203525a0df8841343cbd578b825be82acfa25d373e015d0d95a7dd

See more details on using hashes here.

File details

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

File metadata

  • Download URL: dg_kit-0.1.3-py3-none-any.whl
  • Upload date:
  • Size: 32.8 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.3-py3-none-any.whl
Algorithm Hash digest
SHA256 e73509c5cd6271e4264d7985bdf7b5868ae7f2b4c031ca4e0229ae050af65a7a
MD5 03c9eca5309834339c8f0026277505fb
BLAKE2b-256 82c54e9efc2fdcaa138093b7a11f215c1b7f070123dfe3dbd57cc4878e0c0533

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