sqlglot
An easily customizable SQL parser and transpiler
Install
sqlglot on PyPI
pip
pip install sqlglotuv
uv add sqlglotpoetry
poetry add sqlglotPackage facts
| License | MIT (permissive) |
| Python support | supports the current Python release (>=3.9) |
| Install friction | low — pure-Python wheel |
| Runtime dependencies | none |
| Maintenance | actively maintained — 1 days since the last release |
| Last repo commit | |
| First released | |
| Popularity | one of the top 1,000 most-downloaded packages on PyPI (30-day window, as of 2026-08-13) |
| Known vulnerabilities | none known (OSV.dev, checked 2026-08-13) |
Evidence: sqlglot-30.17.0-py3-none-any.whl
About sqlglot
from the package's own PyPI description — quoted content, verbatim
SQLGlot is a no-dependency SQL parser, transpiler, optimizer, and engine. It can be used to format SQL or translate between over 30 dialects like DuckDB, Presto / Trino, Spark / Databricks, Snowflake, and BigQuery. It aims to read a wide variety of SQL inputs and output syntactically and semantically correct SQL in the targeted dialects.
It is a very comprehensive generic SQL parser with a robust test suite. It is also quite performant, while being written purely in Python.
You can easily customize the parser, analyze queries, traverse expression trees, and programmatically build SQL.
SQLGlot can detect a variety of syntax errors, such as unbalanced parentheses, incorrect usage of reserved keywords, and so on. These errors are...
Read as markdown · JSON record · Source repository · Homepage · Docs
AI interpretation — verify before relying
AI-generated interpretation of the package facts above; every digit, version, license, or vulnerability id it cites is grounded in the facts already shown on this page
SQLGlot is a no-dependency SQL parser, transpiler, and optimizer that translates SQL between over 30 dialects including DuckDB, Presto, Spark, Snowflake, and BigQuery while supporting query analysis, AST traversal, and programmatic SQL construction.
Installation is frictionless: pure Python wheel with zero runtime dependencies. Active maintenance with a release just 1 day ago and 9526 GitHub stars indicate solid community adoption and ongoing support.
MIT license permits unrestricted use, modification, and distribution in both open-source and commercial projects with minimal obligations.
Usage
pip install sqlglot
import sqlglot
sqlglot.transpile("SELECT EPOCH_MS(1618088028295)", read="duckdb", write="hive")[0]
Requires Python 3.9 or later. Optional: install sqlglot[c] for 3-5x performance via mypyc-compiled extensions.
Verdict: SQLGlot is a production-ready, actively maintained SQL transpiler with zero dependencies, permissive licensing, and no known vulnerabilities. Its broad dialect support and comprehensive feature set make it suitable for SQL tooling, data pipeline work, and query analysis across heterogeneous systems.
Needs verification
- Whether the optional mypyc-compiled version (sqlglot[c]) introduces any build-time or runtime dependencies not listed in the base package metadata.
- Performance characteristics and memory footprint for large or deeply nested SQL queries in production workloads.
Similar packages
permissive · top 1,000 on PyPI
pysparkpermissive · top 1,000 on PyPI
duckdbpermissive · top 1,000 on PyPI
databricks-sqlalchemypermissive · top 1,000 on PyPI
jmespathpermissive · top 100 on PyPI
dbt-adapterspermissive · top 1,000 on PyPI
snowflake-sqlalchemypermissive · top 1,000 on PyPI
jsonpath-ngpermissive · top 1,000 on PyPI
mashumaropermissive · top 1,000 on PyPI
elastic-transportpermissive · top 1,000 on PyPI