maxdop
Max Degree of Prettiness for your T-SQL. A T-SQL formatter that runs in CI, understands the whole language, and checks its own work.
maxdop query.sql # formatted SQL to stdout
maxdop --write src/ # format every .sql under src/, in place
maxdop --check src/ # fail the build if anything would change
This package ships the native maxdop executable for your platform. It has no
Python dependencies and is not importable — installing it puts the maxdop
command on your PATH, nothing more. There is no interpreter between you and the
binary, so cold start stays around 3.5 ms.
Why
Most SQL formatters tokenise and guess, and lose the shape of your code when it
matters. maxdop is built on ScriptDom,
Microsoft's own T-SQL parser — twelve grammars, covering every SQL Server
compatibility level from 2000 to 2025, Fabric DW, and grammar 180, which is newer
than any announced product year and is the default. It reads stored procedures,
GO batches and 2000-era syntax the way the server does.
It also verifies itself. Every result is re-parsed and its significant token stream compared against your input's, with a second check for the comments. Identical tokens mean an identical parse tree, so this proves equivalence rather than approximating it. If anything differs you get your original file back, untouched, and a distinct exit code. Measured over 2,215 real-world files: zero refusals, zero comments lost.
Use it with pre-commit
repos:
- repo: local
hooks:
- id: maxdop
name: maxdop
entry: maxdop --write
language: python
additional_dependencies: [maxdop==0.1.3]
types: [sql]
pre-commit builds a virtualenv, pip resolves the wheel for that machine, and the binary lands on PATH — nothing to install first.
Configuration
One .maxdop.json at your repo root, committed next to the code it formats, so
a repo formats the same way whoever opens it.
{
"maxWidth": 100,
"indentSize": 4,
"keywordCase": "upper",
"parserVersion": "latest"
}
Full documentation, other install methods, and the comparison against the other ten T-SQL formatters: https://github.com/pagebrooks/maxdop
MIT licensed.
Release files for maxdop 0.1.3
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Built distributions (wheels)
| File | Reset | |||
|---|---|---|---|---|
| maxdop-0.1.3-py3-none-win_arm64.whl | Python 3 | none | Windows ARM64 | Details |
| maxdop-0.1.3-py3-none-win_amd64.whl | Python 3 | none | Windows x86-64 | Details |
| maxdop-0.1.3-py3-none-musllinux_1_2_x86_64.whl | Python 3 | none | Linux musl 1.2+ x86-64 | Details |
| maxdop-0.1.3-py3-none-manylinux_2_17_x86_64.whl | Python 3 | none | Linux glibc 2.17+ x86-64 | Details |
| maxdop-0.1.3-py3-none-manylinux_2_17_aarch64.whl | Python 3 | none | Linux glibc 2.17+ ARM64 | Details |
| maxdop-0.1.3-py3-none-macosx_12_0_x86_64.whl | Python 3 | none | macOS 12.0+ x86-64 | Details |
| maxdop-0.1.3-py3-none-macosx_12_0_arm64.whl | Python 3 | none | macOS 12.0+ ARM64 | Details |
Total release size: 49.6 MB
Release files / maxdop-0.1.3-py3-none-win_arm64.whl
| Download URL | maxdop-0.1.3-py3-none-win_arm64.whl |
|---|---|
| Size | 6.4 MB |
| Tags | Python 3 Windows ARM64 |
|
SHA-256 checksum How to use checksums |
d8ffe113b9dbcdb3aae3a7fbcb5e159e54d0a17de0a8ca9cfb2d850b2e779011
|
|
BLAKE2b-256 checksum How to use checksums |
566db9c58e98529b9280035af99cdde7c02eb798fe79b98df1e0bb175a10f593
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Sep 25, 2026.
Transparency logRelease files / maxdop-0.1.3-py3-none-win_amd64.whl
| Download URL | maxdop-0.1.3-py3-none-win_amd64.whl |
|---|---|
| Size | 6.9 MB |
| Tags | Python 3 Windows x86-64 |
|
SHA-256 checksum How to use checksums |
b324f5fdc5eb4f085e79483bb9c637086aa3af8374314242ef52b94b98ad8500
|
|
BLAKE2b-256 checksum How to use checksums |
cfaa918bf91839edf7e4f9dc1a231054989f81ace70e77702a61f4d0141cd386
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Sep 25, 2026.
Transparency logRelease files / maxdop-0.1.3-py3-none-musllinux_1_2_x86_64.whl
| Download URL | maxdop-0.1.3-py3-none-musllinux_1_2_x86_64.whl |
|---|---|
| Size | 7.3 MB |
| Tags | Linux musl 1.2+ x86-64 Python 3 |
|
SHA-256 checksum How to use checksums |
e328c5e592ac670fe4f692c5586648c0b961da0f15803866b381c0e682b029f6
|
|
BLAKE2b-256 checksum How to use checksums |
74b6d3e92e183f9454a7278cc78a8a1d9b8b8183f5632c2afbc3c243d4a32ed7
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Sep 25, 2026.
Transparency logRelease files / maxdop-0.1.3-py3-none-manylinux_2_17_x86_64.whl
| Download URL | maxdop-0.1.3-py3-none-manylinux_2_17_x86_64.whl |
|---|---|
| Size | 7.3 MB |
| Tags | Linux glibc 2.17+ x86-64 Python 3 |
|
SHA-256 checksum How to use checksums |
58bd84337623c5ebd9e6b27c3756fa50b6fc13ae5e71315aa990cadaf5a67f25
|
|
BLAKE2b-256 checksum How to use checksums |
23635eb9be258520aa42e8e586020eeb0d7788687661cfbcc17f51ebcbaf62c2
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Sep 25, 2026.
Transparency logRelease files / maxdop-0.1.3-py3-none-manylinux_2_17_aarch64.whl
| Download URL | maxdop-0.1.3-py3-none-manylinux_2_17_aarch64.whl |
|---|---|
| Size | 6.7 MB |
| Tags | Linux glibc 2.17+ ARM64 Python 3 |
|
SHA-256 checksum How to use checksums |
ff86901e06859e302964349da7256b9d15365050e59f9db0b9c25ca423012cd1
|
|
BLAKE2b-256 checksum How to use checksums |
57430388eb349eb32f72f86bd3e9718324063fc00fd51a1e2b1d660c4053b6ad
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Sep 25, 2026.
Transparency logRelease files / maxdop-0.1.3-py3-none-macosx_12_0_x86_64.whl
| Download URL | maxdop-0.1.3-py3-none-macosx_12_0_x86_64.whl |
|---|---|
| Size | 7.9 MB |
| Tags | Python 3 macOS 12.0+ x86-64 |
|
SHA-256 checksum How to use checksums |
106f9bf5456626e22206828fd53bb3084307080b6002f7106a08fba29d05897c
|
|
BLAKE2b-256 checksum How to use checksums |
451c34e931b7a2ab9ac2c72e2d8c39586277e48e6cf8d5f632dd8e86a7e7cdf2
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Sep 25, 2026.
Transparency logRelease files / maxdop-0.1.3-py3-none-macosx_12_0_arm64.whl
| Download URL | maxdop-0.1.3-py3-none-macosx_12_0_arm64.whl |
|---|---|
| Size | 7.1 MB |
| Tags | Python 3 macOS 12.0+ ARM64 |
|
SHA-256 checksum How to use checksums |
c96deac830bd88450667920e67250c3a8455110dcbfddc2ec0c58e29f8292c8f
|
|
BLAKE2b-256 checksum How to use checksums |
eb77e24ae6408fbebf44a13c1ca6f695287840d5236425af0567afb23388bb12
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Sep 25, 2026.
Transparency log