This repository contains two comment-preserving TOML formatters:
pyproject-fmtformatspyproject.toml. See its PyPI package, guide, and release history.tox-toml-fmtformatstox.toml. See its PyPI package, guide, and release history.
Both packages provide a command-line tool, Python API, and pre-commit hook. See CONTRIBUTING.md for the workspace layout and development commands.