Skip to main content

Visualize Dataform table dependencies as interactive SVG diagrams

Project description

Dataform Dependency Visualizer

Generate beautiful, interactive SVG diagrams showing dependencies between Dataform tables.

Version Python License

Features

  • 📊 Interactive SVG Diagrams - Visualize dependencies for each table
  • 🎨 Color-Coded - Tables (blue), views (green), operations (orange)
  • 🔍 Master Index - Browse all tables in one HTML interface
  • 📁 Schema Organization - Automatically organized by database schema
  • Pure Python - No Graphviz required

Installation

pip install dataform-dependency-visualizer

Prerequisites

  • Python 3.10+
  • Node.js
  • @dataform/core ^3.0.0
# Install in your Dataform project
cd your-dataform-project
npm install @dataform/core@^3.0.0

Usage

1. Generate Dependencies Report

python -m dataform_viz.dataform_check > dependencies_text_report.txt

2. Generate Visualizations

# For all schemas
dataform-deps --report dependencies_text_report.txt generate-all

# For specific schema
dataform-deps --report dependencies_text_report.txt generate dashboard

# For individual table
dataform-deps --report dependencies_text_report.txt generate schema_name table_name

3. View Results

Open output/dependencies_master_index.html in your browser

Additional Commands

# Generate master index and open in browser
dataform-deps --report dependencies_text_report.txt index --open

# Custom output directory
dataform-deps --report dependencies_text_report.txt --output my_diagrams generate-all

# Cleanup Dataform issues (removes database references, fixes constants)
python -m dataform_viz.dataform_check --cleanup

Python API

from dataform_viz import DependencyVisualizer

viz = DependencyVisualizer('dependencies_text_report.txt')
viz.load_report()

# Generate for specific schema
viz.generate_schema_svgs('dashboard', output_dir='output')

# Generate all schemas
viz.generate_all_svgs(output_dir='output')

# Generate master index
viz.generate_master_index('output')

Understanding the Diagrams

Each SVG diagram shows:

  • Center (Yellow): The table being viewed
  • Left (Blue): Dependencies - tables this reads FROM
  • Right (Green): Dependents - tables that read FROM this
  • Schema Labels: Database schema for each table
  • Type Badges: table, view, incremental, operation

Output Structure

output/
├── dependencies_master_index.html    # Main browser interface
├── schema_name/
│   ├── table1.svg
│   ├── table2.svg
│   └── ...
└── ...

Common Issues

"wwim_utils is not defined" or compilation errors

Run the cleanup utility:

python -m dataform_viz.dataform_check --cleanup

This removes:

  • database: lines from config blocks
  • database: parameters from ref() calls
  • Undefined constant references

Empty diagrams

Ensure you're using the text format report:

python -m dataform_viz.dataform_check > dependencies_text_report.txt

Development

# Clone and install
git clone https://github.com/OshigeAkito/dataform-dependency-visualizer
cd dataform-dependency-visualizer
poetry install

# Run tests
poetry run pytest

# Type checking
poetry run mypy src/

License

MIT License - See LICENSE file

Links

Changelog

v0.2.0 (2026-01-13)

  • Added cleanup utility for database references
  • Constant replacement functionality
  • Improved error handling
  • Enhanced documentation

v0.1.0

  • Initial release
  • SVG generation with color coding
  • Master index generator
  • Command-line interface

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

dataform_dependency_visualizer-0.2.3.tar.gz (18.9 kB view details)

Uploaded Source

Built Distribution

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

dataform_dependency_visualizer-0.2.3-py3-none-any.whl (22.2 kB view details)

Uploaded Python 3

File details

Details for the file dataform_dependency_visualizer-0.2.3.tar.gz.

File metadata

File hashes

Hashes for dataform_dependency_visualizer-0.2.3.tar.gz
Algorithm Hash digest
SHA256 845ccff1148ee9dd23ff259740edc72da941abe7f9c854bac3c043569aabd7d2
MD5 e871cbf302ad68344ec03439c9fa1aca
BLAKE2b-256 fef0f3c79bcdc66a92d24951d57e6b77ee4fe1e373b96111dc6af297e38d1c6a

See more details on using hashes here.

File details

Details for the file dataform_dependency_visualizer-0.2.3-py3-none-any.whl.

File metadata

File hashes

Hashes for dataform_dependency_visualizer-0.2.3-py3-none-any.whl
Algorithm Hash digest
SHA256 35cd5c50fe5285dd6de5756e09abaf45dd56addc968ada54b6811f715e858bdd
MD5 a9571e2e87eadbab734aa38c6f72dd1a
BLAKE2b-256 465b42c1a79fa4762914bf4187fcb2e3c82fb56cd92297b06e9cae91e67bcc54

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