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)
  • JOIN Details - Shows JOIN types and ON conditions for each dependency
  • �🔍 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, with JOIN details shown below each
  • Right (Green): Dependents - tables that read FROM this
  • Schema Labels: Database schema for each table
  • Type Badges: table, view, incremental, operation
  • JOIN Information: Type (LEFT/INNER/RIGHT JOIN) and ON conditions displayed in red below dependency nodes

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.3 (2026-01-21)

  • NEW: JOIN information extraction from SQL queries
  • Display JOIN types (LEFT, INNER, RIGHT, etc.) and ON conditions in SVG diagrams
  • JOIN count summary shown on center table
  • Detailed JOIN info displayed below each dependency node

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.5.tar.gz (22.5 kB view details)

Uploaded Source

Built Distribution

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

File details

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

File metadata

File hashes

Hashes for dataform_dependency_visualizer-0.2.5.tar.gz
Algorithm Hash digest
SHA256 cf3e43b6050a064c2190b3561ab512ae56f8ef764264c0d53c467bb632e71d6f
MD5 5907f5412536d770c5fb05b68a8de6dc
BLAKE2b-256 f0d8d2d3a36bcf9ea28c56739105797d8e09fd5dcb75d9be34711ad38d1b34f0

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for dataform_dependency_visualizer-0.2.5-py3-none-any.whl
Algorithm Hash digest
SHA256 acc8c9614c6cc8fed66eec0ba345393292126797c6c8aec2959d28ea530c5057
MD5 fd86f8654da0feab503cbbf0161d02c6
BLAKE2b-256 ffabc922831e7439ccbda35358e67330eeec60f39a5740c74e593ec4b7583b3c

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