skillfed

syntaqlite

SQLite SQL tools — parser, formatter, validator, and MCP server

syntaqlite v0.7.1 367.9K downloads/30d#7,193 on PyPI797
Permissive license Apache-2.0 Active released

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 syntaqlite

uv

uv add syntaqlite

poetry

poetry add syntaqlite

Installing 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

sqlite sql parsersql formattersql validationsql astsqlite query analysissql tokenizerschema validation
sql-parsingsqliteschema-validation

More Database packages