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.

PyPI Python License

Features

  • 📊 Interactive SVG Diagrams - One diagram per table showing all dependencies
  • 🎨 Color-Coded by Type - Tables, views, and operations visually distinct
  • 🔍 Master Index - Browse all tables in a single HTML interface
  • 📁 Schema Organization - Automatically organized by database schema
  • Pure Python - No Graphviz required, pure SVG generation
  • 🎯 Smart Layout - Clean orthogonal routing for professional diagrams
  • 📝 Text Wrapping - Long table names automatically wrapped
  • 🧹 Cleanup Utilities - Built-in tools to fix common Dataform issues

Installation

pip install dataform-dependency-visualizer

Prerequisites

You need Dataform CLI installed:

# Install globally
npm install -g @dataform/cli

# Or in your project
npm install @dataform/core

Quick Start

  1. Generate dependency report from your Dataform project:
cd your-dataform-project
dataform compile --json > dependencies_report.txt
  1. Convert to text format for visualization:
poetry run python -m dataform_viz.dataform_check > dependencies_text_report.txt
  1. Generate diagrams:
# For all schemas
dataform-deps --report dependencies_text_report.txt generate-all

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

# Generate browsable index
dataform-deps --report dependencies_text_report.txt index
  1. View results: Open output/dependencies_master_index.html in your browser

Command Reference

# Generate for specific schema
dataform-deps --report FILE generate SCHEMA_NAME

# Generate all schemas
dataform-deps --report FILE generate-all

# Generate master index
dataform-deps --report FILE index

# Open index in browser
dataform-deps --report FILE index --open

# Custom output directory
dataform-deps --report FILE --output my_output generate-all

# Cleanup Dataform issues
python -m dataform_viz.dataform_check --cleanup

Python API

from dataform_viz import DependencyVisualizer

# Initialize with report
viz = DependencyVisualizer('dependencies_text_report.txt')
viz.load_report()

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

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

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

Output Structure

output/
├── dependencies_master_index.html  # Interactive browser interface
├── analytics/
│   └── analytics_customer_summary.svg
├── dashboard_wwim/
│   ├── dashboard_wwim_table1.svg
│   └── ...
└── datamart_wwim/
    └── ...

Understanding the Diagrams

Each SVG shows:

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

Cleanup Utilities

Fix common Dataform compilation issues:

python -m dataform_viz.dataform_check --cleanup

This removes:

  • database: lines from config blocks
  • database: from ref() calls
  • Replaces constant references with actual values
  • Cleans up dependencies.js files

Common Issues

"wwim_utils is not defined"

Run the cleanup utility:

python -m dataform_viz.dataform_check --cleanup

Empty SVG output

Use text format report, not JSON:

python -m dataform_viz.dataform_check > dependencies_text_report.txt

Requirements

  • Python 3.10+
  • Dataform CLI
  • Node.js (to run Dataform)

Links

License

MIT License - See LICENSE file for details.

Changelog

v0.2.0 (2026-01-13)

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

v0.1.0

  • Initial release
  • Basic SVG generation
  • Master index generator
  • Command-line interface
  • Color coding - Tables (blue), views (green), operations (orange)

Master Index

The master index organizes all tables by schema with:

  • Clickable table names that open their SVG
  • Expandable/collapsible schemas
  • Type badges (table/view/incremental)
  • Search functionality

Requirements

  • Python 3.8+
  • Dataform project with compiled dependencies

How It Works

  1. Parse dependencies_report.txt generated by Dataform
  2. Extract table dependencies and metadata
  3. Generate SVG diagrams with orthogonal routing
  4. Create master index HTML for easy navigation

Project Structure

output/
├── dependencies_master_index.html    # Main entry point
└── dependencies/
    ├── schema1_table1.svg
    ├── schema1_table2.svg
    └── ...

License

MIT License - see LICENSE file for details.

Contributing

Contributions welcome! Please open an issue or PR on GitHub.

Links

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

Uploaded Python 3

File details

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

File metadata

File hashes

Hashes for dataform_dependency_visualizer-0.2.2.tar.gz
Algorithm Hash digest
SHA256 666b7d1ecd454d92621c509193b800cfca8a514730d6aa5f26cee56ac9c63eaf
MD5 2b751bb656ec74c6de9712c8c2f66f52
BLAKE2b-256 e35cf7d68a29c085f96a4360219dc362bfc7b65682b8a3230256ff677874e6b2

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for dataform_dependency_visualizer-0.2.2-py3-none-any.whl
Algorithm Hash digest
SHA256 c3ba3822a3a6de0bc6ee910e89bde8fde94e61d2eca2934131dd304cef447231
MD5 86f7d476b7681b4344b9e443a475e77b
BLAKE2b-256 ac245cba88ff29c7c2e13e0b1bb487e6c75c492d5ed0e2dabff343443a23394d

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