--- id: acryl-sqlglot version: "25.25.2.dev9" license: MIT license_treatment: permissive maintenance: active --- # acryl-sqlglot — An easily customizable SQL parser and transpiler License: permissive · Maintenance: active · Downloads: 95.3K/mo ## What it is and what it does acryl-sqlglot is a pure-Python SQL parser and transpiler that reads SQL in one dialect and outputs it in another. It supports 23 different SQL dialects including DuckDB, Presto, Trino, Spark, Databricks, Snowflake, and BigQuery. The package can format SQL, translate between dialects, optimize queries, analyze metadata (find columns and tables), build SQL programmatically, and traverse abstract syntax trees. It includes a comprehensive test suite and is performant despite being written entirely in Python. The parser is designed to be forgiving rather than strict—it aims to read a wide variety of SQL inputs and output syntactically and semantically correct SQL in the target dialect, but does not aim to be a SQL validator and may not detect certain syntax errors. You can customize the parser, configure how it handles dialect incompatibilities (warn or raise), and inspect or modify parsed query trees. It preserves comments on a best-effort basis and handles identifier delimiters and data type translation across dialects. Use it for: - Translate SQL queries between database systems (e.g., convert Spark SQL to DuckDB or Snowflake syntax). - Format and normalize SQL code across a codebase with consistent dialect rules and identifier handling. - Extract metadata from queries—find all columns, tables, or projections referenced in a SELECT statement. - Build or modify SQL queries programmatically by constructing and manipulating expression trees. - Optimize SQL queries using the built-in optimizer before execution or deployment. ## Worth the install? AI-flagged interpretation of the facts above — verify before relying. Parses, transpiles, and optimizes SQL across 23 different dialects without any runtime dependencies, enabling you to convert queries between systems like DuckDB, Presto, Spark, Snowflake, and BigQuery. Yes. acryl-sqlglot is a mature, actively maintained tool with zero runtime dependencies, permissive licensing, and no known vulnerabilities. It solves a concrete problem—cross-dialect SQL translation—that is difficult to do correctly by hand. Install it if you need to work with SQL across multiple database systems or parse and analyze SQL programmatically. ## Install pip install acryl-sqlglot uv add acryl-sqlglot poetry add acryl-sqlglot ## Installing acryl-sqlglot Before you install: Installation is frictionless—the package has zero runtime dependencies and ships as a pure Python wheel. The project is actively maintained with recent commits and a large repository presence. License in practice: MIT license permits unrestricted use, modification, and distribution in both open-source and commercial projects with minimal obligations. Quickstart: pip install acryl-sqlglot import sqlglot sqlglot.transpile("SELECT EPOCH_MS(1618088028295)", read="duckdb", write="hive")[0] Verify before relying: - Whether the optional Rust tokenizer (via acryl-sqlglot[rs]) provides meaningful performance gains for typical workloads. - Specific SQL validation limitations beyond what the description states about not being a validator. - Performance characteristics and benchmarks for large-scale query parsing and transpilation. ## Package facts - License: MIT (permissive) - Python support: supports_current - Install friction: low - Maintenance: active - Downloads: 95.3K/month (top 15,000 on PyPI) - Known vulnerabilities: none known ## Tags sql parser transpiler, sql dialect converter, sql query translator, cross-dialect sql, sql formatter optimizer, sql ast parser, sql syntax analyzer, sql-transpiler, query-parsing, dialect-conversion [View on SkillFed](https://skillfed.io/packages/acryl-sqlglot) · [View on PyPI](https://pypi.org/project/acryl-sqlglot/)