collate-sqllineage
Collate SQL Lineage for Analysis Tool powered by Python and sqlfluff based on sqllineage.
What it is and what it does
collate-sqllineage is a SQL lineage analysis tool that parses SQL statements and identifies which tables are read from (sources), written to (targets), and any intermediate tables created during multi-statement execution. It abstracts away the complexity of SQL parsing by using pluggable backends—sqlfluff or sqlparse—to build an abstract syntax tree, then stores the lineage relationships in a graph using networkx. You can use it as a command-line tool to analyze SQL files or query strings, or import it as a Python library to programmatically extract lineage data.
The package supports multiple SQL dialects, column-level lineage tracking (showing which source columns flow into which target columns), and can visualize the resulting data flow as a directed acyclic graph in a browser. It identifies intermediate tables when analyzing multiple statements in sequence, making it useful for understanding complex data pipelines. This is a fork of the original sqllineage project, maintained by the OpenMetadata community with added sqlfluff support.
Use it for:
- Extract source and target tables from INSERT, SELECT, and CREATE statements to understand data dependencies in a pipeline.
- Analyze multi-statement SQL scripts to identify intermediate tables and trace end-to-end data flow from raw sources to final outputs.
- Track column-level lineage to see which source columns contribute to each target column in complex transformations.
- Visualize SQL data lineage as a directed graph to document data flow for data governance or impact analysis.
- Validate SQL syntax across different database dialects (PostgreSQL, BigQuery, Snowflake, etc.) and catch keyword conflicts.
- Integrate lineage extraction into data cataloging or metadata management systems to automatically populate table dependencies.
Worth the install?
AI-flagged interpretation of the facts on this page — verify before relying
Analyzes SQL statements to extract source and target tables, intermediate tables, and column-level lineage, using pluggable parsers (sqlfluff or sqlparse) and networkx for graph representation.
Yes. The package is actively maintained, has low install friction, carries no known vulnerabilities, and solves a concrete problem—extracting data lineage from SQL without manual parsing. Use it if you need to understand table dependencies, build data catalogs, or visualize SQL data flow. The permissive MIT license removes licensing concerns.
Install
collate-sqllineage on PyPI
pip
pip install collate-sqllineageuv
uv add collate-sqllineagepoetry
poetry add collate-sqllineageInstalling collate-sqllineage
Before you install
Low install friction with four runtime dependencies (sqlparse, networkx, collate-sqlfluff, sqlglot). Active maintenance with a release 50 days ago. Supports Python 3.9, 3.10, 3.11.
License in practice
MIT license (permissive) means you can use, modify, and distribute this package with minimal restrictions, provided you include the license notice.
Quickstart
pip install collate-sqllineage
from sqllineage.runner import LineageRunner
runner = LineageRunner("insert into db1.table1 select * from db2.table2")
print(runner.source_tables) # {Table: db2.table2}
print(runner.target_tables) # {Table: db1.table1}
Verify before relying
- Whether collate-sqlfluff (a fork-specific dependency) is actively maintained and compatible with current sqlfluff versions
- Performance characteristics when analyzing very large SQL files or complex multi-statement batches
- Whether the graph visualization feature requires additional system dependencies beyond the listed runtime packages
Package facts
| License | not declared (permissive) |
| Python support | supports the current Python release (>=3.9) |
| Install friction | low — pure-Python wheel |
| Runtime dependencies | 4 — sqlparse, networkx, collate-sqlfluff, sqlglot |
| Maintenance | actively maintained — 50 days since the last release |
| First released | |
| Downloads | 1,468,745/month — #3,872 on PyPI (30-day window, as of 2026-08-14) |
| Known vulnerabilities | none known (OSV.dev, checked 2026-08-14) |
Evidence: collate_sqllineage-2.1.4-py3-none-any.whl
Tags
More Database packages
psycopg2-binary is a PostgreSQL database…
copyleft · top 1,000 on PyPI
redisPython client library for connecting to and…
permissive · top 1,000 on PyPI
ydbYDB Python SDK is the official client library…
permissive · top 1,000 on PyPI
snowflake-connector-pythonConnects Python applications to Snowflake data…
permissive · top 1,000 on PyPI
sqlparsesqlparse tokenizes SQL text into a tree of…
permissive · top 1,000 on PyPI
dbt-adaptersProvides base adapter protocols and shared…
permissive · top 1,000 on PyPI
sqllineageSQLLineage parses SQL statements to extract and…
permissive · top 5,000 on PyPI
syntaqliteParse, format, validate, and tokenize SQLite…
permissive · top 15,000 on PyPI
dbt-colibriExtracts column-level lineage from dbt projects…
permissive · top 15,000 on PyPI
openlineage-sqlProvides a Python interface to a Rust-based SQL…
unclear · top 5,000 on PyPI
sqloxidesqloxide parses SQL queries into a typed…
permissive · top 15,000 on PyPI
sql-metadataParses SQL queries using sqlglot and extracts…
permissive · top 5,000 on PyPI
sqlglotSQLGlot parses, transpiles, optimizes, and…
permissive · top 1,000 on PyPI
pglastParses PostgreSQL SQL statements into an…
copyleft · top 5,000 on PyPI
collate-sqlfluffSQLFluff is a SQL linter and auto-fixer that…
permissive · top 15,000 on PyPI