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.4.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.4-py3-none-any.whl (32.8 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: dg_kit-0.1.4.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.4.tar.gz
Algorithm Hash digest
SHA256 c017916d7cff12343a4dcb40acc438bedb85da83553676889c246f4068719605
MD5 44ab9c82ebbafd8a96ddf2cafb979cd3
BLAKE2b-256 dcec230068ca3a7138392a06729610356f7515a78dacf92263273a416652589e

See more details on using hashes here.

File details

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

File metadata

  • Download URL: dg_kit-0.1.4-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.4-py3-none-any.whl
Algorithm Hash digest
SHA256 0799df2b4ad28be5fcc129e33e6ccc65f425167a7df1a77a51d8dd7c1791d55e
MD5 f059e464fe398f3fe6cb9e4c74637c56
BLAKE2b-256 74f9ca7d786a30d6bfe7c7e8eb066d02527c810ed494b061990043a3361a11c7

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