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.2.tar.gz (25.1 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.2-py3-none-any.whl (28.0 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: ovm_erd-1.0.2.tar.gz
  • Upload date:
  • Size: 25.1 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.2.tar.gz
Algorithm Hash digest
SHA256 a5cd250a4a01226b87b05ffe0038aab488299694bbd1bb66021020c8f55a3018
MD5 87732409624c2dde061ea84e3f284475
BLAKE2b-256 5031930f34a38af43e2f631430f64b3a755263e1d5248d3e04512917370d237f

See more details on using hashes here.

File details

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

File metadata

  • Download URL: ovm_erd-1.0.2-py3-none-any.whl
  • Upload date:
  • Size: 28.0 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.2-py3-none-any.whl
Algorithm Hash digest
SHA256 3861e72b63ec8e742f6fb2cebaca77064fea9bdb4795c01bcddb7ba075dfb71c
MD5 6d1e772e2933bc1a4b21dbe2eea76240
BLAKE2b-256 c8386b0ff3c009c47cda79046d0cafd717d00cd479f95a9eb3fa517a961ac54b

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