skillfed

yamlfix

A simple opionated yaml formatter that keeps your comments!

yamlfix v1.19.1 1.1M downloads/30d#4,320 on PyPI262
Copyleft license GPL-3.0-only AGING released

What it is and what it does

yamlfix is a YAML formatter designed to reformat YAML files consistently while keeping your comments intact—a feature many formatters lose. It runs as a command-line tool and depends on click for CLI handling, ruyaml for YAML parsing, maison for configuration, and pydantic for validation. The package targets developers working with YAML configuration files who want automated formatting without losing inline documentation.

The project is in production/stable status and supports Python 3.9, 3.10, and 3.11. With over 1 million monthly downloads, it ranks in the top 5000 PyPI packages. The aging maintenance status reflects a 239-day gap since the last release, but the repository remains active and unarchived, indicating the tool is mature and not under active development rather than abandoned.

Use it for:

  • Automatically format YAML configuration files in CI/CD pipelines while preserving inline comments.
  • Enforce consistent YAML style across a team's infrastructure-as-code or Kubernetes manifests.
  • Pre-commit hook to standardize YAML formatting before committing configuration files.
  • Batch reformat existing YAML files to a consistent style without losing documentation.
  • Integrate into linting workflows alongside other code quality tools for configuration files.

Worth the install?

AI-flagged interpretation of the facts on this page — verify before relying

yamlfix is a command-line YAML formatter that reformats YAML files according to an opinionated style while preserving comments.

Yes, if you need YAML formatting with comment preservation and accept GPLv3 licensing. The low install friction, stable maturity, and high download volume indicate a reliable tool. The aging maintenance is not a blocker for a stable formatter, but verify that the opinionated style matches your team's needs before adopting it widely.

Install

yamlfix on PyPI

pip

pip install yamlfix

uv

uv add yamlfix

poetry

poetry add yamlfix

Installing yamlfix

Before you install

Low install friction with four straightforward runtime dependencies. Maintenance status is aging—last release was 239 days ago—but the repository remains active and not archived, suggesting the project is stable rather than abandoned.

License in practice

GPLv3 is a copyleft license; any derivative work or modification must also be licensed under GPLv3. If you are building proprietary software or have license compatibility constraints, this may restrict your use.

Quickstart

pip install yamlfix

import yamlfix

formatted = yamlfix.fix_yaml(yaml_content)

Requires Python 3.9.1 or later.

Verify before relying

  • Whether yamlfix can be used as a library API (the snippet assumes it, but the fact sheet emphasizes command-line usage).
  • What specific formatting rules the 'opinionated' style enforces and whether they are configurable.

Package facts

License GPL-3.0-only (copyleft)
Python support supports the current Python release (>=3.9.1)
Install friction low — pure-Python wheel
Runtime dependencies 4 — click, ruyaml, maison, pydantic
Maintenance aging — 239 days since the last release
Last repo commit
First released
Downloads 1,129,395/month — #4,320 on PyPI (30-day window, as of 2026-08-14)
Known vulnerabilities none known (OSV.dev, checked 2026-08-14)

Evidence: yamlfix-1.19.1-py3-none-any.whl

Development Status :: 5 - Production/StableIntended Audience :: DevelopersLicense :: OSI Approved :: GNU General Public License v3 (GPLv3)Natural Language :: EnglishOperating System :: POSIXOperating System :: UnixProgramming Language :: PythonProgramming Language :: Python :: 3Programming Language :: Python :: 3.10Programming Language :: Python :: 3.11Programming Language :: Python :: 3.9Topic :: Utilities

Tags

yaml formatteryaml linterformat yaml filesyaml style checkeryaml code formatteryaml beautifieryaml comment preserving
yaml-formattingcli-toolconfiguration-management

More Utilities packages