Skip to main content

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

Metadata

Release files for ovm-erd 2.0.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for ovm-erd 2.0.0
File Size Uploaded Provenance
ovm_erd-2.0.0.tar.gz 22.3 kB Without provenance Details

Built distribution (wheel)

Table of built distributions (wheels) for ovm-erd 2.0.0
File Interpreter ABI Platform
ovm_erd-2.0.0-py3-none-any.whl Python 3 none any Details

Total release size: 45.7 kB

Release files / ovm_erd-2.0.0.tar.gz

Download URL ovm_erd-2.0.0.tar.gz
Size 22.3 kB
Tags Source
SHA-256 checksum
How to use checksums
8f9b2ec144c19efc26ae3a673c3786f934bc847966ea3d17b7c526ddf1113db1
BLAKE2b-256 checksum
How to use checksums
3befd1935364abaee6817b1acefdbc9222fbc7f0309bb6f514608cadbb56918f
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.12.10

Release files / ovm_erd-2.0.0-py3-none-any.whl

Download URL ovm_erd-2.0.0-py3-none-any.whl
Size 23.5 kB
Tags Python 3
SHA-256 checksum
How to use checksums
ff7175e1c11959109b76fc64951ea0fef22186428aa0c8f2b6f342dcb9b13a29
BLAKE2b-256 checksum
How to use checksums
17b71c2f71e9b3ad866a903b2c37515f1712b0ff3d76d51f7dd9e8fc45407dcf
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.12.10

Security for ovm-erd 2.0.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page