Skip to main content

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.4]
        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.

Metadata

Release files for maxdop 0.1.4

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Built distributions (wheels)

Table of built distributions (wheels) for maxdop 0.1.4
File Actions
maxdop-0.1.4-py3-none-win_arm64.whl Python 3 none Windows ARM64 Details for maxdop-0.1.4-py3-none-win_arm64.whl
maxdop-0.1.4-py3-none-win_amd64.whl Python 3 none Windows x86-64 Details for maxdop-0.1.4-py3-none-win_amd64.whl
maxdop-0.1.4-py3-none-musllinux_1_2_x86_64.whl Python 3 none Linux musl 1.2+ x86-64 Details for maxdop-0.1.4-py3-none-musllinux_1_2_x86_64.whl
maxdop-0.1.4-py3-none-manylinux_2_17_x86_64.whl Python 3 none Linux glibc 2.17+ x86-64 Details for maxdop-0.1.4-py3-none-manylinux_2_17_x86_64.whl
maxdop-0.1.4-py3-none-manylinux_2_17_aarch64.whl Python 3 none Linux glibc 2.17+ ARM64 Details for maxdop-0.1.4-py3-none-manylinux_2_17_aarch64.whl
maxdop-0.1.4-py3-none-macosx_12_0_x86_64.whl Python 3 none macOS 12.0+ x86-64 Details for maxdop-0.1.4-py3-none-macosx_12_0_x86_64.whl
maxdop-0.1.4-py3-none-macosx_12_0_arm64.whl Python 3 none macOS 12.0+ ARM64 Details for maxdop-0.1.4-py3-none-macosx_12_0_arm64.whl

Total release size: 49.6 MB

Release files / maxdop-0.1.4-py3-none-win_arm64.whl

Download URL maxdop-0.1.4-py3-none-win_arm64.whl
Size 6.4 MB
Tags Python 3 Windows ARM64
SHA-256 checksum
How to use checksums
19b1b53791c9cf19e7e28bd58464c87be25d46c7ba8f1d3e5d2fda4db4f88490
BLAKE2b-256 checksum
How to use checksums
9490979b2b50cf6c79b9ee3da024fb1a2515ff713141d23ab6bd0005238a5687
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

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 Nov 5, 2026.

Transparency log

Release files / maxdop-0.1.4-py3-none-win_amd64.whl

Download URL maxdop-0.1.4-py3-none-win_amd64.whl
Size 6.9 MB
Tags Python 3 Windows x86-64
SHA-256 checksum
How to use checksums
ae3d041153c4e9bbb69234743722b9830b646aba54e9152bd8f9bdd8cf21fb81
BLAKE2b-256 checksum
How to use checksums
ac3bf8017b2c2e326ab27170323aa26c4e7c21f37eb60f44df4900c4388fc2d7
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

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 Nov 5, 2026.

Transparency log

Release files / maxdop-0.1.4-py3-none-musllinux_1_2_x86_64.whl

Download URL maxdop-0.1.4-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
ef0395fd211481bc664fa0576df8078ca388a68919da4d2fdac3dd788d963368
BLAKE2b-256 checksum
How to use checksums
1e582c908915591885e785c22414f786cdfe7fcbf59d524807ff2026ae7de463
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

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 Nov 5, 2026.

Transparency log

Release files / maxdop-0.1.4-py3-none-manylinux_2_17_x86_64.whl

Download URL maxdop-0.1.4-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
f845e49ea8e46bb20048e941ed391585090296484c543dd03465ad606fe8937e
BLAKE2b-256 checksum
How to use checksums
572f9953051acbb3b5e09f6d6c67b05dceeace32a71fcb8e9eb3008b5f94b132
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

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 Nov 5, 2026.

Transparency log

Release files / maxdop-0.1.4-py3-none-manylinux_2_17_aarch64.whl

Download URL maxdop-0.1.4-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
1dbb221a364b17a8bde5298acbea5613880e11b9568c02436e4490a97df66271
BLAKE2b-256 checksum
How to use checksums
270f9719cc6f17be9b0f637142758350399a859725c196c2e9da1d356f81ce86
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

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 Nov 5, 2026.

Transparency log

Release files / maxdop-0.1.4-py3-none-macosx_12_0_x86_64.whl

Download URL maxdop-0.1.4-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
7efcdd34ae2c63d18f4048de8972e0b7f08ada7894ca8929818f5d66a63449cc
BLAKE2b-256 checksum
How to use checksums
533dde1bfc387c6a4d5394e863699b436f9930cbae5238248c499e99a0a4557f
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

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 Nov 5, 2026.

Transparency log

Release files / maxdop-0.1.4-py3-none-macosx_12_0_arm64.whl

Download URL maxdop-0.1.4-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
194da02b5c03bc00251bf255a9a115e7b08983c8def09230b57347979e8e0286
BLAKE2b-256 checksum
How to use checksums
34148908907baa3d08229e7efa8a97e1d0bf01884be2061bd1999752d43b2cea
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

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 Nov 5, 2026.

Transparency log

Security for maxdop 0.1.4

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.

Full provenance

All 7 files in this release have been uploaded with provenance metadata.

Select from 7 files

Attestation for maxdop-0.1.4-py3-none-win_arm64.whl

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 Nov 5, 2026.

Transparency log

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

0.1.4 This release

7 release files Full provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page