--- id: sqllineage version: "1.5.8" license: MIT license_treatment: permissive maintenance: active --- # sqllineage — SQL Lineage Analysis Tool powered by Python License: permissive · Maintenance: active · Downloads: 1.7M/mo ## What it is and what it does SQLLineage is a Python tool that analyzes SQL statements to extract data lineage—the flow of data from source tables through transformations to target tables. It abstracts away the complexity of SQL parsing by using pluggable parsers (sqlfluff and sqlparse) and stores lineage information in a graph structure using networkx. The tool works at both table and column levels, identifying which tables are read and written, and tracking individual column transformations across joins, aggregations, and CTEs. You can use it as a command-line tool to analyze SQL files or inline queries, or import it as a library in Python code. It supports dialect-aware parsing, can optionally integrate with live database metadata via sqlalchemy to resolve wildcards and ambiguous column references, and includes graph visualization of lineage as a DAG. It handles multiple SQL statements in sequence, identifying intermediate tables that serve as both targets and sources. Use it for: - Audit data pipelines by tracing which source tables feed into a target table through multiple transformation steps. - Generate data governance documentation showing column-level lineage for compliance and impact analysis. - Detect unused intermediate tables or orphaned source tables in a multi-statement ETL script. - Visualize DAG of table dependencies to understand data flow in complex SQL workflows. - Resolve column ambiguities in JOIN-heavy queries by connecting to live database metadata. ## Worth the install? AI-flagged interpretation of the facts above — verify before relying. SQLLineage parses SQL statements to extract and visualize data lineage—identifying source tables, target tables, and intermediate tables involved in data transformations. Yes. SQLLineage is actively maintained, has no known vulnerabilities, installs with low friction, and solves a real problem in data governance and pipeline auditing. The MIT license imposes no restrictions. It is suitable for production use in both open-source and commercial contexts. ## Install pip install sqllineage uv add sqllineage poetry add sqllineage ## Installing sqllineage Before you install: Low friction installation with a pure-Python wheel. The package is actively maintained with a recent release and depends on well-established libraries (sqlparse, sqlfluff, networkx, rustworkx, sqlalchemy). Supports modern Python versions and has been in production use since 2019. License in practice: MIT license permits unrestricted use, modification, and distribution in both open-source and commercial projects, with only attribution required. Quickstart: pip install sqllineage from sqllineage.runner import LineageRunner runner = LineageRunner("INSERT INTO db1.table1 SELECT * FROM db2.table2") print(runner.source_tables) print(runner.target_tables) Requires Python 3.10 or later. Verify before relying: - Performance characteristics with very large SQL files or complex multi-statement queries. - Completeness of dialect support beyond the documented examples. - Whether metadata-awareness via sqlalchemy connection strings is production-tested across all supported databases. ## Package facts - License: MIT (permissive) - Python support: supports_current - Install friction: low - Maintenance: active - Downloads: 1.7M/month (top 5,000 on PyPI) - Known vulnerabilities: none known ## Tags sql lineage analysis, data lineage extraction, sql dependency tracking, table-level lineage, column-level lineage, sql parser lineage, data flow visualization, data-lineage, sql-analysis, data-governance [View on SkillFed](https://skillfed.io/packages/sqllineage) · [View on PyPI](https://pypi.org/project/sqllineage/)