A sophisticated SQL lineage visualization tool for Medallion Architectures.
Project description
SQL DAG Flow
SQL DAG Flow is a powerful, open-source visualization tool designed to automatically map and visualize the lineage of your SQL data pipelines.
Built specifically for modern data stacks using the Medallion Architecture (Bronze, Silver, Gold), it parses your SQL files to generate an interactive, dependency-aware Directed Acyclic Graph (DAG).
🚀 Key Features
- Automatic Parsing & Visualization: Recursively scans your project folders to find
.sqlfiles and detect dependencies (FROM,JOIN,CTEs) usingsqlglot. - Medallion Architecture Support: Automatically categorizes and colors nodes based on folder structure:
- 🟤 Bronze: Raw ingestion layers.
- ⚪ Silver: Cleaned and conformed data.
- 🟡 Gold: Business-level aggregates.
- Smart Folder Selection:
- Selective Exploration: Choose specific subfolders to analyze using an interactive tree view.
- Deep Filtering: Focus only on relevant parts of your pipeline.
- Advanced Organization:
- Selection Toolbar: Multi-select nodes and align them horizontally/vertically.
- Node Hiding: Hide specific nodes or entire trees to declutter the view.
- Auto Layout: Automatically arrange nodes using Dagre layout engine.
- Configuration Management:
- Save & Load: Persist your layouts, hidden nodes, and viewport settings to JSON.
- Workspaces: manage multiple project configurations.
- Rich Metadata:
- Details Panel: View full SQL content and schema details.
- Annotations: Add sticky notes with Markdown support, resize them, and create visual groups.
- Visual Cues:
- Solid Border: Indicates a Table.
- Dashed Border: Indicates a View (auto-detected).
- Premium UI/UX:
- Dark/Light Modes: Themed for your preference.
- Export: Save as high-resolution PNG or vector SVG.
🌍 Supported Dialects
Powered by sqlglot, supporting:
- BigQuery (Default)
- Snowflake
- PostgreSQL
- Spark / Databricks
- Amazon Redshift
- DuckDB
- MySQL
- ...and more.
📦 Installation
Install easily via pip:
pip install sql-dag-flow
▶️ Usage
1. Command Line Interface (CLI)
You can run the tool directly from your terminal:
# Analyze the current directory
sql-dag-flow
# Analyze a specific SQL project
sql-dag-flow /path/to/my/dbt_project
2. Python API
Integrate it into your Python scripts or notebooks:
from sql_dag_flow import start
# Start the server and open the browser
start(directory="./my_sql_project")
📂 Project Structure Expectations
SQL DAG Flow is opinionated but flexible. It looks for standard Medallion Architecture naming conventions to assign colors:
- Bronze Layer: Any folder named
bronze,raw,landing, orstaging. - Silver Layer: Any folder named
silver,intermediate, orconformed. - Gold Layer: Any folder named
gold,mart,serving, orpresentation. - Other: Any other folder is categorized as "Other" (Gray).
🛠️ Configuration & Customization
Settings
Click the Settings (Gear) icon in the bottom toolbar to:
- Change SQL Dialect: Ensure your specific SQL syntax is parsed correctly.
- Toggle Node Style: Switch between "Full" (colored body) and "Minimal" (colored border) styles.
- Change Palette: Switch between Standard, Vivid, and Pastel color palettes.
Saving Layouts
Your graph layout (positions, hidden nodes) is not permanent by default. To save your work:
- Click Save in the top bar.
- Choose a filename (e.g.,
marketing_flow.json). - Next time, click Load to restore that exact view.
🤝 Contributing
Contributions are welcome!
- Fork the repository.
- Create a feature branch.
- Submit a Pull Request.
Created by Flavio Sandoval
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file sql_dag_flow-0.1.0.tar.gz.
File metadata
- Download URL: sql_dag_flow-0.1.0.tar.gz
- Upload date:
- Size: 223.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
5019f062148c9f41ff1908edfc34f2824b83bfdc8f5581389bbc2be2a33e99e0
|
|
| MD5 |
69a398e0c7120d689309eefcdc9a56db
|
|
| BLAKE2b-256 |
7d99f09e993afefbbf5b9b692a2a5607e610780425c153ac28e7d1d5f14442c6
|
File details
Details for the file sql_dag_flow-0.1.0-py3-none-any.whl.
File metadata
- Download URL: sql_dag_flow-0.1.0-py3-none-any.whl
- Upload date:
- Size: 222.9 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
68a651489205444ea23923a982079746e3010bfda4de0fcd94edc77b120c2626
|
|
| MD5 |
55e6a1721eee427c94b382b04dc0e8c3
|
|
| BLAKE2b-256 |
2bdc4091f7fe0b614f2177b7c8f980c934ebbada523deae83c5e0afb805201ba
|