--- id: pyproject-fmt version: "2.27.1" license: unclear license_treatment: permissive maintenance: active --- # pyproject-fmt — Format your pyproject.toml file License: permissive · Maintenance: active · Downloads: 908.4K/mo ## What it is and what it does pyproject-fmt is a command-line formatter and Python library that applies consistent, opinionated formatting to pyproject.toml files while preserving comments. It follows the philosophy of tools like Black: minimal configuration by design, trading flexibility for predictability and smaller diffs. The tool can be used as a CLI (via pipx or uv), integrated into pre-commit hooks, or called directly from Python code via the run() function. It offers configuration through a [tool.pyproject-fmt] table in your pyproject.toml or a standalone pyproject-fmt.toml file, with options to control column width, indentation, table formatting style (short/long), spacing between tables, and automatic Python version classifier generation. The formatter normalizes your project metadata layout, handles dependency specifiers, and can expand or collapse nested table structures according to your preferences. Use it for: - Enforce consistent pyproject.toml formatting across a team or monorepo using a shared pyproject-fmt.toml configuration file. - Integrate into pre-commit hooks to automatically format pyproject.toml on every commit. - Programmatically format pyproject.toml files from within build scripts or CI/CD pipelines using the Python API. - Auto-generate Python version classifiers based on your requires-python setting to keep metadata up-to-date. - Standardize table formatting (collapsed dotted keys vs. expanded sections) across multiple projects. ## Worth the install? AI-flagged interpretation of the facts above — verify before relying. Formats pyproject.toml files with consistent, opinionated style and preserves comments, offering few configuration options by design. Yes. The package is actively maintained (release 2 days ago), has zero known vulnerabilities, supports modern Python versions (3.10–3.15), and solves a real problem—keeping pyproject.toml formatting consistent with minimal configuration overhead. The permissive MIT license and lack of runtime dependencies make it low-risk. Medium install friction from compiled wheels is standard for modern Python tools and not a blocker. ## Install pip install pyproject-fmt uv add pyproject-fmt poetry add pyproject-fmt ## Installing pyproject-fmt Before you install: Medium install friction due to compiled wheels across many platforms (cp310-abi3 through cp315-cp315t, multiple OS/architecture combinations), but actively maintained with a release just 2 days ago and no runtime dependencies to resolve. License in practice: MIT license (permissive) means you can use, modify, and distribute this tool freely with minimal restrictions. Quickstart: # Install via pipx or uv (recommended) uv tool install pyproject-fmt # Or use as a Python module from pyproject_fmt import run exit_code = run(["path/to/pyproject.toml"]) Requires Python 3.10 or higher to run. Verify before relying: - Whether the tool handles all TOML syntax edge cases beyond the documented configuration options. - Performance characteristics on very large or deeply nested pyproject.toml files. - Compatibility with non-standard or custom tool sections in pyproject.toml. ## Package facts - License: not declared (permissive) - Python support: supports_current - Install friction: medium - Maintenance: active - Downloads: 908.4K/month (top 5,000 on PyPI) - Known vulnerabilities: none known ## Tags pyproject.toml formatter, format python project config, consistent pyproject formatting, toml file formatter, python project metadata formatter, pyproject style consistency, automated toml formatting, formatter, pyproject-toml, build-tool [View on SkillFed](https://skillfed.io/packages/pyproject-fmt) · [View on PyPI](https://pypi.org/project/pyproject-fmt/)