syntaqlite
SQLite SQL tools — parser, formatter, validator, and MCP server
What it is and what it does
Syntaqlite is a Python library that parses, formats, validates, and tokenizes SQLite SQL using SQLite's own grammar and tokenizer—not an approximation, but the actual SQLite parser. It provides a typed AST with IDE autocomplete, a formatter that normalizes SQL structure, a tokenizer that breaks queries into categorized tokens, and schema-aware analysis that catches unknown tables, columns, and function mismatches without touching a database. It also computes column lineage to trace where output columns originate from source tables.
The library is built around a reusable `Syntaqlite` instance and exposes both typed Python objects (for safety and IDE support) and raw dict output (for performance). It includes a CLI tool for formatting, parsing, and validating SQL files, with support for pinning to specific SQLite versions and enabling compile-time flags. Zero runtime dependencies and wheels for Linux, macOS, Windows, and WebAssembly.
Use it for:
- Format and normalize SQL queries in applications or CI pipelines to enforce consistent style without a database.
- Validate user-submitted SQL against a schema to catch typos and unknown columns before execution.
- Build linters or IDE plugins that need accurate SQLite syntax understanding and error reporting.
- Extract column lineage from SELECT queries to understand data provenance in ETL or analytics systems.
- Tokenize and analyze SQL for query optimization, cost estimation, or security scanning.
- Embed SQL parsing in tools that generate or transform SQLite queries programmatically.
Worth the install?
AI-flagged interpretation of the facts on this page — verify before relying
Parse, format, validate, and tokenize SQLite SQL using SQLite's own grammar and tokenizer, with full AST support and schema-aware analysis including column lineage.
Yes. Syntaqlite is actively maintained, has no runtime dependencies, offers permissive licensing, and solves a real problem—accurate SQLite SQL parsing without approximations. The medium install friction (compiled wheels) is standard for performance-critical libraries. Install if you need to parse, validate, or analyze SQLite SQL in Python; skip if you only execute queries against a live database.
Install
syntaqlite on PyPI
pip
pip install syntaqliteuv
uv add syntaqlitepoetry
poetry add syntaqliteInstalling syntaqlite
Before you install
Medium install friction due to compiled wheels for multiple platforms (Linux x86_64/aarch64, macOS x86_64/arm64, Windows x86_64, WebAssembly). Active maintenance with recent releases; last commit 2026-07-08.
License in practice
Apache-2.0 permissive license allows commercial and private use with attribution; SQLite components are public domain under the SQLite blessing.
Quickstart
import syntaqlite
with syntaqlite.Syntaqlite() as sq:
formatted = sq.format_sql("select 1")
stmts = sq.parse("SELECT 1 + 2 FROM foo")
tokens = list(sq.tokenize("SELECT 1"))
Requires Python 3.10 or later.
Verify before relying
- Whether the AST node types and enums remain stable across minor version updates.
- Performance characteristics of parse_raw() vs typed parsing for large SQL batches.
- Whether schema analysis supports all SQLite pragmas and compile-time flags.
Package facts
| License | Apache-2.0 (permissive) |
| Python support | supports the current Python release (>=3.10) |
| Install friction | medium — platform-specific wheel |
| Runtime dependencies | none |
| Maintenance | actively maintained — 37 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 367,937/month — #7,193 on PyPI (30-day window, as of 2026-08-14) |
| Known vulnerabilities | none known (OSV.dev, checked 2026-08-14) |
Evidence: syntaqlite-0.7.1-py3-none-macosx_10_13_universal2.whl; syntaqlite-0.7.1-py3-none-macosx_11_0_universal2.whl; syntaqlite-0.7.1-py3-none-manylinux_2_28_aarch64.whl; syntaqlite-0.7.1-py3-none-manylinux_2_28_x86_64.whl; syntaqlite-0.7.1-py3-none-pyemscripten_2026_0_wasm32.whl; syntaqlite-0.7.1-py3-none-win_amd64.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
promql-parserParses Prometheus query language (PromQL)…
unclear · top 15,000 on PyPI
sqllineageSQLLineage parses SQL statements to extract and…
permissive · top 5,000 on PyPI
collate-sqllineageAnalyzes SQL statements to extract source and…
permissive · top 5,000 on PyPI
tree-sitter-sqlProvides a tree-sitter SQL grammar for parsing…
permissive · top 5,000 on PyPI
sqlvalidatorFormats, validates, and checks SQL SELECT…
permissive · top 15,000 on PyPI
sqlite-utilsCLI tool and Python library for creating,…
permissive · top 5,000 on PyPI
parsoParso is a Python parser that recovers from…
permissive · top 1,000 on PyPI
cql2Parses, validates, and converts Common Query…
permissive · top 15,000 on PyPI
sqlite-fts4Registers custom SQLite functions for ranking…
permissive · top 5,000 on PyPI