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, SQL Server 2000 to 2025 plus Fabric DW. 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 compared against your input — token stream, tree and comments. 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.0]
        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": "2022"
}

Full documentation, other install methods, and the comparison against the other ten T-SQL formatters: https://github.com/pagebrooks/maxdop

MIT licensed.

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distributions

If you're not sure about the file name format, learn more about wheel file names.

maxdop-0.1.0-py3-none-win_arm64.whl (6.4 MB view details)

Uploaded Python 3Windows ARM64

maxdop-0.1.0-py3-none-win_amd64.whl (6.9 MB view details)

Uploaded Python 3Windows x86-64

maxdop-0.1.0-py3-none-musllinux_1_2_x86_64.whl (7.3 MB view details)

Uploaded Python 3musllinux: musl 1.2+ x86-64

maxdop-0.1.0-py3-none-manylinux_2_17_x86_64.whl (7.3 MB view details)

Uploaded Python 3manylinux: glibc 2.17+ x86-64

maxdop-0.1.0-py3-none-manylinux_2_17_aarch64.whl (6.7 MB view details)

Uploaded Python 3manylinux: glibc 2.17+ ARM64

maxdop-0.1.0-py3-none-macosx_12_0_x86_64.whl (7.8 MB view details)

Uploaded Python 3macOS 12.0+ x86-64

maxdop-0.1.0-py3-none-macosx_12_0_arm64.whl (7.1 MB view details)

Uploaded Python 3macOS 12.0+ ARM64

File details

Details for the file maxdop-0.1.0-py3-none-win_arm64.whl.

