Skip to main content

Generate ERDs from local repository's for DBT AutomateDV projects

Project description

OVM-ERD

Generate automated Entity-Relationship Diagrams (ERDs), SQL queries, and validation reports from your dbt repository.


📌 Overview

ovm-erd is a Python package designed to simplify the visualization and validation of Data Vault (DV) structured databases using dbt repositories. Automatically generate ER diagrams in multiple formats (Graphviz, Mermaid, Draw.io), produce SQL queries, and validate your database metadata.


✨ Features

  • Automated ER Diagrams: Generate clear diagrams in:

    • Graphviz (PNG format)
    • Mermaid (Markdown)
    • Draw.io (.drawio.xml and PNG formats)
  • SQL Generation: Automatically build SQL queries based on your repository metadata.

  • Metadata Validation: Verify your data vault entities and relationships with HTML validation reports.

  • Easy-to-use CLI: Simple commands to automate common tasks.


🚀 Installation

OVM-ERD requires Graphviz to be installed locally. See https://graphviz.org/ for details.

Install via pip:

pip install ovm-erd

📚 Usage

CLI

Generate ER diagrams:

ovm-erd generate [graphviz|mermaid|drawio]

Generate ER diagrams with specific paths:

ovm-erd generate graphviz --path /your/output/path

Generate diagrams distinctly for each ensemble/tag:

ovm-erd generate drawio --distinct

Generate SQL queries for a specific ensemble:

ovm-erd sql --ensemble your_ensemble_name

Validate metadata and generate HTML report:

ovm-erd validate

Specify custom paths for validation reports:

ovm-erd validate --path /your/report/path

Python API

Use the package directly in Python:

from ovm_erd.repository_reader import build_metadata_dict
from ovm_erd.erd_graphviz import generate_graphviz

repository_path = "your/dbt/repo"
output_path = "output/graphviz"

metadata = build_metadata_dict(repository_path=repository_path)
generate_graphviz(metadata, output_dir=output_path)

You can specify paths dynamically by assigning them to variables, enhancing flexibility:

custom_repo_path = "/path/to/dbt/repository"
custom_output_path = "/path/to/output"

metadata = build_metadata_dict(repository_path=custom_repo_path)
generate_graphviz(metadata, output_dir=custom_output_path)

🎨 ERD Color Coding

  • Hub: Light Blue (#D6EAF8)
  • Satellite: Light Yellow (#FFFACD)
  • Link: Light Red (#F5B7B1)

Run tests:

pytest tests/

Example output Graphviz

example output


📄 License

GPL © Ferry Ouwerkerk / Data-Project BV

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

ovm_erd-1.0.3.tar.gz (25.9 kB view details)

Uploaded Source

Built Distribution

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

ovm_erd-1.0.3-py3-none-any.whl (29.4 kB view details)

Uploaded Python 3

File details

Details for the file ovm_erd-1.0.3.tar.gz.

File metadata

  • Download URL: ovm_erd-1.0.3.tar.gz
  • Upload date:
  • Size: 25.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.12.10

File hashes

Hashes for ovm_erd-1.0.3.tar.gz
Algorithm Hash digest
SHA256 f2c6fcf94ddfce983c34f28049500fea8482b2808799e1dcc4081cba22c14170
MD5 8b1e26bec814d71b1b7bf2657b202256
BLAKE2b-256 ef89b6717beeb9bea2f2f2e2b251e451ddc256c8602fc8e404ff2008851c5eba

See more details on using hashes here.

File details

Details for the file ovm_erd-1.0.3-py3-none-any.whl.

File metadata

  • Download URL: ovm_erd-1.0.3-py3-none-any.whl
  • Upload date:
  • Size: 29.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.12.10

File hashes

Hashes for ovm_erd-1.0.3-py3-none-any.whl
Algorithm Hash digest
SHA256 421da0d4b0f211720ab8786f5b4147dfca8b267fb06c6b3fe6b6ae9045556dc0
MD5 f49f4e1c844f212e8ab582964e70f87e
BLAKE2b-256 b608b0d8130ad0ce1d9f93c2e9b83c7bd7f796956b42f77b62783d1e7bb9a6bf

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