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)

🛠 Development & Contribution

Contributions and improvements are welcome. Please fork the repository and open a pull request with your enhancements.

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.1.tar.gz (11.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.1-py3-none-any.whl (14.5 kB view details)

Uploaded Python 3

File details

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

File metadata

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

File hashes

Hashes for ovm_erd-1.0.1.tar.gz
Algorithm Hash digest
SHA256 35a14eeba40029a2462675ba06955b4498671727063185054f5f4a35a70034ba
MD5 dd67e1aaa8dce5c52d494b819e3587ad
BLAKE2b-256 a607503ce23981f3c3a561195d43edbf9139c94b3c759cd94b298d0980f737be

See more details on using hashes here.

File details

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

File metadata

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

File hashes

Hashes for ovm_erd-1.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 c2277dcdfa2fde815b1fb1ad767071dc44d142e3ecd4990046d661027769f936
MD5 05168d2193268260779dc4d03d00eb52
BLAKE2b-256 859e8ad7acd7501e6f0a199202fe14f6961eabfe99b6544b9170986e52eae22f

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