File metadata

  • Download URL: maxdop-0.1.0-py3-none-win_arm64.whl
  • Upload date:
  • Size: 6.4 MB
  • Tags: Python 3, Windows ARM64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.10.9 {"installer":{"name":"uv","version":"0.10.9","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Debian GNU/Linux","version":"12","id":"bookworm","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

File hashes

Hashes for maxdop-0.1.0-py3-none-win_arm64.whl
Algorithm Hash digest
SHA256 731cdbb6a3f6e5ed47c5511e4d5f0ef9759853fe61369499fbffc741396e9ada
MD5 359b2b5bb3f80343dab41c155821ea3f
BLAKE2b-256 015b7ccb91c92838a8414e46c8c6f11eb0598885b16699c4380b40a885e73f29

See more details on using hashes here.

File details

Details for the file maxdop-0.1.0-py3-none-win_amd64.whl.

File metadata

  • Download URL: maxdop-0.1.0-py3-none-win_amd64.whl
  • Upload date:
  • Size: 6.9 MB
  • Tags: Python 3, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.10.9 {"installer":{"name":"uv","version":"0.10.9","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Debian GNU/Linux","version":"12","id":"bookworm","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

File hashes

Hashes for maxdop-0.1.0-py3-none-win_amd64.whl
Algorithm Hash digest
SHA256 23f25d266bd27ed2ab5d147a68a301b104fe69f59c05fd692afbf23ace5e4ae5
MD5 2e570b5ca9670d34e974154b1b1c919a
BLAKE2b-256 a6ff88e33f0383595bce52ec2f2e1458d30ab3fe3d1be457708125f49b4e717c

See more details on using hashes here.

File details

Details for the file maxdop-0.1.0-py3-none-musllinux_1_2_x86_64.whl.

File metadata

  • Download URL: maxdop-0.1.0-py3-none-musllinux_1_2_x86_64.whl
  • Upload date:
  • Size: 7.3 MB
  • Tags: Python 3, musllinux: musl 1.2+ x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.10.9 {"installer":{"name":"uv","version":"0.10.9","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Debian GNU/Linux","version":"12","id":"bookworm","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

File hashes

Hashes for maxdop-0.1.0-py3-none-musllinux_1_2_x86_64.whl
Algorithm Hash digest
SHA256 477aa05ec5246bb5e218bdca1542803a3674b9c69fc3b5f6ea277daf35ccb40d
MD5 0a15bad3d0de9ef629cd2a096256e4fe
BLAKE2b-256 6f353e853927eda01a24c3fcd369f3dd07067d3de01507dc903049d90b9569e5

See more details on using hashes here.

File details

Details for the file maxdop-0.1.0-py3-none-manylinux_2_17_x86_64.whl.

File metadata

  • Download URL: maxdop-0.1.0-py3-none-manylinux_2_17_x86_64.whl
  • Upload date:
  • Size: 7.3 MB
  • Tags: Python 3, manylinux: glibc 2.17+ x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.10.9 {"installer":{"name":"uv","version":"0.10.9","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Debian GNU/Linux","version":"12","id":"bookworm","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

File hashes

Hashes for maxdop-0.1.0-py3-none-manylinux_2_17_x86_64.whl
Algorithm Hash digest
SHA256 ad40773228ca0cdc85c2f75d6c31fbac687c902b06bfc0ef3944f6e1804fb67e
MD5 45b539c484c8b01575cf9141829439f3
BLAKE2b-256 02b189ce7aabc6aa148cd76795e7dcca414ee7a0c8cdba867f9309b082e6874b

See more details on using hashes here.

File details

Details for the file maxdop-0.1.0-py3-none-manylinux_2_17_aarch64.whl.

File metadata

  • Download URL: maxdop-0.1.0-py3-none-manylinux_2_17_aarch64.whl
  • Upload date:
  • Size: 6.7 MB
  • Tags: Python 3, manylinux: glibc 2.17+ ARM64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.10.9 {"installer":{"name":"uv","version":"0.10.9","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Debian GNU/Linux","version":"12","id":"bookworm","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

File hashes

Hashes for maxdop-0.1.0-py3-none-manylinux_2_17_aarch64.whl
Algorithm Hash digest
SHA256 4e81076bbb906cca49156a96537c52c0b3c8df2bf95abda7a62dd6d357ec90fb
MD5 e52f0478039d7e5449a7a1c0dd217521
BLAKE2b-256 5b6a0d612d279cac2acebadff625ef9355c6f62ee27650f33b6fdc5c49f93803

See more details on using hashes here.

File details

Details for the file maxdop-0.1.0-py3-none-macosx_12_0_x86_64.whl.

File metadata

  • Download URL: maxdop-0.1.0-py3-none-macosx_12_0_x86_64.whl
  • Upload date:
  • Size: 7.8 MB
  • Tags: Python 3, macOS 12.0+ x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.10.9 {"installer":{"name":"uv","version":"0.10.9","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Debian GNU/Linux","version":"12","id":"bookworm","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

File hashes

Hashes for maxdop-0.1.0-py3-none-macosx_12_0_x86_64.whl
Algorithm Hash digest
SHA256 7b1902c67224928e6a0bee2b57e07f4a352331f96a3509e4009a8a2cedfe20a1
MD5 b65086b8a098a36403bb576c86a3ee7e
BLAKE2b-256 4c193e6734c1c50c2598b358f115477b9156be543f287530a879ce47b4b85477

See more details on using hashes here.

File details

Details for the file maxdop-0.1.0-py3-none-macosx_12_0_arm64.whl.

File metadata

  • Download URL: maxdop-0.1.0-py3-none-macosx_12_0_arm64.whl
  • Upload date:
  • Size: 7.1 MB
  • Tags: Python 3, macOS 12.0+ ARM64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.10.9 {"installer":{"name":"uv","version":"0.10.9","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Debian GNU/Linux","version":"12","id":"bookworm","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

File hashes

Hashes for maxdop-0.1.0-py3-none-macosx_12_0_arm64.whl
Algorithm Hash digest
SHA256 e8e9b3885ef7e22a77304d5bd46a6ac5a9cf2808ecf12a18be4fb10cde259766
MD5 ad97f195b7c4dda4d6bbd8f9d87ae6fa
BLAKE2b-256 3e523eab37199b0aedee8b5b24c75dfb4abf99f5900732fdb3d079c78de6051d

See more details on using hashes here.

Release history Release notifications | RSS feed

0.1.2

7 files

0.1.1

7 files

This release

0.1.0 This release

7 files

0.0.1

2 files

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