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

Uploaded Python 3

File details

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

File metadata

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

File hashes

Hashes for ovm_erd-2.0.0.tar.gz
Algorithm Hash digest
SHA256 8f9b2ec144c19efc26ae3a673c3786f934bc847966ea3d17b7c526ddf1113db1
MD5 bac5a22783c2903fee0cfd5f885c6163
BLAKE2b-256 3befd1935364abaee6817b1acefdbc9222fbc7f0309bb6f514608cadbb56918f

See more details on using hashes here.

File details

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

File metadata

  • Download URL: ovm_erd-2.0.0-py3-none-any.whl
  • Upload date:
  • Size: 23.5 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-2.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 ff7175e1c11959109b76fc64951ea0fef22186428aa0c8f2b6f342dcb9b13a29
MD5 b53065169c54c8effce94c9c467b2eaf
BLAKE2b-256 17b71c2f71e9b3ad866a903b2c37515f1712b0ff3d76d51f7dd9e8fc45407dcf

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