sqloxide
Python bindings for sqlparser-rs
Decision gist · record as of 2026-08-14
Yes. sqloxide is actively maintained, has no runtime dependencies, offers significant speed advantages over pure-Python alternatives, and covers modern Python versions including free-threaded support. The MIT license is permissive. Install it if you need fast, accurate SQL parsing for lineage, rewriting, or analysis; skip it only if you need extensive documentation or are locked to older Python versions.AI-flagged interpretation of the facts on this page — verify before relying
Before you install
- Requires Python 3.9 or later; precompiled wheels available for Python 3.9–3.14 on Linux, macOS, and Windows.
- Medium install friction due to compiled wheels, but well-supported across Python 3.9–3.14 on Linux, macOS, and Windows.
- Active maintenance with recent releases; last commit 2026-04-09.
License · maintenance · safety
MIT (permissive) — MIT license permits unrestricted use, modification, and distribution in proprietary and open-source projects with minimal restrictions.
last release 2026-04-06 (130 days) · last repo commit 2026-04-09 · 211 stars
0 known vulnerabilities (OSV.dev, 2026-08-14) · 594,012 downloads/mo, #5,847 on PyPI
Alternatives
Verify before relying
pip install sqloxide
from sqloxide import parse_sql
sql = "SELECT col1, col2 FROM table1 WHERE col1 = 1"
ast = parse_sql(sql=sql, dialect='ansi')
print(ast)- Whether the AST schema and mutation APIs are stable across minor versions or subject to breaking changes.
- Performance characteristics on very large or deeply nested queries beyond the benchmarks shown.
What it is and what it does
sqloxide is a Python wrapper around the Rust sqlparser-rs library, providing fast SQL parsing without the GIL. It parses SQL into a typed AST matching the sqlparser-rs schema, and exposes APIs to reconstruct SQL from the AST or apply visitor-pattern mutations to expressions and table relations. The package was built to handle data lineage extraction across large codebases, particularly for complex queries with deep nesting, subselects, and table aliases—problems where pure-Python parsers are either slow or inaccurate.
The package includes free-threaded Python support (3.13t, 3.14t), allowing parallel SQL parsing from multiple threads without locks. Benchmarks show it parses queries roughly 12× faster than sqlglot, 50× faster than sqlparse, and 100× faster than moz-sql-parser. It has no runtime dependencies and ships precompiled wheels for common platforms and Python versions.
Use it for
- Extract table and column dependencies from hundreds of auto-generated SQL files to build data lineage graphs.
- Rewrite SQL queries programmatically by mutating the AST (e.g., renaming tables, uppercasing identifiers).
- Parse and validate SQL syntax in data pipeline tools or ETL frameworks where speed matters.
- Analyze complex nested queries and subselects where Python-native parsers fail or are too slow.
- Parallelize SQL parsing across multiple threads in free-threaded Python without GIL contention.
Worth the install?
AI-flagged interpretation of the facts on this page. Verify before relying on it.
Yes.
sqloxide is actively maintained, has no runtime dependencies, offers significant speed advantages over pure-Python alternatives, and covers modern Python versions including free-threaded support. The MIT license is permissive. Install it if you need fast, accurate SQL parsing for lineage, rewriting, or analysis; skip it only if you need extensive documentation or are locked to older Python versions.
Install
sqloxide on PyPI
Before you install
Medium install friction due to compiled wheels, but well-supported across Python 3.9–3.14 on Linux, macOS, and Windows. Active maintenance with recent releases; last commit 2026-04-09.
Requires Python 3.9 or later; precompiled wheels available for Python 3.9–3.14 on Linux, macOS, and Windows.
License in practice
MIT license permits unrestricted use, modification, and distribution in proprietary and open-source projects with minimal restrictions.
Quickstart
pip install sqloxide
from sqloxide import parse_sql
sql = "SELECT col1, col2 FROM table1 WHERE col1 = 1"
ast = parse_sql(sql=sql, dialect='ansi')
print(ast)
Verify before relying
- Whether the AST schema and mutation APIs are stable across minor versions or subject to breaking changes.
- Performance characteristics on very large or deeply nested queries beyond the benchmarks shown.
Package facts
| License | MIT permissive |
| Python support | Supports the current Python release >=3.9 |
| Install friction | Medium. Platform-specific wheel |
| Runtime dependencies | None |
| Maintenance | Actively maintained 130 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 594,012 / month, #5,847 on PyPI 30-day window, as of 2026-08-14 |
| Known vulnerabilities | None known OSV.dev, checked 2026-08-14 |
| Classifiers | Development Status :: 3 - AlphaLicense :: OSI Approved :: MIT LicenseProgramming Language :: RustTopic :: Database |
Evidence: sqloxide-0.61.1-cp310-cp310-macosx_10_12_x86_64.whl; sqloxide-0.61.1-cp310-cp310-macosx_11_0_arm64.whl; sqloxide-0.61.1-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.whl; sqloxide-0.61.1-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl; sqloxide-0.61.1-cp310-cp310-manylinux_2_5_i686.manylinux1_i686.whl; sqloxide-0.61.1-cp310-cp310-win_amd64.whl; sqloxide-0.61.1-cp311-cp311-macosx_10_12_x86_64.whl; sqloxide-0.61.1-cp311-cp311-macosx_11_0_arm64.whl; sqloxide-0.61.1-cp311-cp311-manylinux_2_17_aarch64.manylinux2014_aarch64.whl; sqloxide-0.61.1-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl; sqloxide-0.61.1-cp311-cp311-manylinux_2_5_i686.manylinux1_i686.whl; sqloxide-0.61.1-cp311-cp311-win_amd64.whl; sqloxide-0.61.1-cp312-cp312-macosx_10_12_x86_64.whl; sqloxide-0.61.1-cp312-cp312-macosx_11_0_arm64.whl; sqloxide-0.61.1-cp312-cp312-manylinux_2_17_aarch64.manylinux2014_aarch64.whl; sqloxide-0.61.1-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl; sqloxide-0.61.1-cp312-cp312-manylinux_2_5_i686.manylinux1_i686.whl; sqloxide-0.61.1-cp312-cp312-win_amd64.whl; sqloxide-0.61.1-cp313-cp313-macosx_10_12_x86_64.whl; sqloxide-0.61.1-cp313-cp313-macosx_11_0_arm64.whl
Tags
Let your AI agent find packages like this
Example. Real query, live index.
You found this page by searching. An agent finds it by wishing: SkillFed indexes 14,416 PyPI packages by what they can do, searchable in plain language.
wish › “sql ast parsing”
- sqloxidesqloxide parses SQL queries into a typed abstract syntax tree (AST)…
- fugue-sql-antlrParses Fugue SQL dialect into an abstract syntax tree using ANTLR4,…
- tree-sitter-sqlProvides a tree-sitter SQL grammar for parsing SQL code into an…
Give your agent the search over MCP, or paste the wish link into any chat.
More Database packages
psycopg2-binary is a PostgreSQL database adapter for Python that implements the DB API 2.0 specification, enabling Python applications to connect to and query PostgreSQL databases with thread-safe concurrent operations.
Python client library for connecting to and executing commands against Redis key-value stores, supporting both synchronous and asynchronous operations.
Install it if your application needs to interact with Redis; the only prerequisite is a running Redis server instance.
YDB Python SDK is the official client library for connecting to and querying YDB databases from Python applications.
Install it if you need to connect Python applications to YDB databases.
Connects Python applications to Snowflake data warehouses using the DB API 2.0 specification, enabling SQL queries, data transfers, and warehouse operations.
sqlparse tokenizes SQL text into a tree of statements, clauses, and expressions, and provides functions to split scripts, format queries, and inspect parsed tokens without validating dialect or syntax.
Install it if you need to manipulate, format, or analyze SQL text programmatically.
Provides base adapter protocols and shared functionality that database adapters use to integrate with dbt-core, handling connections, dialect translation, relation caching, and core interface management.
See also sqlglot · fugue-sql-antlr · collate-sqllineage · sqlglotrs · gritql · mo-sql-parsing · pglast · moz-sql-parser · ast-serialize