Skip to content

Alternatives to ruamel.yaml? #5128

Description

@LecrisUT

Ruamel yaml has been serving us quite well, but the unclear upstream development is problematic. So I am looking at what we want in ruamel.yaml and what is the state of other libraries.

Requirements and nice-to-haves:

  • MUST: yaml1.2 support
  • MUST: equivalent or better performance
  • MUST: PyPI packaging and up-to-date wheels
  • MUST: round-trip yaml document update support
  • could: metadata to traceback sources (see ruamel-yaml-line-info)

Current state of projects

pyyaml

This is supposed to be the canonical supported project by yaml project itself, but it has not had yaml1.2 support for years now, and there are multiple issues raised on various python version compatibilities

yamlstar

Looks like a new project (first release Jan 2026) of the yaml project. The wheels are python version independent so that is more promissing. But it being rough around the edges is an understatement

ruamel.yaml

The pure python package works fine, it's just the compiled ones that are problematic. To get the round-trip support or metadata we also need to use the pure python implementation.

YAMLRocks

Because of course there is a rust based one. It still has python-dependent wheels, but at least they have the python3.15 wheels. It claims to have both round-trip and line source. But of course its first release was June 2026 and looks heavily AI-ed

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    status | blockedThe merging of PR is blocked on some other issue

    Type

    No type

    Projects

    • Status
      backlog
    • Status
      triaged

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions