shandy-sqlfmt
sqlfmt formats your dbt SQL files so you don't have to.
Decision gist · record as of 2026-08-14
Yes. The package is actively maintained, has no known vulnerabilities, low install friction, and fills a clear need for SQL formatting in dbt and analytics workflows. The Apache-2.0 license poses no restrictions. Start with a version-controlled repository and use --check or --diff on first run to verify output before committing changes.AI-flagged interpretation of the facts on this page — verify before relying
Before you install
- Requires Python 3.10 or above.
- The PyPI package name is shandy-sqlfmt, not sqlfmt.
- Low install friction with a pure Python wheel and five lightweight runtime dependencies.
License · maintenance · safety
Apache-2.0 (permissive) — Licensed under Apache-2.0 (permissive), allowing use in commercial and private projects with minimal restrictions.
last release 2026-08-10 (4 days) · last repo commit 2026-08-13 · 542 stars
0 known vulnerabilities (OSV.dev, 2026-08-14) · 1,415,027 downloads/mo, #3,932 on PyPI
Alternatives
Verify before relying
pip install "shandy-sqlfmt[jinjafmt]"
# Format SQL files in current directory
sqlfmt .
# Check formatting without modifying files
sqlfmt --check .
# Format from stdin
echo "select 1" | sqlfmt -- Whether formatted output is always syntactically valid or if edge cases can break SQL
- Performance characteristics when formatting very large files or projects
- Completeness of support for SQL dialects beyond the documented ClickHouse special case
What it is and what it does
This package is a fast, opinionated SQL formatter built for dbt projects and other SQL codebases. It works by lexing SQL into tokens and reformatting to a single enforced style, without requiring a full SQL parser. This approach makes it much faster than traditional linters and easier to maintain. The tool formats select, delete, grant, revoke, and create function statements, preserves comments and some whitespace, and works with Jinja templates embedded in SQL.
It integrates with dbt, pre-commit, VSCode, and CI systems. Configuration is minimal—line length and dialect choice (polyglot by default, with special handling for ClickHouse). The package depends on click, jinja2, platformdirs, tomli, and tqdm for CLI, templating, configuration, and progress display.
Use it for
- Enforce consistent SQL style across a dbt project without manual code review discussions
- Format SQL files automatically in pre-commit hooks or CI/CD pipelines before deployment
- Quickly reformat legacy or inconsistently-styled SQL codebases to a standard format
- Format Jinja-templated SQL files while preserving template logic
- Check SQL formatting compliance in CI without modifying files using --check mode
Worth the install?
AI-flagged interpretation of the facts on this page. Verify before relying on it.
Yes.
The package is actively maintained, has no known vulnerabilities, low install friction, and fills a clear need for SQL formatting in dbt and analytics workflows. The Apache-2.0 license poses no restrictions. Start with a version-controlled repository and use --check or --diff on first run to verify output before committing changes.
Install
shandy-sqlfmt on PyPI
Before you install
Low install friction with a pure Python wheel and five lightweight runtime dependencies. Actively maintained with a release 4 days ago and steady repository activity.
Requires Python 3.10 or above. The PyPI package name is shandy-sqlfmt, not sqlfmt.
License in practice
Licensed under Apache-2.0 (permissive), allowing use in commercial and private projects with minimal restrictions.
Quickstart
pip install "shandy-sqlfmt[jinjafmt]"
# Format SQL files in current directory
sqlfmt .
# Check formatting without modifying files
sqlfmt --check .
# Format from stdin
echo "select 1" | sqlfmt -
Verify before relying
- Whether formatted output is always syntactically valid or if edge cases can break SQL
- Performance characteristics when formatting very large files or projects
- Completeness of support for SQL dialects beyond the documented ClickHouse special case
Package facts
| License | Apache-2.0 permissive |
| Python support | Supports the current Python release >=3.10 |
| Install friction | Low. Pure-Python wheel |
| Runtime dependencies | 5 packagesclickjinja2platformdirstomlitqdm |
| Maintenance | Actively maintained 4 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 1,415,027 / month, #3,932 on PyPI 30-day window, as of 2026-08-14 |
| Known vulnerabilities | None known OSV.dev, checked 2026-08-14 |
| Classifiers | Operating System :: MacOS :: MacOS XOperating System :: Microsoft :: WindowsOperating System :: POSIX :: LinuxProgramming Language :: SQLTopic :: Software Development :: Quality AssuranceTyping :: Typed |
Evidence: shandy_sqlfmt-0.32.0-py3-none-any.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 › “dbt sql formatting”
- shandy-sqlfmtA command-line SQL formatter that automatically reformats SQL files…
- sqlfluff-templater-dbtEnables SQLFluff to lint and auto-fix dbt project SQL using dbt…
- sqlfluffSQLFluff is a SQL linter and auto-fixer that checks SQL code for…
Give your agent the search over MCP, or paste the wish link into any chat.
More Quality Assurance packages
Coverage.py measures which lines of Python code are executed during test runs, reporting coverage percentages and identifying untested code paths.
Install it if you want to measure test completeness or enforce coverage thresholds in your project.
Ruff is a Python linter and code formatter written in Rust that combines linting, formatting, and code fixing into a single tool, replacing Flake8, Black, isort, and related utilities.
Pexpect spawns and controls interactive console applications by sending input and matching output patterns, automating tasks that would otherwise require manual interaction.
Black reformats Python source code to a consistent style by parsing entire files and rewriting them according to an opinionated, deterministic set of rules, eliminating manual formatting decisions.
pytest-xdist distributes pytest tests across multiple CPU cores or machines to speed up test execution, with the simplest usage being `pytest -n auto` to spawn workers equal to available CPUs.
Install it if your test suite takes long enough that parallelization would save meaningful time.
Validates AWS CloudFormation templates in YAML or JSON format against resource provider schemas and best practices, checking property values and configuration correctness.
Install it if you work with CloudFormation templates.
See also collate-sqlfluff · sqlfluff · sqlfluff-templater-dbt · sqlglot · sqlglotrs · collate-sqllineage · sqlfluffrs · acryl-sqlglot · sqlmesh · dbt-core