--- id: ufmt version: "2.9.1" license: unclear license_treatment: permissive maintenance: active --- # ufmt — Safe, atomic formatting with black and µsort License: permissive · Maintenance: active · Downloads: 2.3M/mo ## What it is and what it does ufmt is a Python code formatter that wraps black and µsort, running both tools in a single atomic operation. It formats files in-memory, first with µsort and then with black, before writing changes back to disk. This design prevents conflicts or intermediate states that can occur when running these tools separately in CI/CD pipelines. The package is built for developers who want consistent, minimal diffs and safe handling without the risk of competing tools making conflicting changes. It integrates with GitHub Actions, pre-commit hooks, and Visual Studio Code, and supports checking, formatting, and diff-generation modes for different workflow needs. Use it for: - Enforce consistent Python formatting in CI/CD without conflicts between separate formatting steps. - Set up pre-commit hooks to automatically format code before commits with atomic changes. - Validate that files are properly formatted in pull requests using the check or diff modes. - Use as the default formatter in VS Code for automatic formatting on save. - Pin transitive dependencies in requirements files to ensure reproducible formatting across environments. ## Worth the install? AI-flagged interpretation of the facts above — verify before relying. ufmt combines black and µsort into a single atomic formatting pass, sorting imports and then formatting code in one operation before writing to disk. Yes. ufmt solves a real problem—atomic, conflict-free formatting in CI workflows—with low install friction, active maintenance, no known vulnerabilities, and a permissive license. It is well-integrated into common development tools and suitable for teams that want safe, predictable formatting. ## Install pip install ufmt uv add ufmt poetry add ufmt ## Installing ufmt Before you install: Low friction: pure Python wheel with 8 runtime dependencies (black, click, libcst, moreorless, tomlkit, trailrunner, typing-extensions, usort). Active maintenance with recent commits; last release 187 days ago. Requires Python 3.10 or newer. License in practice: MIT license (permissive). No restrictions on commercial or private use; you may modify and distribute freely with attribution. Quickstart: pip install ufmt ufmt format myfile.py ufmt check myfile.py ufmt diff myfile.py Requires Python 3.10 or newer. Verify before relying: - Whether pinning transitive dependencies (black, µsort) is necessary in practice to prevent unexpected formatting changes in CI workflows. - Performance characteristics when formatting large codebases or many files at once. ## Package facts - License: not declared (permissive) - Python support: supports_current - Install friction: low - Maintenance: active - Downloads: 2.3M/month (top 5,000 on PyPI) - Known vulnerabilities: none known ## Tags python code formatter with import sorting, atomic black and usort formatting, safe import sorter and code formatter, combined black µsort formatter, python formatter ci/cd workflow, prevent formatting conflicts formatter, in-memory formatting python, code-formatting, ci-cd [View on SkillFed](https://skillfed.io/packages/ufmt) · [View on PyPI](https://pypi.org/project/ufmt/)