Metadata-Version: 2.1
Name: dataform-dependency-visualizer
Version: 0.2.1
Summary: Visualize Dataform table dependencies as interactive SVG diagrams
Home-page: https://github.com/OshigeAkito/dataform-dependency-visualizer
License: MIT
Keywords: dataform,dependencies,visualization,bigquery,sql
Author: Thamo
Author-email: thamo@example.com
Requires-Python: >=3.10,<4.0
Classifier: Development Status :: 4 - Beta
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: MIT License
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Topic :: Database
Classifier: Topic :: Software Development :: Libraries :: Python Modules
Project-URL: Repository, https://github.com/OshigeAkito/dataform-dependency-visualizer
Description-Content-Type: text/markdown

# Dataform Dependency Visualizer

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

## Features

- 📊 **Individual table diagrams** - One SVG per table showing immediate dependencies
- 🎨 **Color-coded by type** - Tables, views, and operations visually distinct
- 🔍 **Master index viewer** - Browse all tables in single interface
- 📁 **Schema organization** - Organized by schema with collapsible sections
- ⚡ **Pure Python SVGs** - No Graphviz required
- 🎯 **Orthogonal routing** - Clean, professional arrow paths
- 📝 **Smart text wrapping** - Long table names split across lines

## Installation

```bash
pip install dataform-dependency-visualizer
```

## Quick Start

### 1. Generate dependency report

In your Dataform project directory:

```bash
dataform compile --json > dependencies_report.txt
```

### 2. Generate SVG diagrams

```bash
# Generate for specific schema
dataform-deps generate dashboard_wwim

# Generate for all schemas (excluding refined_*)
dataform-deps generate-all

# Generate master index
dataform-deps index
```

### 3. View diagrams

Open `output/dependencies_master_index.html` in your browser to browse all tables and their dependencies.

## Usage

### Command Line

**Generate diagrams for a specific schema:**

```bash
dataform-deps generate SCHEMA_NAME
```

Example:
```bash
dataform-deps generate dashboard_wwim
```

**Generate for all schemas:**

```bash
dataform-deps generate-all
```

By default, schemas starting with `refined_` are excluded. To include them:

```bash
dataform-deps generate-all --include-refined
```

**Generate master index:**

```bash
dataform-deps index
```

Creates `output/dependencies_master_index.html` with links to all tables.

**Check prerequisites:**

```bash
dataform-deps check
```

Verifies that:
- You're in a Dataform project directory
- `dependencies_report.txt` exists
- The report contains valid dependency data

## Example Output

### Individual Table Diagram

Each table gets its own SVG showing:
- **Dependencies (upstream)** - Tables this table depends on
- **Dependents (downstream)** - Tables that depend on this table
- **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

- [GitHub Repository](https://github.com/OshigeAkito/dataform-dependency-visualizer)
- [Issue Tracker](https://github.com/OshigeAkito/dataform-dependency-visualizer/issues)

